uv/crates/uv-resolver/src
Charlie Marsh 8620b5a52f
Make direct dependency detection respect markers (#2207)
## Summary

When determining "direct" dependencies, we need to ensure that we
respect markers. In the linked issue, the user had an optional
dependency like:

```toml
[project.optional-dependencies]
dev = [
  "setuptools>=64",
  "setuptools_scm>=8"
]
```

By not respecting markers, we tried to resolve `setuptools` to the
lowest-available version. However, since `setuptools>=64` _isn't_
enabled (since it's optional), we won't respect _that_ constraint.

To be consistent, we need to omit optional dependencies just as we will
at resolution time.

Closes https://github.com/astral-sh/uv/issues/2203.

## Test Plan

`cargo test`
2024-03-05 17:25:06 +00:00
..
pubgrub Clippy pedantic (#1963) 2024-02-25 14:04:05 -05:00
resolver Make direct dependency detection respect markers (#2207) 2024-03-05 17:25:06 +00:00
candidate_selector.rs Make direct dependency detection respect markers (#2207) 2024-03-05 17:25:06 +00:00
constraints.rs Move conflicting dependencies into PubGrub (#1796) 2024-02-21 21:27:58 -05:00
dependency_mode.rs Rename to uv (#1302) 2024-02-15 11:19:46 -06:00
editables.rs Move conflicting dependencies into PubGrub (#1796) 2024-02-21 21:27:58 -05:00
error.rs Clippy pedantic (#1963) 2024-02-25 14:04:05 -05:00
finder.rs Track wheel compatibility as a single field (#2054) 2024-02-28 16:59:22 -05:00
lib.rs Preserve environment variables in resolved Git dependencies (#2125) 2024-03-01 20:38:34 -05:00
manifest.rs Rename to uv (#1302) 2024-02-15 11:19:46 -06:00
options.rs Rename to uv (#1302) 2024-02-15 11:19:46 -06:00
overrides.rs Move conflicting dependencies into PubGrub (#1796) 2024-02-21 21:27:58 -05:00
pins.rs Rename to uv (#1302) 2024-02-15 11:19:46 -06:00
prerelease_mode.rs Make direct dependency detection respect markers (#2207) 2024-03-05 17:25:06 +00:00
python_requirement.rs Error when editables don't match Requires-Python (#2194) 2024-03-04 23:20:42 -05:00
redirect.rs Preserve environment variables in resolved Git dependencies (#2125) 2024-03-01 20:38:34 -05:00
resolution.rs Preserve environment variables in resolved Git dependencies (#2125) 2024-03-01 20:38:34 -05:00
resolution_mode.rs Make direct dependency detection respect markers (#2207) 2024-03-05 17:25:06 +00:00
version_map.rs Clippy pedantic (#1963) 2024-02-25 14:04:05 -05:00
yanks.rs Make direct dependency detection respect markers (#2207) 2024-03-05 17:25:06 +00:00