Live data from Hacker News

Python: Please stop screwing over Linux distros

drewdevault.com

361–370 of 384 posts

Re: Python: Please stop screwing over Linux distros

#361

Earlier quoted context omitted.

I’m not a Python dev. I do need to occasionally run things written in Python. I made the mistake of trying to get pip + Conda + pyenv (or whatever) to install a fairly simple tool. I have no idea how the dev got their setup working, but it was totally and utterly unreproducable, even after they sat down on my computer for several hours. In that amount of time, I could have probably rewritten it in PHP (that’s actuall…

It's not really the fault of Python that somebody fucked their environment beyond belief. I've always used pip and almost never had a problem. A "fairly simple" application should not require the tools you mentioned.

That, my friend, is called a filter bubble. And your comment is not productive btw. I for one never "fucked my environment", I only ever used distro packages and I still couldn't make a simple script even start without it spitting cryptic error messages about modules or paths.

I'm not a Python dev; I just needed to run a tool that didn't have any other alternatives.

Meanwhile, I can download scripts written in a range of other languages and just fire 1-2 commands and the thing will work.

With Python? Almost never.

Re: Python: Please stop screwing over Linux distros

#362

Earlier quoted context omitted.

I’m not a Python dev. I do need to occasionally run things written in Python. I made the mistake of trying to get pip + Conda + pyenv (or whatever) to install a fairly simple tool. I have no idea how the dev got their setup working, but it was totally and utterly unreproducable, even after they sat down on my computer for several hours. In that amount of time, I could have probably rewritten it in PHP (that’s actuall…

> I have no idea how the dev got their setup working Tip: in such situations I start looking at the CI scripts in their repositories. Not ideal but gets me through!

Same BTW. And I started having a Docker image for each Python script that I need to run (I'm not a Python dev). Took me a while but I've mostly tamed the beast. And at least I can run the occasional script that has no alternatives.

Re: Python: Please stop screwing over Linux distros

#363

Earlier quoted context omitted.

> you can't be fully sure that upgrading everything to the latest version is not going to break anything. Well, it's still what you do every time you create a new project. > It is mandatory in quite a lot of package managers. Ok but many packages won't be installable at all anymore, because people pin different versions instead of maintaining their packages by continuously integrating upstream releases. > You can't l…

> Well, it's still what you do every time you create a new project. Yep, and it is a pain in the ass when the package you want to use creates a dependency conflict. Luckily, at that stage I can still search for an alternative with little to no cost. > Ok but many packages won't be installable at all anymore, because people pin different versions instead of maintaining their packages by continuously integrating upstre…

> Packages go into abandonware all the time, removing version pinning doesn't fix that.

Abandoned dependencies should be treated like dropped features: re-implement them in your own code or create another library.

> Thank you for telling me this, I will be relaying to my clients that they need to upgrade their systems to newer Python versions to get new features, surely that will go well.

Very funny, but seriously they should have an upgrade path, or install their machine once and then never do a single upgrade, but again I'd say this is just tech debt piling.

> Waiting to release on new dependency versions until those versions are tested is not tech debt.

Not having your own tests is tech debt thought. I wouldn't rely on tests made by others.

> I mean, semantic versioning was done with this purpose precisely: to signal which upgrades are just bug fixes and you should upgrade ASAP

Of course I agree, the problem is that maintainers tend to not upgrade as often as they should, like until they really have too (another dependency upgrades a shared dependency). Again I see this as a maintainance problem rather than a package manager problem.

> If living at latest release works for you and dealing with dependency issues on new installations is not a problem, then go.

I'm not saying I never had a problem of course I do, I'm saying that having these problems has a better cost/benefit ratio at the end of the year, because: 0. they are smaller, dealing with one BC break at the time, and 1. they are spread over time because I integrate upstream releases continuously instead of waiting for the day I want to upgrade everything.

> "oh, it's just that this dependency released a new version that broke things and we didn't specify the version that our software needed"

I'd rather say "oh, it's just that this dependency released a new version that we are implementing support for as we speak, here's the command you can run to fix it meanwhile: ...".

But if you don't want to have that problem, just run your CI periodically, make sure the first thing you do in the morning is checking that nightly did actually pass tests, as you're talking about paid software maintenance, I'm talking about both paid and volunteer so that's why I'm including "wait for a user to report" but that doesn't apply for paid maintenance of course.

For me we're seeing the discussion between two fundamentally opposite approaches, one being defensive and the other being offensive / actual continuous integration. From my experience, the offensive strategy offers a better cost/benefit ratio at the end of the year.

Re: Python: Please stop screwing over Linux distros

#364

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…

Interesting idea, we should be able to hook before `sys.modules` cache or make on of such cache for each module in Python then we should be able to produce this. However, I thought the point was helping distro package management, which, to my knowledge, is not really built to support multiple installed versions of a package at the time: `dnf upgrade` for example, will upgrade all single instances of each packages to…

Actually you can already override __import__ and implement this, but then you still need an installer, and distro support for multiple instances of a same package.

Re: Python: Please stop screwing over Linux distros

#365
If you avoid placing packages in the distribution's system Python (by using a venv) and if you aren't using some outdated distro version, your Python should be good enough. You must write backwards compatible code anyway, if your application is to last more than six months.

It is not the end of the world to be using one or even two minor versions older than the current Python version. New features must be implemented in your code and relying on bleeding edge features of your language (in production code) is outright bad design. If the core Python developers like to experiment and break their language, you are best to avoid jumping head first into that mess.

TL;DR: Keep your requirements conservative. You are not bewilden to the Python core developers, your target are your users.

Re: Python: Please stop screwing over Linux distros

#366

Blaming Python vice Linux distros isn't important. The implicit agreement that a system Python will be set up in a certain way, with a certain version etc is fragile. Programs and processes included with a Linux distro expecting a certain Python set up is a problem - it's making assumptions about system state. Python doesn't include tools for managing versions, dependencies, and standalone programs. Linux distros use…

Can you link to your tool?

Re: Python: Please stop screwing over Linux distros

#367

Blaming Python vice Linux distros isn't important. The implicit agreement that a system Python will be set up in a certain way, with a certain version etc is fragile. Programs and processes included with a Linux distro expecting a certain Python set up is a problem - it's making assumptions about system state. Python doesn't include tools for managing versions, dependencies, and standalone programs. Linux distros use…

Can you link to your tool?

https://github.com/David-OConnor/pyflow

Re: Python: Please stop screwing over Linux distros

#369
post #134

Earlier quoted context omitted.

> Perl is a godsend... take a code from 20 years ago, run it on a modern system, and everything works. That's more or less like "take a VB6 binary from 20 years ago, run it on some modern Windows, and everything works" - that's just because the ecosystem is effectively dead, so supporting it on new releases just means carrying over some stuff that worked 20 years ago.

It is because Windows has a stable API and still has all the old functions

Yes, Win32 API is ancient. No, it does not mean it's useless.

Re: Python: Please stop screwing over Linux distros

#370
post #332
post #318

Earlier quoted context omitted.

Sure, if I release the code I tend to do just that. However a lot of the code I have been writing was to be used on servers where installing poetry was not an option. That means there was no straightforward, well documented or otherwise easy way to copy the project onto the server an "just have it work". And this was not due to me not taking care of my dev environment. Now I know how to do this, so this is not a prob…

If installing Poetry wasn’t an option, deploying a frozen set of dependencies should be still relatively easy with plain ”pip freeze” and “pip install -r”.

Sure, I am convinced there is a ton of ways. They are just not well documented or straightforward
Post reply on HN