astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.22k stars 601 forks source link

Support certain extras of the current project as dev dependencies #7033

Open lengau opened 1 week ago

lengau commented 1 week ago

It would be nice to be able to support adding specific extras as dev dependencies.. For example, a project that is migrating to uv may have optional dependency groups that they'd like to keep separate but add as dev dependencies like so:


[project.optional-dependencies]
test = [
    "pytest~=8.0",
    "pytest-cov~=5.0",
    "pytest-time~=0.3",
]
lint = [
    "ruff>=0.6.0",
]
types = [
    "pyright==1.1.377",
]

[tool.uv]
dev-dependencies = [
    ".[test,lint,types]"
]
charliermarsh commented 1 week ago

I think this makes sense but we might want to wait until https://peps.python.org/pep-0735/ is resolved?