-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Pip doesn’t allow you to self-depend #10393
Comments
Hmm, this actually works for me.
Can you confirm your setup?
|
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
Trying this on cibuildwheel breaks CI as promised, see pypa/cibuildwheel#870. Not all jobs broke, and the ones that did might have a slightly older pip. The "classic" AppVeyor job simply ignored the extras and didn't install them - I expect pip is old there. All Travis jobs failed with a similar issue; the pip there is 20.2.3, 20.2.2, 20.2.1, and 18.1 - all failed in the same way. CircleCI with pip 21.1.1 failed with the might-as-well-be-infinite pre-package search (interestingly, though, all the extras are now available in at least one previous package). The log is too large to load in full, so I can't really tell too much about what happened there, other than the pip version and the pattern it was repeating:
|
This is very strange. I implemented the following test: import nox
@nox.session
@nox.parametrize('pip', ['20.2.3', '21.1.1', '21.3.0'])
def tests(session: nox.Session, pip: str) -> None:
session.install(f"pip=={pip}")
session.run("pip", "--version")
tmp = session.create_tmp()
session.cd(tmp)
with open("pyproject.toml", "w") as f:
f.write("""\
[build-system]
requires = ['flit-core']
build-backend = "flit_core.buildapi"
[project]
name = 'cibuildwheel'
version = "1"
description = "..."
[project.optional-dependencies]
test-utils = ['pytest', 'requests-mock']
test-combined = ['cibuildwheel[test-utils]']
""")
with open("cibuildwheel.py", "w") as f:
f.write("__version__ = '1.0.0'")
session.install(".[test-combined]") And this is the result:
21.3 worked, and
Notice that I am intentionally picking the name of a known package and using an extra that that package does not have. Edit: never mind about the surprisingly, I'm not checking to see if the extras were actually installed, so it probably is failing as expected. |
Okay, results:
import nox
@nox.session
@nox.parametrize('pip', ['20.2.*', '20.3.*', '21.0.*', '21.1.*', '21.2.*', '21.3.*'])
def tests(session: nox.Session, pip: str) -> None:
session.install(f"pip=={pip}")
session.run("pip", "--version")
tmp = session.create_tmp()
session.cd(tmp)
with open("pyproject.toml", "w") as f:
f.write("""\
[build-system]
requires = ['flit-core']
build-backend = "flit_core.buildapi"
[project]
name = 'cibuildwheel'
version = "1"
description = "..."
[project.optional-dependencies]
test-utils = ['pytest', 'requests-mock']
test-combined = ['cibuildwheel[test-utils]']
""")
with open("cibuildwheel.py", "w") as f:
f.write("__version__ = '1.0.0'")
session.install(".[test-combined]")
session.run("python", "-c", "import pytest")
|
20.3 was when the default resolver switch, so that behavioural change makes sense. I can't quite point out what exactly changed in 21.2 that makes this work (that release contains quite several resolver tweaks), but glad to hear its working now. I think this would be a very big step toward more declarative metadata definition since we no longer need to either write custom tooling to preprocess metadata, or manually constructing extras in |
Description
When specifying dependencies, you sometimes want to depend on other extras:
Expected behavior
@uranusjr said it should work:
pip version
21.2.4
Python version
3.9.6
OS
Arch Linux
How to Reproduce
pip install .[test]
.
withmy_pkg
Specifying
test = ['.[test-utils]']
doesn’t work.Output
@henryiii said:
Code of Conduct
The text was updated successfully, but these errors were encountered: