Pin benchmark requirements (#4429)

## Summary

This should make benchmarks more consistent.
This commit is contained in:
Ibraheem Ahmed 2024-06-20 14:13:38 -04:00 committed by GitHub
parent e783a79955
commit e797d3eb5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 4 deletions

View file

@ -45,6 +45,7 @@ uv-resolver = { workspace = true }
uv-types = { workspace = true }
anyhow = { workspace = true }
chrono = { workspace = true }
codspeed-criterion-compat = { version = "2.6.0", default-features = false, optional = true }
criterion = { version = "0.5.1", default-features = false, features = ["async_tokio"] }
once_cell = { workspace = true }

View file

@ -18,7 +18,7 @@ fn resolve_warm_jupyter(c: &mut Criterion<WallTime>) {
let venv = PythonEnvironment::from_root("../../.venv", cache).unwrap();
let client = &RegistryClientBuilder::new(cache.clone()).build();
let manifest = &Manifest::simple(vec![Requirement::from(
pep508_rs::Requirement::from_str("jupyter").unwrap(),
pep508_rs::Requirement::from_str("jupyter==1.0.0").unwrap(),
)]);
let run = || {
@ -47,7 +47,7 @@ fn resolve_warm_airflow(c: &mut Criterion<WallTime>) {
let venv = PythonEnvironment::from_root("../../.venv", cache).unwrap();
let client = &RegistryClientBuilder::new(cache.clone()).build();
let manifest = &Manifest::simple(vec![
Requirement::from(pep508_rs::Requirement::from_str("apache-airflow[all]").unwrap()),
Requirement::from(pep508_rs::Requirement::from_str("apache-airflow[all]==2.9.2").unwrap()),
Requirement::from(
pep508_rs::Requirement::from_str("apache-airflow-providers-apache-beam>3.0.0").unwrap(),
),
@ -72,6 +72,7 @@ criterion_main!(uv);
mod resolver {
use anyhow::Result;
use chrono::NaiveDate;
use once_cell::sync::Lazy;
use distribution_types::IndexLocations;
@ -87,7 +88,8 @@ mod resolver {
use uv_distribution::DistributionDatabase;
use uv_git::GitResolver;
use uv_resolver::{
FlatIndex, InMemoryIndex, Manifest, Options, PythonRequirement, ResolutionGraph, Resolver,
FlatIndex, InMemoryIndex, Manifest, OptionsBuilder, PythonRequirement, ResolutionGraph,
Resolver,
};
use uv_toolchain::PythonEnvironment;
use uv_types::{BuildIsolation, EmptyInstalledPackages, HashStrategy, InFlight};
@ -157,9 +159,20 @@ mod resolver {
PreviewMode::Disabled,
);
let options = OptionsBuilder::new()
.exclude_newer(Some(
NaiveDate::from_ymd_opt(2024, 6, 20)
.unwrap()
.and_hms_opt(0, 0, 0)
.unwrap()
.and_utc()
.into(),
))
.build();
let resolver = Resolver::new(
manifest,
Options::default(),
options,
&python_requirement,
Some(&MARKERS),
Some(&TAGS),