Skip to content

Read imports and exports for Python #40

Open

Description

@typeweaver

Context

Hidden coupling (#17) and module depth (#18) read imports and exports through one adapter per language; only TypeScript/JavaScript has one.

Goal

Python repositories get Coupling.imports and Module.depth like TypeScript repositories do.

Acceptance criteria

  • A Python adapter (a lightweight scanner, no new native dependency) resolves import x.y, from x import y, and relative imports (from . import y) to universe files, honoring src/ layouts and package roots from pyproject.toml; third-party imports are ignored.
  • It lists a module's public names for depth: __all__ when present, otherwise top-level names without a leading underscore.
  • A fixture repository with an imported pair, a hidden pair, a relative import, and an src/ layout proves both.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: lowLast in line; picked up after everything else

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions