uv icon indicating copy to clipboard operation
uv copied to clipboard

Join requirement and override markers

Open konstin opened this issue 1 month ago • 2 comments

This is an attempt to solve https://github.com/astral-sh/uv/issues/4826 by joining markers of requirements and overrides.

Say in a we have a requirements

b==1; python_version < "3.10"
c==1; extra == "feature"

and overrides

b==2; python_version < "3.10"
b==3; python_version >= "3.10"
c==2; python_version < "3.10"
c==3; python_version >= "3.10"

Our current strategy is to discard the markers in the original requirements. This means that on 3.12 for a we install b==3, but it also means that we add c to a without a[feature], causing #4826.

This PR changes this always join markers, which has the similarly counterintuitive effect that b will never be installed for a for 3.12. Maybe the correct solution is to only copy an extra marker, since we special case that one anyway?

konstin avatar Jul 05 '24 09:07 konstin