Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure namespaces from ImportFinder handle additions to path
According to the PEP 420, namespace packages need to gracefully handle later additions to path. - Use a `PathEntryFinder` + an arbitrary placeholder entry on `sys.path` to force `PathFinder` to create a namespace spec. - Since `_NamespacePath` and `_NamespaceLoader` are private classes (or just documented for comparison purposes), there is no other way to implement this behaviour directly [^1]. [^1]: Reimplementing _NamespacePath + a custom logic to maintain namespace portions don't have a corresponding path entry also seems to have the same end result.
- Loading branch information
Showing
3 changed files
with
154 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters