Support constraints in requirements.in files (#212)

Closes #172.
This commit is contained in:
Charlie Marsh 2023-10-26 17:41:02 -07:00 committed by GitHub
parent 58011f98b6
commit 8b83385763
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 476 additions and 89 deletions

View file

@ -16,7 +16,7 @@ use platform_host::{Arch, Os, Platform};
use platform_tags::Tags;
use puffin_client::RegistryClientBuilder;
use puffin_interpreter::{InterpreterInfo, Virtualenv};
use puffin_resolver::{Manifest, ResolutionMode, Resolver};
use puffin_resolver::{ResolutionManifest, ResolutionMode, Resolver};
use puffin_traits::BuildContext;
struct DummyContext;
@ -64,7 +64,7 @@ async fn pylint() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("pylint==2.3.0").unwrap()],
vec![],
vec![],
@ -85,7 +85,7 @@ async fn black() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("black<=23.9.1").unwrap()],
vec![],
vec![],
@ -106,7 +106,7 @@ async fn black_colorama() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("black[colorama]<=23.9.1").unwrap()],
vec![],
vec![],
@ -127,7 +127,7 @@ async fn black_python_310() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("black<=23.9.1").unwrap()],
vec![],
vec![],
@ -150,7 +150,7 @@ async fn black_mypy_extensions() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("black<=23.9.1").unwrap()],
vec![Requirement::from_str("mypy-extensions<1").unwrap()],
vec![],
@ -173,7 +173,7 @@ async fn black_mypy_extensions_extra() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("black<=23.9.1").unwrap()],
vec![Requirement::from_str("mypy-extensions[extra]<1").unwrap()],
vec![],
@ -196,7 +196,7 @@ async fn black_flake8() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("black<=23.9.1").unwrap()],
vec![Requirement::from_str("flake8<1").unwrap()],
vec![],
@ -217,7 +217,7 @@ async fn black_lowest() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("black>21").unwrap()],
vec![],
vec![],
@ -238,7 +238,7 @@ async fn black_lowest_direct() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("black>21").unwrap()],
vec![],
vec![],
@ -259,7 +259,7 @@ async fn black_respect_preference() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("black<=23.9.1").unwrap()],
vec![],
vec![Requirement::from_str("black==23.9.0").unwrap()],
@ -280,7 +280,7 @@ async fn black_ignore_preference() -> Result<()> {
let client = RegistryClientBuilder::default().build();
let manifest = Manifest::new(
let manifest = ResolutionManifest::new(
vec![Requirement::from_str("black<=23.9.1").unwrap()],
vec![],
vec![Requirement::from_str("black==23.9.2").unwrap()],