mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-15 21:09:46 +00:00
![]() Consider the following packse scenario: ```toml [root] requires = [ "a>=1.0.0 ; python_version < '3.10'", "a>=1.1.0 ; python_version >= '3.10'", "a>=1.2.0 ; python_version >= '3.11'", ] [packages.a.versions."1.0.0"] [packages.a.versions."1.1.0"] [packages.a.versions."1.2.0"] ``` On current `main`, this produces a dependency on `a` that looks like this: ```toml dependencies = [ { name = "fork-overlapping-markers-basic-a", marker = "python_version < '3.10' or python_version >= '3.11'" }, ] ``` But the marker expression is clearly wrong here, since it implies that `a` isn't installed at all for Python 3.10. With this PR, the above dependency becomes: ```toml dependencies = [ { name = "fork-overlapping-markers-basic-a" }, ] ``` That is, it's unconditional. Which is I believe correct here since there aren't any other constraints on which version to select. The specific bug here is that when we found overlapping dependency specifications for the same package *within* a pre-existing fork, we intersected all of their marker expressions instead of unioning them. That in turn resulted in incorrect marker expressions. While this doesn't fix any known bug on the issue tracker (like #4640), it does appear to fix a couple of our snapshot tests. And fixes a basic test case I came up with while working on #4732. For the packse scenario test: https://github.com/astral-sh/packse/pull/206 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |