|
|
Log in / Subscribe / Register

Python packaging targets

Python packaging targets

Posted Mar 27, 2023 16:08 UTC (Mon) by sammythesnake (guest, #17693)
Parent article: Python packaging targets

I've been doing a lot of in-the-background thinking about the *many* difficult packaging situations that get lots of discussion here and elsewhere. I'm mostly coming from a desire tokeep the advantages my distribution-provided package management has while still allowing for random programs to do stupid stuff without breaking the world.

It seems to me that there are two particularly key things that distros and various non-distro package/dependency management systems could agree to cooperate on that would make a huge difference and would likely consolidate a lot of the stuff we're endlessly fighting against into a relatively simpler set of problems with much more shared code/behaviour (though still involving a chunk of new work!)

1. Distros should be much happier having multiple versions of the same package available, with suitable cleverness to provide the "correct' version to any software that runs

2. Tools like pip/cargo/npm/uncle Tom Cobley and all should be able to make use of the OS provided package manager to satisfy dependencies where suitable versions are available.

Imagine a conversation something like this:

UTC: $OS, I'm installing Package_FOO v1.1, it depends on Package_BAR>=1.1<2.2, Package_BAZ>=5.5<7.7, and Package_QUX>=6.3

$OS: I can provide Package_FOO 1.5, 1.6, or 1.7, and Package_BAZ 5.8, but no Package_QUX

UTC: Here's Package_QUX 6.9, and Package_FOO v1.1

$OS: Gotcha, Fam!

Then whenever Package_FOO is used, it gets suitable versions of its dependencies, possibly using some magic with containers and bind/union mounts to de-dup a bunch of stuff.

If we've got this in place, it would also potentially make it easier to support a variety of non-privileged package installation stories, which could be exciting...

There are a lot of hairy details to sort out, of course, but I can't help thinking this is a potential way towards happiness!

Hairy details that occur to me:

1. Version specifications will probably be a lot more complex than in my example, including multiple allowable version ranges, details of how the packages are built (which CPUs are supported, which features are enabled etc.) and more.

2. The dependency graph for some packages might be arbitrarily complex, so we'd probably end up with UTC providing the whole graph to $OS to sort out multiple possible combinations

3. The upgrade story needs some care(!) We'd want to allow $OS to upgrade Package_BAR to 1.9 and remove 1.7 when no packages depend on it, with the user able to control which packages get their dependencies upgraded when. This is basically the same as a normal distro upgrade process except that different packages might have different upgrade schedules, as well as different version requirements.

4. We'd want users (and sysadmins) to have suitable policy control over how UTC-provided package are shared (single package only, per user, per non-distro-provider, system wide...)

5. The interface at which "Packages" meet is *complex*. Version requirements and matching will likely be different depending on whether we're talking about dynamic linking to libraries, calling external binaries, connecting to other processes over pipes/networks...

6. Obligatory https://xkcd.com/927/

7. All the still remaining reasons why Package Management Is Hard that this idea doesn't address.

8. The whole concept is a half-baked cockamamie wild goose chase dreamt up by a chump who would need much smarter people to shoot it down / fix it / implement it :-P


to post comments

Python packaging targets

Posted Mar 27, 2023 16:46 UTC (Mon) by pizza (subscriber, #46) [Link]

> 1. Distros should be much happier having multiple versions of the same package available, with suitable cleverness to provide the "correct' version to any software that runs

Distros are already fundamentally able to do this in the general sense, but the individual languages/runtimes/whatever need to support [semantically] versioned package namespaces, and enforce that through culture... and tooling that does the right thing by default.

Python packaging targets

Posted Mar 27, 2023 20:49 UTC (Mon) by Wol (subscriber, #4433) [Link]

You're describing pretty much what I tried to get into the LSB. We're talking early 90s - that's THIRTY yearts ago, and there's been f-all progress ...

We need a PACKAGE to be able to pass a list of requirements to the OS. There's no damn use the OS telling a package what it's got, it needs the package to tell it what it requires. I wanted to enable proprietary packages to pass their list of dependencies to the OS, but the same principle holds for FLOSS software as well - it needs to be able to tell the OS what it needs.

Given my complete lack of success, I doubt you'll do any better :-( The LSB was all about the package being able to ask "have you got lsb package X?", bugger all use to your normal user ...

Cheers,
Wol


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds