typeshed
typeshed copied to clipboard
Use dev dependency-group
Would close https://github.com/python/typeshed/issues/13974, but as previously mentioned, there's some blockers from uv:
- https://github.com/astral-sh/uv/issues/9683#issuecomment-2705480073
- https://github.com/astral-sh/uv/issues/9258#issuecomment-2705491878
- (See the CI error)
AFAIK there's currently no way to have a dependency group with local files be both pip and uv compatible:
[dependency-groups]
dev = [
# ... snipped out all other requirements that don't matter for this example
# Utilities for typeshed infrastructure scripts.
"ts_utils @ file:lib", # Works with pip but not uv
]
[tool.uv.sources]
ts_utils = { path = "lib", editable = true } # Works with uv but obviously not pip
PS> uv pip install --group=dev
error: Failed to parse entry in group `dev`: `ts_utils @ file:lib`
Caused by: relative path without a working directory: lib
ts_utils @ file:lib
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
I don't like how this makes using uv mandatory. Currently you can still do pip install -r requirements-tests.txt if you don't want to use uv.
Edit: I guess pip install -e . will work, but this still feels like a downgrade to me: -r is super simple to understand or explain.
pip install --group=dev isn't a uv command. You need pip 25.1 though.
The reason this is draft is because at the moment it would only work with uv OR pip. Because uv doesn't support (yet?) relative file paths in dependencies. So there's no way to configure dependency groups to satisfy both tools.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉