pip
pip copied to clipboard
Document support for self-referential extras
What's the problem this feature will solve?
This (coupled with maybe a new explicit test) will provide a guarantee to users that the following use case is supported:
[project]
name = "pkg"
[project.optional-dependencies]
all = ["pkg[a]", "pkg[b]"]
a = ["..."]
b = ["..."]
Describe the solution you'd like
Add a note in docs + a new test that explicitly checks this
Alternative Solutions
N/A
Additional context
@ichard26 found that this has been supported since 21.2 (tested by @henryiii) https://github.com/pypa/pip/issues/10393#issuecomment-941885429
Code of Conduct
- [X] I agree to follow the PSF Code of Conduct.
I marked this as awaiting PR
. I'd say a having adding a test is important if we document it.
Upd. I'm not sure what has changed, but I can't reproduce this behaviour anymore.
~~From https://github.com/pypa/hatch/pull/724#issuecomment-1420714830:~~
This doesn't work for me when my project name overlaps with other project available on PyPI (though I'm installing it in editable mode):
[project] name = "chatbot" [project.optional-dependencies] profiling = ["pyinstrument"] debugging = ["ipython"] style = ["ruff", "black"] testing = ["pytest", "pytest-cov"] typechecking = ["mypy"] all = ["chatbot[style,profiling,debugging,testing,typechecking]"]
Upon
hatch run mypy
, I get:WARNING: chatbot 1.5.2b0 does not provide the extra 'debugging' WARNING: chatbot 1.5.2b0 does not provide the extra 'profiling' WARNING: chatbot 1.5.2b0 does not provide the extra 'style' WARNING: chatbot 1.5.2b0 does not provide the extra 'testing' WARNING: chatbot 1.5.2b0 does not provide the extra 'typechecking' /bin/sh: mypy: command not found
I don't think that's related to pip. You either didn't reinstall the package after changing the metadata (i.e. dependencies) or there's possibility some interaction with how hatch does things. If you are able to reproduce the failure from scratch in a new virtualenv, please file a new issue with the details.