-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
C: dependency resolutionAbout choosing which dependencies to installAbout choosing which dependencies to installstate: needs reproducerNeed to reproduce issueNeed to reproduce issue
Description
Description
When specifying dependencies, you sometimes want to depend on other extras:
[project]
name = 'my_pkg'
[project.optional-dependencies]
test-utils = ['pytest', 'requests-mock', '...']
test = ['my_pkg[test-utils]']
Expected behavior
@uranusjr said it should work:
Circular dependency is a feature that Python packaging is explicitly designed to allow, so it works and should continue to work. […]
pip version
21.2.4
Python version
3.9.6
OS
Arch Linux
How to Reproduce
- Create a new package with something like the above setup
- Install it with the extra depending on itself:
pip install .[test]
- It can’t find the package because it doesn’t merge
.
withmy_pkg
Specifying test = ['.[test-utils]']
doesn’t work.
Output
It does not pull the extra from the current package, but rather from the existing cached packages. So if you add a new extra […] and then depend on it, it starts spewing out a long list of package checking:
Collecting my_pkg[test-utils]
Using cached my_pkg-1.11.1-py3-none-any.whl (1.5 MB)
WARNING: my_pkg 1.11.1 does not provide the extra 'test-utils'
Using cached my_pkg-1.11.0-py3-none-any.whl (1.5 MB)
WARNING: my_pkg 1.11.0 does not provide the extra 'test-utils'
Using cached my_pkg-1.10.0-py3-none-any.whl (1.5 MB)
WARNING: my_pkg 1.10.0 does not provide the extra 'test-utils'
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Metadata
Metadata
Assignees
Labels
C: dependency resolutionAbout choosing which dependencies to installAbout choosing which dependencies to installstate: needs reproducerNeed to reproduce issueNeed to reproduce issue