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

Make sure namespace packages obtained via import finder handle later additions to path #10

Merged
merged 6 commits into from Jun 15, 2022

Conversation

abravalheri
Copy link
Owner

According to the PEP 420, namespace packages need to gracefully handle later additions to path.

See https://discuss.python.org/t/pep-660-and-setuptools/14855/15

Summary of changes

  • 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 directly1.

Closes

Pull Request Checklist

Footnotes

  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.

@abravalheri abravalheri marked this pull request as ready for review April 17, 2022 11:22
@abravalheri abravalheri changed the base branch from editable-link-tree to editable-link-tree2 April 22, 2022 16:02
Base automatically changed from editable-link-tree2 to build-editable-aggregate June 15, 2022 15:27
@abravalheri abravalheri merged commit 6f84fa8 into build-editable-aggregate Jun 15, 2022
@abravalheri abravalheri deleted the editable-fix-namespaces branch February 16, 2023 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant