Remove uses of Option<MarkerTree> (#5978)

## Summary

Follow up to https://github.com/astral-sh/uv/pull/5898. This should fix
some of the failures in https://github.com/astral-sh/uv/pull/5887 where
`uv lock --locked` is failing due to `Some(true)` and `None` markers not
comparing equal.
This commit is contained in:
Ibraheem Ahmed 2024-08-10 13:23:29 -04:00 committed by GitHub
parent 4eced1bd0c
commit f5110f7b5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 228 additions and 330 deletions

View file

@ -522,8 +522,8 @@ fn update_requirement(old: &mut Requirement, new: &Requirement, has_source: bool
}
// Update the marker expression.
if let Some(marker) = new.marker.clone() {
old.marker = Some(marker);
if new.marker.contents().is_some() {
old.marker = new.marker.clone();
}
}

View file

@ -8,7 +8,7 @@ use glob::{glob, GlobError, PatternError};
use rustc_hash::FxHashSet;
use tracing::{debug, trace, warn};
use pep508_rs::{RequirementOrigin, VerbatimUrl};
use pep508_rs::{MarkerTree, RequirementOrigin, VerbatimUrl};
use pypi_types::{Requirement, RequirementSource};
use uv_fs::{absolutize_path, normalize_path, relative_to, Simplified};
use uv_normalize::{GroupName, PackageName, DEV_DEPENDENCIES};
@ -282,7 +282,7 @@ impl Workspace {
Some(Requirement {
name: project.name.clone(),
extras,
marker: None,
marker: MarkerTree::TRUE,
source: RequirementSource::Directory {
install_path: member.root.clone(),
lock_path: member