diff --git a/crates/puffin-resolver/src/resolver/mod.rs b/crates/puffin-resolver/src/resolver/mod.rs index 2aa366250..0287dc24e 100644 --- a/crates/puffin-resolver/src/resolver/mod.rs +++ b/crates/puffin-resolver/src/resolver/mod.rs @@ -652,22 +652,6 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> { self.visit_package(package, priorities, request_sink)?; } - // If a package has a `requires_python` field, add a constraint on the target - // Python version. - if let Some(requires_python) = metadata.requires_python.as_ref() { - let version = requires_python - .iter() - .map(PubGrubSpecifier::try_from) - .fold_ok(Range::full(), |range, specifier| { - range.intersection(&specifier.into()) - })?; - constraints.insert( - PubGrubPackage::Python(PubGrubPython::Installed), - version.clone(), - ); - constraints.insert(PubGrubPackage::Python(PubGrubPython::Target), version); - } - // If a package has an extra, insert a constraint on the base package. if extra.is_some() { constraints.insert( diff --git a/crates/puffin/tests/pip_install_scenarios.rs b/crates/puffin/tests/pip_install_scenarios.rs index d87bf051b..1c8686b84 100644 --- a/crates/puffin/tests/pip_install_scenarios.rs +++ b/crates/puffin/tests/pip_install_scenarios.rs @@ -690,14 +690,14 @@ fn dependency_excludes_non_contiguous_range_of_compatible_versions() -> Result<( crow>2.0.0 and crow==1.0.0 depends on albatross<2.0.0, we can conclude that crow<2.0.0 depends on albatross<2.0.0. (1) - Because albatross==1.0.0 depends on bluebird==1.0.0 and there are no versions of albatross that satisfy any of: + Because there are no versions of albatross that satisfy any of: albatross<1.0.0 albatross>1.0.0,<2.0.0 - we can conclude that albatross<2.0.0 depends on bluebird==1.0.0. + and albatross==1.0.0 depends on bluebird==1.0.0, we can conclude that albatross<2.0.0 depends on bluebird==1.0.0. And because we know from (1) that crow<2.0.0 depends on albatross<2.0.0, we can conclude that crow<2.0.0 depends on bluebird==1.0.0. And because crow==2.0.0 depends on albatross>=3.0.0 we can conclude that all versions of crow, bluebird!=1.0.0, albatross<3.0.0 are incompatible. (2) - Because albatross==3.0.0 depends on bluebird==3.0.0 and only albatross<=3.0.0 is available, we can conclude that albatross>=3.0.0 depends on bluebird==3.0.0. + Because only albatross<=3.0.0 is available and albatross==3.0.0 depends on bluebird==3.0.0, we can conclude that albatross>=3.0.0 depends on bluebird==3.0.0. And because we know from (2) that all versions of crow, bluebird!=1.0.0, albatross<3.0.0 are incompatible, we can conclude that all versions of crow depend on one of: bluebird<=1.0.0 bluebird>=3.0.0