Skip to content

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

Closed
@Julfried

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions