astral-sh / uv

An extremely fast Python package installer and resolver, written in Rust.
https://astral.sh/
Apache License 2.0
11.75k stars 322 forks source link

Make `Requirement` generic over url type #3253

Closed konstin closed 6 days ago

konstin commented 2 weeks ago

This change allows switching out the url type for requirements. The original idea was to allow different types for different requirement origins, so that core metadata reads can ban non-pep 508 requirements while we only allow them for requirements.txt. This didn't work out because we expect &Requirements from all sources to match.

I also tried to split pep508_rs into a PEP 508 compliant crate and into our extensions, but they are to tightly coupled.

I think this change is an improvement still as it reduces the hardcoded dependence on VerbatimUrl.