uv/crates/uv-pypi-types/src
konsti 91653f5fee
Avoid invalid simplification with conflict markers (#15041)
Previously, `simplify_conflict_markers` assumed that it can remove all
conflict set together, when we need to look at each conflict set
individually. Specifically, `(platform_machine == 'x86_64' and extra ==
'extra-5-foo-b') or extra == 'extra-5-foo-a'` can't be reduced
`platform_machine == 'x86_64'` only because it reduces to true when both
conflict extras are activated.

This case applied in https://github.com/astral-sh/uv/issues/14805, where
a jax 0.5.3 version was used for `platform_machine != 'aarch64' or
sys_platform != 'linux'` and the conflict extra `cu128`, but jax 0.7.0
for the conflict extra `cpu`.

Only removing the faulty inference regresses lockfiles to much more
verbose markers. To balance the much more conservative inference, I
added `unify_inference_sets` to simplify cases where all conflict
branches reduce to the same marker.

This still regresses some markers. For example `sys_platform == 'win32'`
regresses to `sys_platform == 'win32' or (extra == 'extra-3-pkg-x1' and
extra == 'extra-3-pkg-x2')` in `extra_inferences`, even through x1 and
x2 conflict and the second conjunction could be simplified away.

Fixes https://github.com/astral-sh/uv/issues/14805
2025-08-06 09:26:26 +00:00
..
metadata Make the use of `Self` consistent. (#15074) 2025-08-05 20:17:12 +01:00
base_url.rs Simplify relative URL handling (#14449) 2025-07-09 23:20:02 +00:00
conflicts.rs Avoid invalid simplification with conflict markers (#15041) 2025-08-06 09:26:26 +00:00
dependency_groups.rs Move `DependencyGroups` to uv-pypi-types so it can be imported there (#12037) 2025-03-07 12:30:47 +01:00
direct_url.rs Add `subdirectory` to Direct URL for local directories (#12971) 2025-04-18 11:57:58 -04:00
identifier.rs Make the use of `Self` consistent. (#15074) 2025-08-05 20:17:12 +01:00
lenient_requirement.rs Bump MSRV to 1.85 and Edition 2024 (#13516) 2025-05-18 19:38:43 -04:00
lib.rs Move lowered requirement source type out of `uv-pypi-types` (#12356) 2025-03-20 21:16:12 -04:00
marker_environment.rs add support for specifying conflicting extras (#8976) 2024-11-13 09:52:28 -05:00
parsed_url.rs Implement `CacheKey` for all `Pep508Url` variants (#14978) 2025-07-30 10:44:06 -05:00
scheme.rs Add `uv-` prefix to all internal crates (#7853) 2024-10-01 20:15:32 -04:00
simple_json.rs Make the use of `Self` consistent. (#15074) 2025-08-05 20:17:12 +01:00
supported_environments.rs Make the use of `Self` consistent. (#15074) 2025-08-05 20:17:12 +01:00