Support for namespace packages (PEP 420)
See original GitHub issuePEP 420 introduced implicit namespace packages, which are packages without __init__.py
. Those packages, and the modules under them, don’t seem to appear in the dependency graph generated by pydeps.
Here’s an example. Given the following directory structure:
.
├── main.py
├── pkg1
│ └── foo.py
└── pkg2
├── bar.py
└── __init__.py
And main.py
:
import pkg1.foo
import pkg2.bar
pydeps main.py
generates the following graph:
I would have expected pkg1.foo
to be included in the dependency graph. (On the other hand, I’m not sure there’s a point in having pkg1
there since it’s going to be empty.)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
PEP 420 – Implicit Namespace Packages
Namespace packages are designed to support being split across multiple directories (and hence found via multiple sys.path entries). In this ...
Read more >Support PEP 420 -- Implicit Namespace Packages #13293
Support PEP 420 -- Implicit Namespace Packages #13293 ... Python resolves namespace packages by searching every sys.path entry for the name ...
Read more >PEP 420 - implicit namespace packages - O'Reilly
If you use and target only Python 3, then there is good news for you. PEP 420 (Implicit Namespace Packages) introduced a new...
Read more >pep 420 namespace_packages purpose in setup.py
What is the purpose of the namespace_packages argument in setup.py when working with PEP420 namespace packages (the ones without __init__.py)?.
Read more >Support for implicit namespace packages PEP 420 : PY-7156
Support for implicit namespace packages PEP 420 ; Priority, Normal N ; Type, Feature ; State, Fixed F ; Assignee, Andrey Vlasovskikh ;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That is a huge bug and
--include-missing
seems to avoid it but not without nasty side effects. Sadly I will not be able to adopt pydeps as part of the docs until is fixed.@ssbarnea I’m wondering if you’re using this feature to create namespace package, or if it’s simply to avoid having an
__init__.py
file? I’ve never found a reason to use namespace packages that outweigh the mess it causes. Regardless,pydeps
is dependent onmodulefinder
(a python standard module - vendorized with some bug-fixes) supporting the feature first. I’ll happily merge a PR if you or anyone else wants to work on it though…