Skip to content

Commit

Permalink
temporary patch for benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntSushi committed Feb 14, 2024
1 parent 9808c6b commit 4b7ebeb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/puffin/src/commands/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ pub(crate) async fn pip_compile(
}

/// Whether to allow package upgrades.
#[derive(Debug)]
#[derive(Clone, Debug)]
pub(crate) enum Upgrade {
/// Prefer pinned versions from the existing lockfile, if possible.
None,
Expand Down
38 changes: 38 additions & 0 deletions crates/puffin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,44 @@ async fn run() -> Result<ExitStatus> {
};
let upgrade = Upgrade::from_args(args.upgrade, args.upgrade_package);
let no_build = NoBuild::from_args(args.only_binary, args.no_build);
let iters = std::env::var("PUFFIN_RESOLVE_ITERS")
.ok()
.and_then(|v| v.parse::<usize>().ok())
.unwrap_or(0);
for _ in 0..iters {
commands::pip_compile(
&requirements,
&constraints,
&overrides,
extras.clone(),
args.output_file.as_deref(),
args.resolution,
args.prerelease,
upgrade.clone(),
args.generate_hashes,
!args.no_annotate,
!args.no_header,
args.emit_index_url,
args.emit_find_links,
index_urls.clone(),
if args.legacy_setup_py {
SetupPyStrategy::Setuptools
} else {
SetupPyStrategy::Pep517
},
if args.offline {
Connectivity::Offline
} else {
Connectivity::Online
},
&no_build,
args.python_version.clone(),
args.exclude_newer,
cache.clone(),
printer,
)
.await?;
}
commands::pip_compile(
&requirements,
&constraints,
Expand Down

0 comments on commit 4b7ebeb

Please sign in to comment.