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

Daniel Holth dholth at gmail.com
Fri Mar 17 11:14:04 EDT 2017


At least *.egg-info works without-a-version and will be written that way
when installed in development mode. As a shortcut when possible
pkg_resources would read the package name and version number from the
filename and not bother looking inside the metadata file until necessary. I
don't recall whether the same can be said of *.dist-info.

You will probably find that pkg_resources always does a listdir for each
entry on sys.path when it runs. You might not be able to avoid that.

On Fri, Mar 17, 2017 at 10:48 AM Paul Moore <p.f.moore at gmail.com> wrote:

On 17 March 2017 at 14:40, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Unless the __init__.py has its own __path__ extension code, whichever
> version of "foo" is first on sys.path will "win", and you won't be able to
> import from the other one (so you'll be able to import "foo.bar" or
> "foo.baz", but not both). That's not an accident, it's behaviour that was
> deliberately kept for backwards compatibility reasons when PEP 420's
native
> namespace package support was being designed.

Really? OK, I feel stupid now, I've been making a fuss over something
that's actually not possible. I should have tested this. My apologies
(in my defense, I could have sworn I remembered someone else making
precisely this point sometime in the past, but I guess I'll have to
put that down to advancing age and brain decay...)

My apologies, I stand corrected.
Paul
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG at python.org
https://mail.python.org/mailman/listinfo/distutils-sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20170317/fab49c56/attachment-0001.html>


More information about the Distutils-SIG mailing list