Move unnamed requirements to their own pep508_rs module and requirements-txt (#3186)

Another refactoring in preparation of using a richer requirements type.
No functional changes, only moves code around
This commit is contained in:
konsti 2024-04-22 16:02:39 +02:00 committed by GitHub
parent f29c991e21
commit 82c4772e89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 262 additions and 244 deletions

View file

@ -18,6 +18,7 @@ once-map = { workspace = true }
pep440_rs = { workspace = true }
pep508_rs = { workspace = true }
pypi-types = { workspace = true }
requirements-txt = { workspace = true }
uv-cache = { workspace = true }
uv-interpreter = { workspace = true }
uv-normalize = { workspace = true }

View file

@ -4,8 +4,9 @@ use rustc_hash::FxHashMap;
use url::Url;
use distribution_types::{DistributionMetadata, HashPolicy, PackageId};
use pep508_rs::{MarkerEnvironment, RequirementsTxtRequirement, VersionOrUrl};
use pep508_rs::{MarkerEnvironment, VersionOrUrl};
use pypi_types::{HashDigest, HashError};
use requirements_txt::RequirementsTxtRequirement;
use uv_normalize::PackageName;
#[derive(Debug, Clone)]
@ -122,7 +123,7 @@ impl HashStrategy {
None => {
return Err(HashStrategyError::UnpinnedRequirement(
requirement.to_string(),
))
));
}
}
}