[Distutils] [proposal] version-free + lookup-friendly dist-info location

Paul Moore p.f.moore at gmail.com
Fri Mar 17 10:00:53 EDT 2017


On 17 March 2017 at 13:34, Donald Stufft <donald at stufft.io> wrote:
> Hmm, I believe it generally works fine does it not? The only situations I
> can think of where it does something funny are:
>
> (1) PEP 420 namespace packages where a file was added or removed in one of
> the versions (since that is impossible to differentiate from two different
> projects using the same namespace)
> (2) Uninstalling/Installing the same package during the lifetime of a
> process (which is already going to break in weird ways).
>
> What scenarios are you seeing two installs of the same package into
> different sys.path directories fail?

I don't have an actual failure, although I do think I've seen reports
in the past - it's definitely something that's come up in previous
discussions.

As a theoretical example:

foo 1.0 looks like this:

    foo
        __init__.py
        bar.py

foo 2.0 moves the functionality of foo/bar.py into baz.py

    foo
        __init__.py
        baz.py

Put both of these on sys.path, then you can successfully import
foo.bar and foo.baz. Which is of course wrong. Furthermore, which
version of foo/__init__.py gets imported depends on which version of
foo is first on sys.path, so one of bar and baz will be using the
wrong foo.

IMO, of course, the answer is simply "don't do that". But I'm OK with
simply leaving things as they stand if no-one else thinks it's worth
making an issue of it.
Paul


More information about the Distutils-SIG mailing list