Use VerbatimParsedUrl in pep508_rs (#3758)

When parsing requirements from any source, directly parse the url parts
(and reject unsupported urls) instead of parsing url parts at a later
stage. This removes a bunch of error branches and concludes the work
parsing url parts once and passing them around everywhere.

Many usages of the assembled `VerbatimUrl` remain, but these can be
removed incrementally.

Please review commit-by-commit.
This commit is contained in:
konsti 2024-05-23 21:52:47 +02:00 committed by GitHub
parent 0d2f3fc4e4
commit 4db468e27f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 877 additions and 656 deletions

View file

@ -1063,8 +1063,8 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
.requires_dist
.iter()
.cloned()
.map(Requirement::from_pep508)
.collect::<Result<_, _>>()?;
.map(Requirement::from)
.collect();
let dependencies = PubGrubDependencies::from_requirements(
&requirements,
&self.constraints,
@ -1170,8 +1170,8 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
.requires_dist
.iter()
.cloned()
.map(Requirement::from_pep508)
.collect::<Result<_, _>>()?;
.map(Requirement::from)
.collect();
let dependencies = PubGrubDependencies::from_requirements(
&requirements,
&self.constraints,