mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Pin benchmark requirements (#4429)
## Summary This should make benchmarks more consistent.
This commit is contained in:
parent
e783a79955
commit
e797d3eb5c
3 changed files with 19 additions and 4 deletions
|
@ -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 }
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue