uv lock to use overrides from tool.uv (#4108)#4369
uv lock to use overrides from tool.uv (#4108)#4369charliermarsh merged 1 commit intoastral-sh:mainfrom
Conversation
6fe8f49 to
1505dce
Compare
1505dce to
56019e3
Compare
BurntSushi
left a comment
There was a problem hiding this comment.
I think this LGTM, but I think @konstin should sign off on this before merging.
| } | ||
| } | ||
| }); | ||
| let overrides = overrides; |
There was a problem hiding this comment.
I think this can be removed?
There was a problem hiding this comment.
I think this can be removed?
Wanted to make it explicit that it's now immutable
There was a problem hiding this comment.
We don't usually do this in our code. It would add a lot of noise.
There was a problem hiding this comment.
fyi i removed it and also changed the iteration style to align more with what we do elsewhere
|
Currently, this can have effects on neighbouring packages: Say you have a non-project workspace root and in it two package foo, bar and baz. foo has: tool.uv.override-dependencies = [
"anyio==4.3.0"
]bar has: dependencies = [
"anyio==4.4.0"
]baz has: tool.uv.override-dependencies = [
"lib_that_uses_anyio=1.2.3"
]This means foo changes the resolution of both bar and baz, once directly and once indirectly. Since overrides apply globally, i think we should only allow them in the workspace root. |
I assume you mean As convinient as a shared virtualenv is, I kinda wish there was a way to require a private one per member. On an unrelated note, if someone could also take a look at astral-sh/rye#1015 I'd appreciate it. I'm a bit stuck with one of my projects. |
|
I've tried a different implementation, I think it's more in line with existing code. |
26a6dda to
7e02a1d
Compare
Simplify iteration
7e02a1d to
8690c0b
Compare
|
Updated, it now gets overrides from the workspace only. |
|
I think this looks correct. |
Resolves #4467. ## Summary This PR implements the following 1. Add `tool.uv.constraint-dependencies` to pyproject.toml 1. Support to refer `tool.uv.constraint-dependencies` in `uv lock` 1. Support to refer `tool.uv.constraint-dependencies` in `uv pip compile/install` These are analogues of the override features implemented in #3839 and #4369. ## Test Plan Add test.
Summary
This will make
uv lockreadoverride-dependenciesfrom the[tool.uv]section ofpyproject.toml.Resolves #4108
This other implementation touches more code but seems more consistent.
Test Plan
Unit test