You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to make a monorepo with uv and I'd love to do some base uv configuration in the root level pyproject.toml. Things that are most likely to be the same for all packages, e.g. package indices. But I'm not using workspaces because the packages will have conflicting dependencies. This is also listed as a reason in the docs, see https://docs.astral.sh/uv/concepts/projects/workspaces/#when-not-to-use-workspaces But some packages will have some custom uv config in [tool.uv] in pyproject.toml but I noticed that this will cause the package to ignore everything set in [tool.uv] by the root pyproject.toml. I suppose this is intentional, but I could imagine my use case being relevant as well.
After all, I saw that ruff offers some explicit opt-in to inherit from some other config, see https://docs.astral.sh/ruff/settings/#extend which is really good for my use case! (I wish pyright and pytest would make it as easy... edit: pyright actually has an extends option, see here. pytest does not prioritize that as of now, see here)
I think we're somewhat unlikely to do this, but I understand the problem you're facing. I don't think we'd do the same thing in Ruff if we were to re-implement it today. The inheritance causes a lot of complexity and confusion for users. We do support inheritance of user- and system-level settings (e.g., ~/.config/uv/uv.toml as in https://docs.astral.sh/uv/configuration/files/ -- that gets combined with your pyproject.toml), so that's one option, but it doesn't help with sharing across a team.
Summary
Hi all, thanks for making uv!
I'm trying to make a monorepo with uv and I'd love to do some base uv configuration in the root level
pyproject.toml
. Things that are most likely to be the same for all packages, e.g. package indices. But I'm not using workspaces because the packages will have conflicting dependencies. This is also listed as a reason in the docs, see https://docs.astral.sh/uv/concepts/projects/workspaces/#when-not-to-use-workspaces But some packages will have some custom uv config in[tool.uv]
inpyproject.toml
but I noticed that this will cause the package to ignore everything set in[tool.uv]
by the rootpyproject.toml
. I suppose this is intentional, but I could imagine my use case being relevant as well.After all, I saw that ruff offers some explicit opt-in to inherit from some other config, see https://docs.astral.sh/ruff/settings/#extend which is really good for my use case! (I wish pyright and pytest would make it as easy... edit: pyright actually has an
extends
option, see here. pytest does not prioritize that as of now, see here)Relatedly, there already seems to be some config merging logic https://docs.astral.sh/uv/configuration/files/ but it's only for
uv.toml
user/system-level files.Example
Not exactly sure about the exact design of it but having this
and
it would be cool to have some way to let the
./sub/pyproject.toml
inherit therequired-version
from./pyproject.toml
.Maybe like ruff does it
The text was updated successfully, but these errors were encountered: