typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Use dev dependency-group

Open Avasam opened this issue 6 months ago • 5 comments

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

Avasam avatar May 16 '25 20:05 Avasam

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar May 16 '25 20:05 github-actions[bot]

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.

Akuli avatar May 16 '25 22:05 Akuli

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.

Avasam avatar May 17 '25 02:05 Avasam

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Jul 25 '25 18:07 github-actions[bot]

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

github-actions[bot] avatar Sep 26 '25 16:09 github-actions[bot]