-
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
Transitive dev dependencies of workspace packages are not installed #7541
Comments
Sorry this broke your setup!
I think this is the recommendation, if you want to use them from the workspace root. Otherwise, you can use @charliermarsh may have more thoughts. |
Could we have a flag colocated with |
Thank you - this worked for us, and it's now what I did to resolve the issue for now. However, now after running tests, and then doing an The reason we prefer to have the
I like that suggestion a lot, e.g. something like:
what do you think? |
For right now my approach is to put all the dev packages into an optional package and then include that in the dev dependencies of itself and the root package. |
I think this also gets at competing notions of (1) workspace members as strict dependencies of the root, (2) workspace members as composable "mix-ins", and (3) a pseudo-rootless monorepo with first-class, root-like workspace members. In (1), workspace members should be proper dependencies (dev or otherwise) of the root, and the root shouldn't have to "know" anything about workspace member deps, aside from the fact that all members must "live" in a shared environment. Making this assumption also probably simplifies In (2), a workspace member may function as a mix-in, in which case its dev dependencies augment the root's dev dependencies. You could imagine the isolation of different (yet not incompatible) packages isolated as workspace members which are pluggable and augment the root. Then in (3) OP's monorepo layout, an ephemeral "root" but the workspace members that want to share their tooling, almost as if it were a "rootless" shared environment with all workspace members being kind of like their own first-class root. I think we can agree that in any case, the proper And in (2) and (3) you have the question of "what about I wonder if the I like the globbing in |
it would be nice to have a flag that installs everything (all devDependencies in all projects and root workspace). this is how things work by default in javascript land (npm/yarn/pnpm/bun/etc) |
I just ran into an issue in our CI pipeline (after upgrading to
uv 0.4.10
), which I believe was caused by this change:#7318
I agree that theoretically it makes sense to not install dev dependencies transitively, however that may be different for workspace sources in a monorepo.
This is the outline for the issue that came up:
We have a monorepo, using
uv workspaces
.In there, we have multiple packages, all part of the same
workspace
. The root package has a dependency on all of those, so that their dependencies are all installed into thevenv
transitively.Now all of the packages in the monorepo have different
dev
dependencies, one of those for example moto.Before this change, I was able to run tests by doing
uv run pytest <package>
, because the rootvenv
also had all dev-dependencies installed. Now this is no longer the case, instead I get aModuleNotFoundError: No module named 'moto'
.Should we now specify all
dev
dependencies of the sub-packages also asdev
dependency of the root package?Or maybe it would make sense to still install
dev
dependencies transitively for all packages whereworkspace = true
is set intool.uv.sources
?The text was updated successfully, but these errors were encountered: