-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add "namespace package" to glossary #1882
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
base: main
Are you sure you want to change the base?
Conversation
Namespace Package | ||
|
||
A mechanism for splitting a single :term:`Import Package <Import Package>` | ||
across multiple directories on disk. Can either be "explicit" or "implicit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
across multiple directories on disk. Can either be "explicit" or "implicit", | |
across multiple directories on disk. Can either be "explicit" or "implicit", |
I guess this does not cover the (nowadays most common?) case where the package is all in one place on disk (i.e. in site-packages
) but was installed from different distribution packages (i.e. from different packages/libraries on PyPI for example).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the PR description to include (because I forgot to mention) most of this is just lifted straight from the opening line of PEP 420:
Namespace packages are a mechanism for splitting a single Python package across multiple directories on disk.
That being said, what do you think about this change:
across multiple directories on disk. Can either be "explicit" or "implicit", | |
across one or more directories on disk. Can either be "explicit" or "implicit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I just found this so "disk" is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aye, it's import locations rather than specifically directories on disk. The language reference definition covers implicit namespace packages, while the pkgutil.extend_path
docs cover explicit namespace packages.
Having a glossary entry here that links to both of those reference definitions (as well as summarising them) is a good suggestion.
I'm a masochist, so here I go mucking around in the world of namespace packages. Really, I just wanted to link to a definition in an upcoming blog post, and realized there wasn't one.
The wording itself is mostly lifted directly from the first line of PEP 420. For the embellishments, I'm not the best wordsmith so happy to take suggestions.
(I was thinking we could include definitions for "explicit" or "implicit", but incremental improvement is still improvement)
📚 Documentation preview 📚: https://python-packaging-user-guide--1882.org.readthedocs.build/en/1882/