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

Hatch emits PEP 685-compliant normalized extras but pip does not normalize yet on install #274

Closed
Julian opened this issue Jun 7, 2022 · 0 comments · Fixed by #495
Closed

Comments

@Julian
Copy link

Julian commented Jun 7, 2022

Given an extra named foo_bar and specified / named as such (in a project.optional-dependencies section of a pyproject.toml), hatch, in accordance with PEP 685, emits an extra named foo-bar:

For tools writing core metadata, they MUST write out extra names in their normalized form.

Though pip will not yet normalize on install (see e.g. pypa/pip#10757, which after the linked discussion there is I believe waiting for pypa/packaging#525 and/or pypa/packaging#526).

This means a package with a foo_bar extra, building via hatch, will start producing a foo-bar extra and break downstream user installs doing pip install mypackage[foo_bar] until the aforementioned spec is implemented in pip.

Though Hatch is clearly consistent with the new spec, it seems that given the guidance from the Transition Plan section of 685:

As such, consumers of this PEP should be prioritized more than producers so that users can be notified that they are specifying extra names which are not normalized (and thus may break in the future).

that Hatch should instead emit unnormalized names until consumers downstream catch up, and core metadata version 2.3 is widespread.

(A real-life case of the above is python-jsonschema/jsonschema#962)

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

Successfully merging a pull request may close this issue.

1 participant