Live data from Hacker News

Python: Please stop screwing over Linux distros

drewdevault.com

91–100 of 384 posts

Re: Python: Please stop screwing over Linux distros

#91
The success of Python and Go shows that people don't care as much about what distributions maintainers feel is "quality packages".

The scale and quantity of software being developed is just too much for traditional Linux distributions approaches. I personally rely on Debian to know that most of the packages I use are reasonably secure. But often I need to sacrifice flexibility and bleeding-edgedness.

And it couldn't be otherwise. There are 339,267 projects on PyPi.org. I bet a good percentage of these are riddled with security flaws. But people use them anyway. How many distro maintainers would you need to handle this workload? Is it worth it? Does anyone care?

It looks like people care much more about experimentation and speed of development than stability, security or coherence and cleanliness of the solution. The author seems to feel this is wrong from an engineering (or even moral?) perspective.

I am also uncomfortable when I have to deal with Python and I have my own favourite few tools... but perhaps if Python users really wanted a single solution then it would already exist.

If you are instead convinced that there is this need and no adequate solution, then congratulations, you just found a gap in the market. Go on and do better than everyone else before you. Relevant XKCD comic is already in the article...

Re: Python: Please stop screwing over Linux distros

#92

Distros, please stop screwing over Python packaging. It is incredible that Debian/Ubuntu pick Python apart and put modules into different packages. They even create a fake venv command that tells you to please install python-venv. What they should just do is offer a bunch of packages like python3.7, python3.8 that install the official python package wholesale into /usr/python or someplace and then symlink one of them…

Homebrew does this very well with its "cellar" system. Every version of every package gets installed to its own root tree, eg `/usr/local/Cellar/python/3.9.7/`. The currently-active version is then symlinked into `/usr/local/opt/python` and from there into `/usr/local`.

I believe Nix and Guix also work this way.

Re: Python: Please stop screwing over Linux distros

#93

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"…

> I like poetry, and I think most people are heading that way, but it doesn't seem to play super nice with pyenv Do you have an example of a situation when the two tools had issues? I've been using both for years, and don't remember having any problems.

Yes. I tried to use Gitpod (a cloud development env platform) which ships with pyenv. Poetry would very stubbornly only use the system python and completely ignore whatever the pyenv shim was pointing to.

Re: Python: Please stop screwing over Linux distros

#94
post #60

Earlier quoted context omitted.

The problem here is that distros only supply one version of the package which means you gain nothing by having that same version installed in multiple virtualenvs. So I guess the problem actually lies in the python library ecosystem that's becoming a npm like dependency hell. The relevant question here is probably whether the library ecosystem is like that because the packaging tooling sucks or is it the other way ar…

Well, that's not true: - Almost all distros don't just supply one version of a package. They try to avoid it, but I can't recall one with a hard rule against it. For instance, Debian packages multiple versions of autoconf https://packages.debian.org/search?keywords=autoconf2 , the Linux kernel, etc. - One reason that distros try not to install multiple versions of a package is that it's hard to specify which one you…

> The possibility you haven't accounted for is "The library ecosystem is like that because things are fast-moving, because people have actual problems they want to solve, and upgrading dependencies and sorting out conflicts is work."

Sorry, I was overly aggressive in my previous comments. All I want is the Python ecosystem to acknowledge some people prefer stable over fast moving, recognize the importance of that and work towards a solution that isn't horrible for their use case.

We all depend on someone somewhere deep in our stack caring for stability, even when we don't realize it.

Re: Python: Please stop screwing over Linux distros

#95

Distros, please stop screwing over Python packaging. It is incredible that Debian/Ubuntu pick Python apart and put modules into different packages. They even create a fake venv command that tells you to please install python-venv. What they should just do is offer a bunch of packages like python3.7, python3.8 that install the official python package wholesale into /usr/python or someplace and then symlink one of them…

> Get rid of the requirement that there is only one stable (minor) version of a package in the distribution at one time.

I think this requirement made sense when disk space was scarce.

I think this requirement makes sense if you trust that your distro is always better at choosing the 'best' version of a dependency that some software should use than the software author.

Nowadays, I think neither is generally true. Disk is plentiful, distro packages are almost always far more out of date than the software's original source, and allowing authors to ship software with specific pinned dependency versions reduces bugs caused by dependency changes and makes providing support for software (and especially reproducing end-user's issues) significantly easier.

Isolating dependencies by application, with linking to avoid outright duplication of identical versions (a la pnpm's approach for JS: https://pnpm.io/) is the way to go I think. Honestly, it feels like the way it's already gone, and it's just that the distros are fighting it tooth & nail whilst that approach takes over regardless.

Re: Python: Please stop screwing over Linux distros

#96
post #80

Earlier quoted context omitted.

there's https://github.com/spotify/dh-virtualenv

That's cool. Anybody using this? How robust is it?

it's decent. though these days building container and shipping it with a `docker exec` shim is much easier.

Re: Python: Please stop screwing over Linux distros

#97
post #33

Python libraries shipped by distributions are so old that this mechanism is mostly useless for python development. This also applies to many others programming languages which have their own packaging systems. While python packaging is indeed messy the needs of traditional linux distributions are by far the least important. Python packaging needs to better serve the needs of python developers, not those of sysadmins.…

Perhaps the distributions would be more inclined to include up-to-date version if the standard in the python community was not to break everything all the time.

There are distributions that keep up-to-date, though, e.g., archlinux.

Serving the needs of python developers vs. sysadmins is a false dichotomy. Python developers develop on a system that they need to admin. One great thing about linux is that everything on a system can be kept up-to-date using just one software tool (a package manager). You are not going to convince me in a million years that this is a bad idea.

Now, for things that are needed in development you sometimes need different versions, in particular if you happen to have an OS that ships very old versions. For that purpose there should be some sort of tool and not a gazillion tools that are all incompatible and behave in slightly (or not so slightly) different ways. 'python -m venv' is different from 'virtualenv'? WTF?

Also, if your distribution is up-to-date (e.g., archlinux) and you are pinning to older version there is also a problem. As the article puts it 'pin their dependencies to 10 versions and 6 vulnerabilities ago'. And if you actually want to maintain your software in the future you, at some point, have to go to the new version anyway.

Re: Python: Please stop screwing over Linux distros

#98
The day packaging for distros will be easy, we will use it. Right now, making a deb is hard. Isolating 2 projects with different deb verions is hard. Distributing debs is hard. Upgrading your OS but not your python debs is hards.

Then rinse and repeat for red hat, arch, nix, mac and windows ?

Yeah right.

Re: Python: Please stop screwing over Linux distros

#99
post #55
post #18

Am I the only one that is not having issues with python and distributions in general? I get all my dependencies from Debian and they all work, when I need something that is not yet packaged, I use pip. What are people doing to get all this issues? I don't understand...

Looks like the "Works on my machine" syndrome. What about working on a project with a team? What about deploying the code on another machine?

I'm impressed how a simple message lead to all these assumptions but I still don't understand where the connection is.

Yes, that is in the context of a giant and very successful team using this approach, believe or not. :)

Re: Python: Please stop screwing over Linux distros

#100
post #87

Earlier quoted context omitted.

Language specific package managers are the antithesis of package management. There is no "management" in "install multiple versions of stuff in this 10 levels deep dependency tree". Upstreams can pick their dependencies but at the same time cannot control what packages depend on them and make it into your app and neither can you. That's a job for your distro.

What happens if your project needs an update, but it will hose the OS? Do you expect someone working in Python in Windows who wants to distribute a datetime package should package for RPM and APT? I used to think OS package managers should be the end-all be-all, but the use cases for OS package managers are very different from language runtimes. While different Linux distros were fighting between themselves, they com…

> What happens if your project needs an update, but it will hose the OS?

Whay do you mean by "needs an update"?

> Do you expect someone working in Python in Windows who wants to distribute a datetime package should package for RPM and APT?

Absolutely not. I expect a serious user of that library on an apt based system to package it and submit the package to their distro.

Post reply on HN