-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
I'm trying a setup, when the workspace has a requires-python value while a non-workspace has a different (more loose) constraints, but requires a package from the workspace. It seems like when I installing that latter, non-workspace package, the workspace requires-python is not being observed.
I've set up a project pretty much exactly as it's described in the workspace documentation:
albatrosis rootbird-feederis a workspace package`,seedsis an excluded package, but it depends onbird-feeder
This latter is set up like this
# ... snip
dependencies = ["bird-feeder"]
[tool.uv.sources]
bird-feeder = { workspace = true }Then:
albartrossetsrequires-python = '>=3.13'; this applies tobird-feederas wellseedssetsrequires-python = '>=3.10'and is not part of the workspace
Here's the test setup as a repo: https://github.com/imrehg/uv-workspace-debug
Expected behaviour
seeds wouldn't install with Python 3.10/11/12, only with 3.13, due to the bird-feeder requirement, that should force the workspace's 3.13 Python requirements
Observed behaviour
seeds happily installs with 3.10, including
❯ cd packages/seeds
❯ uv sync --python 3.10
Resolved 2 packages in 565ms
Built bird-feeder @ file:///Users/gergely/prog/uvworkspace/albatros/packages/bird-feeder
Built seeds @ file:///Users/gergely/prog/uvworkspace/albatros/packages/seeds
Prepared 2 packages in 578ms
Uninstalled 2 packages in 3ms
Installed 2 packages in 3ms
~ bird-feeder==0.1.1.dev2+g59d56f9.d20241212 (from file:///Users/gergely/prog/uvworkspace/albatros/packages/bird-feeder)
~ seeds==0.1.0 (from file:///Users/gergely/prog/uvworkspace/albatros/packages/seeds)While going into bird-feeder folder to install just that:
❯ cd ../bird-feeder
❯ uv sync --python 3.10
Using CPython 3.10.15
error: The requested interpreter resolved to Python 3.10.15, which is incompatible with the project's Python requirement: `>=3.13`