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

WARNING: project does not provide the extra #680

Closed
aaarrti opened this issue Mar 20, 2024 · 2 comments
Closed

WARNING: project does not provide the extra #680

aaarrti opened this issue Mar 20, 2024 · 2 comments

Comments

@aaarrti
Copy link

aaarrti commented Mar 20, 2024

Hi,
I have a project which has nested optional dependencies, for example

[project.optional-dependencies]
foo_bar = []
dev = ["sampleproject[foo_bar]"]

running pip install .[dev] prints

WARNING: sampleproject 3.0.0 does not provide the extra 'foo-bar'

even though I have never requested extra foo-bar. It seems to me like flit assumes extra dependencies are always in kebab-case. Is this behaviour expected?

@kytta
Copy link

kytta commented Apr 30, 2024

(fyi: I am not a flit maintainer, but I figured I can answer this)

flit assumes extra dependencies are always in kebab-case

In this case, it's actually the correct implementation of this specification — see "Name normalization".

But in any case, flit does not do anything here; When you do pip install .[dev], pip itself parses the extras when installing your package: https://github.com/pypa/pip/blob/9ef0fdfc848c7796d10eae436f8880018851555a/src/pip/_internal/req/constructors.py#L330

So, yes, this behaviour is expected, as all package and extras names in Python get normalized to kebab-case

@aaarrti aaarrti closed this as completed Apr 30, 2024
@takluyver
Copy link
Member

Thanks @kytta for answering this!

The normalisation to kebab-case isn't actually implemented yet - it's part of PR #676 - but I don't think that will change pip's behaviour on this. I'm not sure whether depending on an extra in your own project is exactly expected - possibly this doesn't work right when you're installing from a local folder rather than a package index.

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

No branches or pull requests

3 participants