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

Inconsistency in _ -> - normalization (extras) #10757

Closed
1 task done
Conchylicultor opened this issue Jan 3, 2022 · 2 comments
Closed
1 task done

Inconsistency in _ -> - normalization (extras) #10757

Conchylicultor opened this issue Jan 3, 2022 · 2 comments
Labels
type: bug A confirmed bug or unintended behavior

Comments

@Conchylicultor
Copy link

Conchylicultor commented Jan 3, 2022

Description

I'm using a PEP 621 toml using flit 3.5 & pip 21.3.1:

My toml has self-refering optional-dependencies:

[build-system]
requires = ["flit_core >=3.5,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "etils"

[project.optional-dependencies]
array_types = ["numpy"]
all = ["etils[array_types]"]

When running pip install -e .[all], this logs:

WARNING: etils 0.2.0 does not provide the extra 'array-types'

It looks like "etils[array_types]" gets normalized to [array-types], but not array_types = ["numpy"].

Manually replacing array_types = ["numpy"] -> array-types = ["numpy"] solve the issue.

But this behavior feels inconsistent.

I first posted in pypa/flit#503 but from the Flit authors, it seems this is a pip issue. It seems Flit generate the following metadata:

Requires-Dist: installer[array_types] ; extra == "all"
Requires-Dist: numpy ; extra == "array_types"
Provides-Extra: all
Provides-Extra: array_types

Expected behavior

No response

pip version

pip 21.3.1

Python version

3.8

OS

Linux

How to Reproduce

  • Create a project, with roughly the same pyproject.toml as above.
  • pip install .[all]
  • See the warning about extra names.

Output

No response

Code of Conduct

@Conchylicultor Conchylicultor added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 3, 2022
@pradyunsg pradyunsg changed the title Inconsistency in _ -> - normalization Inconsistency in _ -> - normalization (extras) Jan 3, 2022
@uranusjr
Copy link
Member

uranusjr commented Jan 6, 2022

Moving discussion to https://discuss.python.org/t/7614 sine this is ultimately a bug in the specification and pip can only follow what the rules allow it to. pip would receive a fix automatically once this gets resolved at the PEP level and implemented in packaging.

@uranusjr uranusjr closed this as completed Jan 6, 2022
@Conchylicultor
Copy link
Author

Independently of which specification get choosen, Shouldn't pip be at least internally consistent ?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2022
@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants