-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Better default for uv sync #10934
Comments
We allow configuring the I'm not sure about the |
|
What is currently the default set of workspace packages that are installed when not specifying |
The dependencies of the main package — perhaps you want to add the other workspace members as dependencies? |
You might be interested in #10960 |
@zanieb I tried to set things up purely via adding the workspace members as dependencies to the main package, but one issue is that the workspace members' dev dependency groups are not installed. |
Yeah, if you have development requirements for the workspace we'd expect them to be there not in a child project. Can you share more about why you need that? |
Many workspace member projects, and some of the dev dependencies are specific to that project. It's not a requirement, it's more for organization. |
Using mise tasks, your users could just run The benefit being that, if uv or the monorepo layout/commands change in the future, you can just update the task script. All the devs can keep using |
I wanted to voice my support for We split up our development dependencies into nicely named groups. This not only is self documenting, but it allows tools like tox/nox to install only a subset of the dependencies easily into isolated virtual environments. [dependency-groups]
nox = [
"nox-poetry"
]
test = [
"pytest",
"pytest-cov",
"pytest-randomly"
]
type_check = [
"mypy"
]
lint = [
"ruff"
]
docs = [
"mkdocs-material",
"mkdocs-htmlproofer-plugin"
] After reading the docs, a user can learn that the [tool.uv]
default-groups = ["nox", "test", "type_check", "lint", "docs"] But this seems like extra boilerplate in my opinion and suffers from DRY risk of the names getting out of sync (and then dependencies silently not being installed). Given that The special cases of [tool.uv]
dev-dependencies = [
"pytest"
] But now-adays I think moving forward it would be ideal if |
Related: #11691 We also use groups for the precise reason of being able to specify which dependencies I want in tox/nox. But we just use includes in the dev group so that the default install gets all the installed deps: dev = [
{include-group = "tests"},
{include-group = "pre-commit"},
{include-group = "nox"},
"hatch>=1.14.0",
"ruff>=0.9.6",
]
# Used by nox
pre-commit = [
'pre-commit>=4.1.0',
'pre-commit-uv>=4.1.4',
]
# Used by nox
tests = [
'pytest>=8.3.4',
]
# Used by CI
nox = [
'nox>=2025.2.9',
] FWIW, I don't think Not sure what I think on special casing for the dev group. I like that it's a simpler CLI interface when adding deps from the command line. It also matches other dependency management tools. But having the |
I'd be more in favor of adding a special "all" key to |
I like this. That would be sufficient for the needs I've seen. It would be explicit and also remove the DRY issues that currently exist with duplicating group names. |
cc @Gankra curious for your thoughts |
Summary
I'm setting up a monorepo for my team. The main command that my team members have to run is:
That's quite a mouthful. Either:
uv.toml
? (seems that right now onlyuv pip
can be configured?)Example
No response
The text was updated successfully, but these errors were encountered: