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

Pyreverse: Incorrect handling of implicit Namespaces (PEP 420) #10173

Open
Julfried opened this issue Jan 9, 2025 · 0 comments
Open

Pyreverse: Incorrect handling of implicit Namespaces (PEP 420) #10173

Julfried opened this issue Jan 9, 2025 · 0 comments

Comments

@Julfried
Copy link
Contributor

Julfried commented Jan 9, 2025

Current Problem:

The discover_package_path function fails to handle PEP 420 implicit namespaces, as it relies on finding init.py files to determine valid package paths. This causes issues when working with implicit namespaces, where such files are not required.

Desired Solution:

Separate the logic for explicit and implicit namespaces:

  1. Explicit namespaces: Identify using __init__.py.
  2. Implicit namespaces: Identify according to PEP 420.
  3. Error handling: Raise an exception if neither condition is met.

Additional Context:

This issue comes from discussions in #10026 and relates to challenges observed in #10077, where missing or empty init.py files impacted pyreverse's to correctly identify detect package relationships.

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

1 participant