Skip to content

pyproject.toml: non-idiomatic src.<pkg> import path for downstream consumers #86

Description

@gaurav

Background

pyproject.toml currently sets:

[tool.hatch.build.targets.wheel]
packages = ["src"]

This exposes the package as src.babel_validation rather than the idiomatic babel_validation. Downstream consumers must write from src.babel_validation.X import Y, which is unusual and may surprise users expecting standard package layout.

Standard layout alternative

[tool.hatch.build.targets.wheel]
packages = ["src/babel_validation"]

This would expose babel_validation directly. All internal imports (from src.babel_validation...) would also need to change to (from babel_validation...).

Notes

  • The current choice appears intentional (there is a comment in pyproject.toml). This issue is just documenting the trade-off flagged during the Opus code review of PR Add GitHub-issue-driven test framework (+ src/ library carve-out) #67.
  • Any change here requires updating all from src.babel_validation... imports throughout the test suite and library.
  • Not blocking; assess whether downstream consumer ergonomics matter before changing.

Metadata

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