-
Notifications
You must be signed in to change notification settings - Fork 739
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
dev-dependencies in workspace pyproject.toml not installed with uv run
#7487
Comments
To confirm my understanding: you want to define the |
Hi @charliermarsh, that is correct! Since I'm working in a workspace where things like pytest, coverage, ruff, etc. are all shared, it seemed like the logical thing to do. I added an example below to explain my use case a bit further: Directory structure:
In my root directory, I have this
Then in my package folder I have this
Then I'd like to be able to do for example:
And this gives me the error (on a cold run, so no
Additionally, it might be nice to be able to add common dependencies to the root workspace Edit: Added |
uv sync
uv run
I think I like the status quo, where you can do |
Is this the functionality under
I agree this is not by default the case. I believe the proposed solution should indeed be an opt-in if you add specific dev-dependencies to your root
I don't think I have enough experience with |
The issue is when you add a The |
Oh now I understand! In that case, my suggestion indeed works differently than the current behavior. So this might be quite a big change to add and I don't think I have a proper overview of the impact of such a change.. I'm only looking for a way to only define some dev-dependencies once, if they are shared across all packages / services / ... in the workspace. Like |
So one thing it looks like I got wrong is that
That's saying the dependency should be in the workspace. I had gotten this wrong and thought it meant that it "inherits" what dependency specification is in the workspace root. So I think the situation is a little worse than I was painting: you do have to repeat not just the dependency but the version constraint. I don't have a strong opinion about whether there's an option to make dev-dependencies apply everywhere, but I do kind of think it should be opt-in. Or maybe even opt-in on a dependency-by-dependency basis in the workspace root. |
I really like the idea of having the opt-in on a dependency-by-dependency basis in the workspace root! However, looking at the docs I don't see a ready-to-use solution that aligns neatly with PEP 508 and allows you to set a flag or something for each dev-dependency? So perhaps a global opt-in under |
We have a mono repository with a couple of packages and services. I wanted to unify the dev-dependencies for all packages (each of them have their own pyproject.toml file) since they are largely the same dependencies.
I noticed when moving the
dev-dependencies
from the package pyproject.toml files to the workspace one in the root folder, that these dependencies are no longer installed when I runuv run
in a package folder (e.g., to run a test script with pytest).Is this behaviour expected? I assumed dependency resolution would take into account all
dev-dependencies
in all pyproject.toml files inside the workspace.The text was updated successfully, but these errors were encountered: