Live data from Hacker News

Python: Please stop screwing over Linux distros

drewdevault.com

1–10 of 384 posts

Re: Python: Please stop screwing over Linux distros

#2
I am not one to install python packages using my distro's package manager, but I totally agree with the sentiment that we need a more standard build/dependency management system in python. I like poetry, and I think most people are heading that way, but it doesn't seem to play super nice with pyenv (which is a critical tool) a lot of the time, and I think that a first party endorsement of the "one true build system" a la golang or rust would be a huge step.

Re: Python: Please stop screwing over Linux distros

#4

And stop putting everything on the planet into a god damn virtual environment.

Virtual environments are a good way to have different packages for different applications running on different versions of Python. My usual rule is you don't mess with the system-provided Python environments for specific applications you are working with. I would even suggest dropping support for many packages at the distro level unless they are required by other non-python packages (the same way Django and Twisted are requirements for MaaS).

Re: Python: Please stop screwing over Linux distros

#5
I've had success restricting myself to Python packages provided by the OS (Debian) in production. The only down-side is there is only one Python (well, 3.* or 2.7) against which to test, so I drop back to a pip install of the same packages for CI, and that's where 90% of my Python pain comes from, every maintainer of every Python infrastructure package feels entitled to shout "DEPRECATION, do THIS, do THAT, use THIS" at me. It's ill-mannered and unpleasant.

Re: Python: Please stop screwing over Linux distros

#6
This is a very weird post to read, as someone who does (occasional) distro Python work - I feel like Python absolutely is listening to us! It's just that it's hard work, and distro packaging is mostly done by volunteers, and there are a whole lot of things to work through.

Here's some work I and others did earlier this year, which I thought was a great example of folks from the core Python packaging world and folks from distros working together: https://www.python.org/dev/peps/pep-0668/ See the massive table of use cases for all the things we had to think about.

You might note that one of the things it needs is additional participation on the Discourse thread from the authors (like myself) and from other distros. Again. It's mostly work done by volunteers, and there's a lot to work through. There's no magic to it.

I can tell you that the following (from TFA) will absolutely make things worse for distros, though:

> I call on the PSF to sit down for some serious, sober engineering work to fix this problem. Draw up a list of the use-cases you need to support, pick the most promising initiative, and put in the hours to make it work properly, today and tomorrow. Design something you can stick with and make stable for the next 30 years. If you have to break some hearts, fine. [...] These PEPs are designed to tolerate the proliferation of build systems, which is exactly what needs to stop. Python ought to stop trying to avoid hurting anyone’s feelings and pick one.

If you want the PSF to fund some engineering work on its own that it can finish much faster than any volunteer packager can even read the proposal, break some hearts, stop proliferating build systems, and hurt people's feelings, they will absolutely do that and say "Distro packaging is not supported, we only support virtualenvs. Users should make virtualenvs. Distro software should ship virtualenvs. Installing a Python package systemwide is meaningless." That's clearly the best-supported option right now, and it's a surprisingly technically defensible answer, but it's not going to make you happy.

Re: Python: Please stop screwing over Linux distros

#7

I am not one to install python packages using my distro's package manager, but I totally agree with the sentiment that we need a more standard build/dependency management system in python. I like poetry, and I think most people are heading that way, but it doesn't seem to play super nice with pyenv (which is a critical tool) a lot of the time, and I think that a first party endorsement of the "one true build system"…

Golang is a great model to follow. I think the fundamental thing that python (and ruby, when I still used it) has taught me is to run a mile if a language is without a robust dependency management system. The pain is just not worth it, even for a nice language with an otherwise robust ecosystem.

Re: Python: Please stop screwing over Linux distros

#8
post #4

And stop putting everything on the planet into a god damn virtual environment.

Virtual environments are a good way to have different packages for different applications running on different versions of Python. My usual rule is you don't mess with the system-provided Python environments for specific applications you are working with. I would even suggest dropping support for many packages at the distro level unless they are required by other non-python packages (the same way Django and Twisted a…

> don't mess with the system-provided Python environments for specific applications you are working with

Right, but then just use pip install --user instead of a virtualenv. Actually --user is the default now when running pip install from non-root user, so, just pip install as a user will work and not mess with the system packages, just don't do sudo pip install.

Re: Python: Please stop screwing over Linux distros

#9
Everyone complained, no one addressed the fact that for years the whole of python packaging was handled by like 2.5 people.

But as a rant this, like most of the ‘but just fix it’ rants, fails to acknowledge the hugely diverging needs of different users. I could not live without conda, since it’s the only sane way to get a working recent geospatial stack. Others need to run embedded environments, or portable ones, some need long term stability while others need bleeding edge packages that haven’t been released yet. Solving for a single case is straightforward; solving for all of them , not so much.

Re: Python: Please stop screwing over Linux distros

#10
post #4

And stop putting everything on the planet into a god damn virtual environment.

Virtual environments are a good way to have different packages for different applications running on different versions of Python. My usual rule is you don't mess with the system-provided Python environments for specific applications you are working with. I would even suggest dropping support for many packages at the distro level unless they are required by other non-python packages (the same way Django and Twisted a…

Apt and desktop environments need to break their Python dependencies then, or stop doing daft things like colliding different 3.x run levels on the same runtime path.

Go ahead and install pip3 from Python 3.6. use that to install pip3 for 3.8, and try using apt. Backup first.

Post reply on HN