Subject: Avoiding ‘propagated-inputs’ for Python dependencies

From: [email-masked] (Ludovic Courtès)
Date: Sat, 10 Jun 2017 15:39:56 +0200

Heya,

(+Cc: Hartmut.)

Marius Bakke <[email-masked]> skribis:

> Ludovic Courtès <[email-masked]> writes:

[...]

>> Perhaps we could modify ‘sys.path’ from the top of ‘__init__.py’ file to
>> get something similar to RUNPATH.  I’m not sure if there are any
>> downsides or gotchas.  Thoughts?
>
> Python actually has a native mechanism for setting up package-specific
> search paths: https://docs.python.org/3/library/site.html
>
> In short, it looks for a file "package.pth" where additional search
> paths can be specified (other sys.path manipulations are allowed too).

Looks good at first sight.

> I asked Hartmut about this during the python-build-system refactoring,
> and the counter-argument was that if package A and B depends on
> different versions of package C, odd failures could occur. I'm not
> convinced propagation sidesteps this problem, however:
>
> https://lists.gnu.org/archive/html/guix-devel/2016-10/msg00856.html

I think we’re in trouble anyway if multiple versions of a package end up
in the dependency graph because that’s not something Python supports
(the same is probably true for most languages, with the notable
exception of Node.)

Perhaps it would be worth making a PoC to see what happens with a small
set of packages?

(I’m not volunteering though, just trying to tweak others into doing
it.  :-))

Ludo’.