Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.1.1 not available on pypi.org #2

Closed
dvzrv opened this issue Jun 8, 2022 · 3 comments
Closed

Version 3.1.1 not available on pypi.org #2

dvzrv opened this issue Jun 8, 2022 · 3 comments

Comments

@dvzrv
Copy link

dvzrv commented Jun 8, 2022

Hi! I'm currently working on improving the packaging for this project on Arch Linux.
I noticed that version 3.1.1 is tagged in this repository, but it is not available on pypi.org (current release history has 3.1.0 from 2022 as the latest release).

As 3.1.1 deprecates the jaraco/__init__.py file this is a rather important change it seems.

Somewhat related to the above mentioned change: Can downstreams use your namespaced packages, if none of them provides the jaraco/__init__.py file? If I understand PEP420 correctly, an empty file is not required but the discussion section mentions performance penalties with namespaced packages.

@dvzrv
Copy link
Author

dvzrv commented Aug 27, 2022

@jaraco ping

@jaraco
Copy link
Owner

jaraco commented Aug 27, 2022

Can downstreams use your namespaced packages, if none of them provides the jaraco/__init__.py file? If I understand PEP420 correctly, an empty file is not required but the discussion section mentions performance penalties with namespaced packages.

PEP 420 packages cannot contain an __init__.py module. If they do, they're now regular packages and won't behave as intended. In particular, if the packages in that namespace exist in more than one path on sys.path, only the first one will be recognized.

For example:

draft $ mkdir -p ns1/foo
 draft $ touch ns1/foo/bar.py
 draft $ mkdir -p ns2/foo
 draft $ touch ns2/foo/baz.py
 draft $ env PYTHONPATH=ns1:ns2 py -c "import foo.bar; import foo.baz"
 draft $ touch ns1/foo/__init__.py
 draft $ touch ns2/foo/__init__.py
 draft $ env PYTHONPATH=ns1:ns2 py -c "import foo.bar; import foo.baz"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'foo.baz'
 draft $ env PYTHONPATH=ns2:ns1 py -c "import foo.bar; import foo.baz"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'foo.bar'

So what that means is that all implementations of packages that use the jaraco namespace should not include an __init__.py.

@jaraco
Copy link
Owner

jaraco commented Aug 27, 2022

Thanks for the ping. I've published v3.1.1 (as originally tagged) and also publishing v3.1.2.

@jaraco jaraco closed this as completed Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants