diff --git a/crates/puffin/src/commands/pip_compile.rs b/crates/puffin/src/commands/pip_compile.rs index ccdc742d2..d027b021d 100644 --- a/crates/puffin/src/commands/pip_compile.rs +++ b/crates/puffin/src/commands/pip_compile.rs @@ -399,7 +399,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, diff --git a/crates/puffin/src/main.rs b/crates/puffin/src/main.rs index 4d1bff46c..df5c10dbe 100644 --- a/crates/puffin/src/main.rs +++ b/crates/puffin/src/main.rs @@ -774,6 +774,39 @@ async fn run() -> Result { }; 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::().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 + }, + &no_build, + args.python_version.clone(), + args.exclude_newer, + cache.clone(), + printer, + ) + .await?; + } commands::pip_compile( &requirements, &constraints,