diff --git a/crates/uv/src/commands/pip/operations.rs b/crates/uv/src/commands/pip/operations.rs index 3663a8fe57a8..e451777d8d00 100644 --- a/crates/uv/src/commands/pip/operations.rs +++ b/crates/uv/src/commands/pip/operations.rs @@ -341,6 +341,180 @@ impl Changelog { /// Install a set of requirements into the current environment. /// /// Returns a [`Changelog`] summarizing the changes made to the environment. +// pub(crate) async fn install( +// resolution: &Resolution, +// site_packages: SitePackages, +// modifications: Modifications, +// reinstall: &Reinstall, +// build_options: &BuildOptions, +// link_mode: LinkMode, +// compile: bool, +// index_urls: &IndexLocations, +// config_settings: &ConfigSettings, +// hasher: &HashStrategy, +// markers: &ResolverMarkerEnvironment, +// tags: &Tags, +// client: &RegistryClient, +// in_flight: &InFlight, +// concurrency: Concurrency, +// build_dispatch: &BuildDispatch<'_>, +// cache: &Cache, +// venv: &PythonEnvironment, +// logger: Box, +// dry_run: bool, +// printer: Printer, +// ) -> Result { +// let start = std::time::Instant::now(); + +// // Extract the requirements from the resolution. +// let requirements = resolution.requirements().collect::>(); + +// // Partition into those that should be linked from the cache (`local`), those that need to be +// // downloaded (`remote`), and those that should be removed (`extraneous`). +// let plan = Planner::new(&requirements) +// .build( +// site_packages, +// reinstall, +// build_options, +// hasher, +// index_urls, +// config_settings, +// cache, +// venv, +// markers, +// tags, +// ) +// .context("Failed to determine installation plan")?; + +// if dry_run { +// report_dry_run(resolution, plan, modifications, start, printer)?; +// return Ok(Changelog::default()); +// } + +// let Plan { +// cached, +// remote, +// reinstalls, +// extraneous, +// } = plan; + +// // If we're in `install` mode, ignore any extraneous distributions. +// let extraneous = match modifications { +// Modifications::Sufficient => vec![], +// Modifications::Exact => extraneous, +// }; + +// // Nothing to do. +// if remote.is_empty() && cached.is_empty() && reinstalls.is_empty() && extraneous.is_empty() { +// logger.on_audit(resolution.len(), start, printer)?; +// return Ok(Changelog::default()); +// } + +// // Map any registry-based requirements back to those returned by the resolver. +// let remote = remote +// .iter() +// .map(|dist| { +// resolution +// .get_remote(&dist.name) +// .cloned() +// .expect("Resolution should contain all packages") +// }) +// .collect::>(); + +// // Download, build, and unzip any missing distributions. +// let wheels = if remote.is_empty() { +// vec![] +// } else { +// let start = std::time::Instant::now(); + +// let preparer = Preparer::new( +// cache, +// tags, +// hasher, +// build_options, +// DistributionDatabase::new(client, build_dispatch, concurrency.downloads), +// ) +// .with_reporter(PrepareReporter::from(printer).with_length(remote.len() as u64)); + +// let wheels = preparer +// .prepare(remote.clone(), in_flight) +// .await +// .context("Failed to prepare distributions")?; + +// logger.on_prepare(wheels.len(), start, printer)?; + +// wheels +// }; + +// // Remove any upgraded or extraneous installations. +// let uninstalls = extraneous.into_iter().chain(reinstalls).collect::>(); +// if !uninstalls.is_empty() { +// let start = std::time::Instant::now(); + +// for dist_info in &uninstalls { +// match uv_installer::uninstall(dist_info).await { +// Ok(summary) => { +// debug!( +// "Uninstalled {} ({} file{}, {} director{})", +// dist_info.name(), +// summary.file_count, +// if summary.file_count == 1 { "" } else { "s" }, +// summary.dir_count, +// if summary.dir_count == 1 { "y" } else { "ies" }, +// ); +// } +// Err(uv_installer::UninstallError::Uninstall( +// install_wheel_rs::Error::MissingRecord(_), +// )) => { +// warn_user!( +// "Failed to uninstall package at {} due to missing `RECORD` file. Installation may result in an incomplete environment.", +// dist_info.path().user_display().cyan(), +// ); +// } +// Err(uv_installer::UninstallError::Uninstall( +// install_wheel_rs::Error::MissingTopLevel(_), +// )) => { +// warn_user!( +// "Failed to uninstall package at {} due to missing `top-level.txt` file. Installation may result in an incomplete environment.", +// dist_info.path().user_display().cyan(), +// ); +// } +// Err(err) => return Err(err.into()), +// } +// } + +// logger.on_uninstall(uninstalls.len(), start, printer)?; +// } + +// // Install the resolved distributions. +// let mut installs = wheels.into_iter().chain(cached).collect::>(); +// if !installs.is_empty() { +// let start = std::time::Instant::now(); +// installs = uv_installer::Installer::new(venv) +// .with_link_mode(link_mode) +// .with_cache(cache) +// .with_reporter(InstallReporter::from(printer).with_length(installs.len() as u64)) +// // This technically can block the runtime, but we are on the main thread and +// // have no other running tasks at this point, so this lets us avoid spawning a blocking +// // task. +// .install_blocking(installs)?; + +// logger.on_install(installs.len(), start, printer)?; +// } + +// if compile { +// compile_bytecode(venv, cache, printer).await?; +// } + +// // Construct a summary of the changes made to the environment. +// let changelog = Changelog::new(installs, uninstalls); + +// // Notify the user of any environment modifications. +// logger.on_complete(&changelog, printer)?; + +// Ok(changelog) +// } + pub(crate) async fn install( resolution: &Resolution, site_packages: SitePackages, @@ -366,6 +540,23 @@ pub(crate) async fn install( ) -> Result { let start = std::time::Instant::now(); + // Print the environment path + let python_executable = venv.python_executable(); + let venv_dir = PathBuf::from(".venv"); + let venv_dir_canonical = venv_dir.canonicalize().unwrap_or(venv_dir); + let is_outside_working_directory = !(python_executable.starts_with(venv_dir_canonical)); + if is_outside_working_directory { + writeln!( + printer.stderr(), + "{}", + format!( + "Installing to environment at {}", + python_executable.user_display() + ) + .dimmed() + )?; + } + // Extract the requirements from the resolution. let requirements = resolution.requirements().collect::>(); diff --git a/crates/uv/tests/branching_urls.rs b/crates/uv/tests/branching_urls.rs index 97f6d6656ace..77325ea9ff0a 100644 --- a/crates/uv/tests/branching_urls.rs +++ b/crates/uv/tests/branching_urls.rs @@ -28,14 +28,15 @@ fn branching_urls_disjoint() -> Result<()> { "# }; make_project(context.temp_dir.path(), "a", deps)?; - uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "### + "# ); Ok(()) @@ -61,16 +62,17 @@ fn branching_urls_overlapping() -> Result<()> { "# }; make_project(context.temp_dir.path(), "a", deps)?; - uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Requirements contain conflicting URLs for package `iniconfig` in split `python_full_version == '3.11.*'`: - https://files.pythonhosted.org/packages/9b/dd/b3c12c6d707058fa947864b67f0c4e0c39ef8610988d7baea9578f3c48f3/iniconfig-1.1.1-py2.py3-none-any.whl - https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl - "### + "# ); Ok(()) @@ -127,16 +129,17 @@ fn root_package_splits_but_transitive_conflict() -> Result<()> { "# }; make_project(&context.temp_dir.path().join("b2"), "b2", deps)?; - uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Requirements contain conflicting URLs for package `iniconfig` in split `python_full_version < '3.12'`: - https://files.pythonhosted.org/packages/9b/dd/b3c12c6d707058fa947864b67f0c4e0c39ef8610988d7baea9578f3c48f3/iniconfig-1.1.1-py2.py3-none-any.whl - https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl - "### + "# ); Ok(()) @@ -195,14 +198,15 @@ fn root_package_splits_transitive_too() -> Result<()> { "# }; make_project(&context.temp_dir.path().join("b2"), "b2", deps)?; - uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 10 packages in [TIME] - "### + "# ); assert_snapshot!(fs_err::read_to_string(context.temp_dir.join("uv.lock"))?, @r###" @@ -390,14 +394,15 @@ fn root_package_splits_other_dependencies_too() -> Result<()> { "# }; make_project(&context.temp_dir.path().join("b2"), "b2", deps)?; - uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 9 packages in [TIME] - "### + "# ); assert_snapshot!(fs_err::read_to_string(context.temp_dir.join("uv.lock"))?, @r###" @@ -550,14 +555,15 @@ fn branching_between_registry_and_direct_url() -> Result<()> { "# }; make_project(context.temp_dir.path(), "a", deps)?; - uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "### + "# ); // We have source dist and wheel for the registry, but only the wheel for the direct URL. @@ -635,14 +641,15 @@ fn branching_urls_of_different_sources_disjoint() -> Result<()> { "# }; make_project(context.temp_dir.path(), "a", deps)?; - uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "### + "# ); // We have source dist and wheel for the registry, but only the wheel for the direct URL. @@ -717,16 +724,17 @@ fn branching_urls_of_different_sources_conflict() -> Result<()> { "# }; make_project(context.temp_dir.path(), "a", deps)?; - uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Requirements contain conflicting URLs for package `iniconfig` in split `python_full_version == '3.11.*'`: - git+https://github.com/pytest-dev/iniconfig@93f5930e668c0d1ddf4597e38dd0dea4e2665e7a - https://files.pythonhosted.org/packages/9b/dd/b3c12c6d707058fa947864b67f0c4e0c39ef8610988d7baea9578f3c48f3/iniconfig-1.1.1-py2.py3-none-any.whl - "### + "# ); Ok(()) @@ -763,14 +771,15 @@ fn dont_pre_visit_url_packages() -> Result<()> { " }; make_project(&context.temp_dir.join("c"), "c", deps)?; - uv_snapshot!(context.filters(), context.lock().arg("--offline").current_dir(&context.temp_dir), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--offline").current_dir(&context.temp_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "### + "# ); assert_snapshot!(fs_err::read_to_string(context.temp_dir.join("uv.lock"))?, @r###" diff --git a/crates/uv/tests/build.rs b/crates/uv/tests/build.rs index 51236675f904..1a593717acb0 100644 --- a/crates/uv/tests/build.rs +++ b/crates/uv/tests/build.rs @@ -1244,7 +1244,7 @@ fn sha() -> Result<()> { let constraints = project.child("constraints.txt"); constraints.write_str("setuptools==68.2.2 --hash=sha256:a248cb506794bececcddeddb1678bc722f9cfcacf02f98f7c0af6b9ed893caf2")?; - uv_snapshot!(&filters, context.build().arg("--build-constraint").arg("constraints.txt").current_dir(&project), @r###" + uv_snapshot!(&filters, context.build().arg("--build-constraint").arg("constraints.txt").current_dir(&project), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1312,7 +1312,7 @@ fn sha() -> Result<()> { creating build/bdist.linux-x86_64/wheel copying build/lib/__init__.py -> build/bdist.linux-x86_64/wheel running install_egg_info - Copying src/project.egg-info to build/bdist.linux-x86_64/wheel/project-0.1.0-py3.8.egg-info + Copying src/project.egg-info to build/bdist.linux-x86_64/wheel/project-0.1.0-py3.12.egg-info running install_scripts creating build/bdist.linux-x86_64/wheel/project-0.1.0.dist-info/WHEEL creating '[TEMP_DIR]/project/dist/[TMP]/wheel' to it @@ -1323,7 +1323,7 @@ fn sha() -> Result<()> { adding 'project-0.1.0.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Successfully built dist/project-0.1.0.tar.gz and dist/project-0.1.0-py3-none-any.whl - "###); + "#); project .child("dist") @@ -1396,7 +1396,7 @@ fn sha() -> Result<()> { let constraints = project.child("constraints.txt"); constraints.write_str("setuptools==68.2.2 --hash=sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a")?; - uv_snapshot!(&filters, context.build().arg("--build-constraint").arg("constraints.txt").current_dir(&project), @r###" + uv_snapshot!(&filters, context.build().arg("--build-constraint").arg("constraints.txt").current_dir(&project), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1462,7 +1462,7 @@ fn sha() -> Result<()> { creating build/bdist.linux-x86_64/wheel copying build/lib/__init__.py -> build/bdist.linux-x86_64/wheel running install_egg_info - Copying src/project.egg-info to build/bdist.linux-x86_64/wheel/project-0.1.0-py3.8.egg-info + Copying src/project.egg-info to build/bdist.linux-x86_64/wheel/project-0.1.0-py3.12.egg-info running install_scripts creating build/bdist.linux-x86_64/wheel/project-0.1.0.dist-info/WHEEL creating '[TEMP_DIR]/project/dist/[TMP]/wheel' to it @@ -1473,7 +1473,7 @@ fn sha() -> Result<()> { adding 'project-0.1.0.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Successfully built dist/project-0.1.0.tar.gz and dist/project-0.1.0-py3-none-any.whl - "###); + "#); project .child("dist") diff --git a/crates/uv/tests/cache_prune.rs b/crates/uv/tests/cache_prune.rs index 2c3c436a7a0e..11b5eae870ec 100644 --- a/crates/uv/tests/cache_prune.rs +++ b/crates/uv/tests/cache_prune.rs @@ -84,7 +84,7 @@ fn prune_cached_env() { .arg("pytest@8.0.0") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -92,13 +92,14 @@ fn prune_cached_env() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + iniconfig==2.0.0 + packaging==24.0 + pluggy==1.4.0 + pytest==8.0.0 - "###); + "#); let filters: Vec<_> = context .filters() diff --git a/crates/uv/tests/common/mod.rs b/crates/uv/tests/common/mod.rs index 949bdcef26e6..0970f165e4d9 100644 --- a/crates/uv/tests/common/mod.rs +++ b/crates/uv/tests/common/mod.rs @@ -64,6 +64,10 @@ pub const INSTA_FILTERS: &[(&str, &str)] = &[ r"Caused by: .* \(os error 2\)", "Caused by: No such file or directory (os error 2)", ), + ( + r"environments-v1/[a-zA-Z0-9]+/[a-zA-Z0-9]+", + "environments-v1/[RANDOM]/[RANDOM]", + ), ]; /// Create a context for tests which simplifies shared behavior across tests. diff --git a/crates/uv/tests/edit.rs b/crates/uv/tests/edit.rs index f001ca79bed2..c7de7f8e3c0a 100644 --- a/crates/uv/tests/edit.rs +++ b/crates/uv/tests/edit.rs @@ -29,12 +29,13 @@ fn add_registry() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("anyio==3.7.0"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio==3.7.0"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 4 packages in [TIME] Installed 4 packages in [TIME] @@ -42,7 +43,7 @@ fn add_registry() -> Result<()> { + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -125,14 +126,15 @@ fn add_registry() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 4 packages in [TIME] - "###); + "#); Ok(()) } @@ -156,56 +158,60 @@ fn add_git() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==3.7.0 + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); // Adding with an ambiguous Git reference should treat it as a revision. - uv_snapshot!(context.filters(), context.add().arg("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@0.0.1"), @r###" + uv_snapshot!(context.filters(), context.add().arg("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@0.0.1"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] Prepared 2 packages in [TIME] Uninstalled 1 package in [TIME] Installed 2 packages in [TIME] ~ project==0.1.0 (from file://[TEMP_DIR]/) + uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979) - "###); + "#); - uv_snapshot!(context.filters(), context.add().arg("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage").arg("--tag=0.0.1"), @r###" + uv_snapshot!(context.filters(), context.add().arg("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage").arg("--tag=0.0.1"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -301,14 +307,15 @@ fn add_git() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 5 packages in [TIME] - "###); + "#); Ok(()) } @@ -334,18 +341,19 @@ fn add_git_private_source() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg(format!("uv-private-pypackage @ git+https://{token}@github.com/astral-test/uv-private-pypackage")), @r###" + uv_snapshot!(context.filters(), context.add().arg(format!("uv-private-pypackage @ git+https://{token}@github.com/astral-test/uv-private-pypackage")), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) + uv-private-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-private-pypackage@d780faf0ac91257d4d5a4f0c5a0e4509608c0071) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -405,14 +413,15 @@ fn add_git_private_source() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -438,18 +447,19 @@ fn add_git_private_raw() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg(format!("uv-private-pypackage @ git+https://{token}@github.com/astral-test/uv-private-pypackage")).arg("--raw-sources"), @r###" + uv_snapshot!(context.filters(), context.add().arg(format!("uv-private-pypackage @ git+https://{token}@github.com/astral-test/uv-private-pypackage")).arg("--raw-sources"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) + uv-private-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-private-pypackage@d780faf0ac91257d4d5a4f0c5a0e4509608c0071) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -511,14 +521,15 @@ fn add_git_private_raw() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -541,45 +552,49 @@ fn add_git_error() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] - "###); + "#); - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 1 package in [TIME] Installed 1 package in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); // Provide a tag without a Git source. - uv_snapshot!(context.filters(), context.add().arg("flask").arg("--tag").arg("0.0.1"), @r###" + uv_snapshot!(context.filters(), context.add().arg("flask").arg("--tag").arg("0.0.1"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: `flask` did not resolve to a Git repository, but a Git reference (`--tag 0.0.1`) was provided. - "###); + "#); // Provide a tag with a non-Git source. - uv_snapshot!(context.filters(), context.add().arg("flask @ https://files.pythonhosted.org/packages/61/80/ffe1da13ad9300f87c93af113edd0638c75138c42a0994becfacac078c06/flask-3.0.3-py3-none-any.whl").arg("--branch").arg("0.0.1"), @r###" + uv_snapshot!(context.filters(), context.add().arg("flask @ https://files.pythonhosted.org/packages/61/80/ffe1da13ad9300f87c93af113edd0638c75138c42a0994becfacac078c06/flask-3.0.3-py3-none-any.whl").arg("--branch").arg("0.0.1"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: `flask` did not resolve to a Git repository, but a Git reference (`--branch 0.0.1`) was provided. - "###); + "#); Ok(()) } @@ -603,43 +618,46 @@ fn add_git_raw() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==3.7.0 + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); // Use an ambiguous tag reference, which would otherwise not resolve. - uv_snapshot!(context.filters(), context.add().arg("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@0.0.1").arg("--raw-sources"), @r###" + uv_snapshot!(context.filters(), context.add().arg("uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@0.0.1").arg("--raw-sources"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] Prepared 2 packages in [TIME] Uninstalled 1 package in [TIME] Installed 2 packages in [TIME] ~ project==0.1.0 (from file://[TEMP_DIR]/) + uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -732,14 +750,15 @@ fn add_git_raw() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 5 packages in [TIME] - "###); + "#); Ok(()) } @@ -763,43 +782,46 @@ fn add_git_implicit() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==3.7.0 + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); // Omit the `git+` prefix. - uv_snapshot!(context.filters(), context.add().arg("uv-public-pypackage @ https://github.com/astral-test/uv-public-pypackage.git"), @r###" + uv_snapshot!(context.filters(), context.add().arg("uv-public-pypackage @ https://github.com/astral-test/uv-public-pypackage.git"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] Prepared 2 packages in [TIME] Uninstalled 1 package in [TIME] Installed 2 packages in [TIME] ~ project==0.1.0 (from file://[TEMP_DIR]/) + uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage.git@b270df1a2fb5d012294e9aaf05e7e0bab1e6a389) - "###); + "#); Ok(()) } @@ -859,18 +881,19 @@ fn add_unnamed() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("git+https://github.com/astral-test/uv-public-pypackage").arg("--tag=0.0.1"), @r###" + uv_snapshot!(context.filters(), context.add().arg("git+https://github.com/astral-test/uv-public-pypackage").arg("--tag=0.0.1"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) + uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -930,14 +953,15 @@ fn add_unnamed() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -960,12 +984,13 @@ fn add_remove_dev() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("anyio==3.7.0").arg("--dev"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio==3.7.0").arg("--dev"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 4 packages in [TIME] Installed 4 packages in [TIME] @@ -973,7 +998,7 @@ fn add_remove_dev() -> Result<()> { + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -1064,14 +1089,15 @@ fn add_remove_dev() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 4 packages in [TIME] - "###); + "#); // This should fail without --dev. uv_snapshot!(context.filters(), context.remove().arg("anyio"), @r###" @@ -1085,12 +1111,13 @@ fn add_remove_dev() -> Result<()> { "###); // Remove the dependency. - uv_snapshot!(context.filters(), context.remove().arg("anyio").arg("--dev"), @r###" + uv_snapshot!(context.filters(), context.remove().arg("anyio").arg("--dev"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] Prepared 1 package in [TIME] Uninstalled 4 packages in [TIME] @@ -1099,7 +1126,7 @@ fn add_remove_dev() -> Result<()> { - idna==3.6 ~ project==0.1.0 (from file://[TEMP_DIR]/) - sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -1146,14 +1173,15 @@ fn add_remove_dev() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 1 package in [TIME] - "###); + "#); Ok(()) } @@ -1176,12 +1204,13 @@ fn add_remove_optional() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("anyio==3.7.0").arg("--optional=io"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio==3.7.0").arg("--optional=io"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 4 packages in [TIME] Installed 4 packages in [TIME] @@ -1189,7 +1218,7 @@ fn add_remove_optional() -> Result<()> { + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -1279,17 +1308,18 @@ fn add_remove_optional() -> Result<()> { // Install from the lockfile. At present, this will _uninstall_ the packages since `sync` does // not include extras by default. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Uninstalled 3 packages in [TIME] - anyio==3.7.0 - idna==3.6 - sniffio==1.3.1 - "###); + "#); // This should fail without --optional. uv_snapshot!(context.filters(), context.remove().arg("anyio"), @r###" @@ -1303,18 +1333,19 @@ fn add_remove_optional() -> Result<()> { "###); // Remove the dependency. - uv_snapshot!(context.filters(), context.remove().arg("anyio").arg("--optional=io"), @r###" + uv_snapshot!(context.filters(), context.remove().arg("anyio").arg("--optional=io"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -1361,14 +1392,15 @@ fn add_remove_optional() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 1 package in [TIME] - "###); + "#); Ok(()) } @@ -1393,18 +1425,19 @@ fn add_remove_inline_optional() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("typing-extensions").arg("--optional=types"), @r###" + uv_snapshot!(context.filters(), context.add().arg("typing-extensions").arg("--optional=types"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) + typing-extensions==4.10.0 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -1431,12 +1464,13 @@ fn add_remove_inline_optional() -> Result<()> { ); }); - uv_snapshot!(context.filters(), context.remove().arg("typing-extensions").arg("--optional=types"), @r###" + uv_snapshot!(context.filters(), context.remove().arg("typing-extensions").arg("--optional=types"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 4 packages in [TIME] Uninstalled 2 packages in [TIME] @@ -1446,7 +1480,7 @@ fn add_remove_inline_optional() -> Result<()> { ~ project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - typing-extensions==4.10.0 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -1519,14 +1553,15 @@ fn add_remove_workspace() -> Result<()> { .arg("child1") .current_dir(&context.temp_dir); - uv_snapshot!(context.filters(), add_cmd, @r###" + uv_snapshot!(context.filters(), add_cmd, @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Workspace dependency `child2` must refer to local directory, not a Git repository - "###); + "#); // Workspace packages should be detected automatically. let child1 = context.temp_dir.join("child1"); @@ -1537,18 +1572,19 @@ fn add_remove_workspace() -> Result<()> { .arg("child1") .current_dir(&context.temp_dir); - uv_snapshot!(context.filters(), add_cmd, @r###" + uv_snapshot!(context.filters(), add_cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + child1==0.1.0 (from file://[TEMP_DIR]/child1) + child2==0.1.0 (from file://[TEMP_DIR]/child2) - "###); + "#); let pyproject_toml = fs_err::read_to_string(child1.join("pyproject.toml"))?; @@ -1615,29 +1651,33 @@ fn add_remove_workspace() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&child1), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&child1), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `[VENV]/` and will be ignored + Installing to environment at [VENV]/bin/python3 Audited 2 packages in [TIME] - "###); + "#); // Remove the dependency. - uv_snapshot!(context.filters(), context.remove().arg("child2").current_dir(&child1), @r###" + uv_snapshot!(context.filters(), context.remove().arg("child2").current_dir(&child1), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `[VENV]/` and will be ignored Resolved 2 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 1 package in [TIME] Uninstalled 2 packages in [TIME] Installed 1 package in [TIME] ~ child1==0.1.0 (from file://[TEMP_DIR]/child1) - child2==0.1.0 (from file://[TEMP_DIR]/child2) - "###); + "#); let pyproject_toml = fs_err::read_to_string(child1.join("pyproject.toml"))?; @@ -1694,14 +1734,16 @@ fn add_remove_workspace() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&child1), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&child1), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `[VENV]/` and will be ignored + Installing to environment at [VENV]/bin/python3 Audited 1 package in [TIME] - "###); + "#); Ok(()) } @@ -1747,18 +1789,20 @@ fn add_workspace_editable() -> Result<()> { let mut add_cmd = context.add(); add_cmd.arg("child2").arg("--editable").current_dir(&child1); - uv_snapshot!(context.filters(), add_cmd, @r###" + uv_snapshot!(context.filters(), add_cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `[VENV]/` and will be ignored Resolved 2 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + child1==0.1.0 (from file://[TEMP_DIR]/child1) + child2==0.1.0 (from file://[TEMP_DIR]/child2) - "###); + "#); let pyproject_toml = fs_err::read_to_string(child1.join("pyproject.toml"))?; @@ -1825,14 +1869,16 @@ fn add_workspace_editable() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&child1), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&child1), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `[VENV]/` and will be ignored + Installing to environment at [VENV]/bin/python3 Audited 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -1868,12 +1914,13 @@ fn add_path() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("./child").current_dir(workspace.path()), @r###" + uv_snapshot!(context.filters(), context.add().arg("./child").current_dir(workspace.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: .venv Resolved 2 packages in [TIME] @@ -1881,7 +1928,7 @@ fn add_path() -> Result<()> { Installed 2 packages in [TIME] + child==0.1.0 (from file://[TEMP_DIR]/workspace/child) + parent==0.1.0 (from file://[TEMP_DIR]/workspace) - "###); + "#); let pyproject_toml = fs_err::read_to_string(workspace.join("pyproject.toml"))?; @@ -1942,14 +1989,15 @@ fn add_path() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(workspace.path()), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(workspace.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -1973,21 +2021,23 @@ fn update() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "#); - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + certifi==2024.2.2 @@ -1996,21 +2046,22 @@ fn update() -> Result<()> { + project==0.1.0 (from file://[TEMP_DIR]/) + requests==2.31.0 + urllib3==2.2.1 - "###); + "#); // Enable an extra (note the version specifier should be preserved). - uv_snapshot!(context.filters(), context.add().arg("requests[security]"), @r###" + uv_snapshot!(context.filters(), context.add().arg("requests[security]"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2035,12 +2086,13 @@ fn update() -> Result<()> { }); // Enable extras using the CLI flag and add a marker. - uv_snapshot!(context.filters(), context.add().arg("requests; python_version > '3.7'").args(["--extra=use_chardet_on_py3", "--extra=socks"]), @r###" + uv_snapshot!(context.filters(), context.add().arg("requests; python_version > '3.7'").args(["--extra=use_chardet_on_py3", "--extra=socks"]), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] Prepared 3 packages in [TIME] Uninstalled 1 package in [TIME] @@ -2048,7 +2100,7 @@ fn update() -> Result<()> { + chardet==5.2.0 ~ project==0.1.0 (from file://[TEMP_DIR]/) + pysocks==1.7.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2075,12 +2127,13 @@ fn update() -> Result<()> { // Change the source by specifying a version (note the extras, markers, and version should be // preserved). - uv_snapshot!(context.filters(), context.add().arg("requests @ git+https://github.com/psf/requests").arg("--tag=v2.32.3"), @r###" + uv_snapshot!(context.filters(), context.add().arg("requests @ git+https://github.com/psf/requests").arg("--tag=v2.32.3"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] Prepared 2 packages in [TIME] Uninstalled 2 packages in [TIME] @@ -2088,7 +2141,7 @@ fn update() -> Result<()> { ~ project==0.1.0 (from file://[TEMP_DIR]/) - requests==2.31.0 + requests==2.32.3 (from git+https://github.com/psf/requests@0e322af87745eff34caffe4df68456ebc20d9068) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2235,14 +2288,15 @@ fn update() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 8 packages in [TIME] - "###); + "#); Ok(()) } @@ -2264,21 +2318,23 @@ fn add_update_marker() -> Result<()> { requires = ["setuptools>=42"] build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "#); - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + certifi==2024.2.2 @@ -2287,21 +2343,22 @@ fn add_update_marker() -> Result<()> { + project==0.1.0 (from file://[TEMP_DIR]/) + requests==2.31.0 + urllib3==2.2.1 - "###); + "#); // Restrict the `requests` version for Python <3.11 - uv_snapshot!(context.filters(), context.add().arg("requests>=2.0,<2.29; python_version < '3.11'"), @r###" + uv_snapshot!(context.filters(), context.add().arg("requests>=2.0,<2.29; python_version < '3.11'"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2328,18 +2385,19 @@ fn add_update_marker() -> Result<()> { }); // Change the restricted `requests` version for Python <3.11 - uv_snapshot!(context.filters(), context.add().arg("requests>=2.0,<2.20; python_version < '3.11'"), @r###" + uv_snapshot!(context.filters(), context.add().arg("requests>=2.0,<2.20; python_version < '3.11'"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 10 packages in [TIME] Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2366,12 +2424,13 @@ fn add_update_marker() -> Result<()> { }); // Restrict the `requests` version on Windows and Python >3.11 - uv_snapshot!(context.filters(), context.add().arg("requests>=2.31 ; sys_platform == 'win32' and python_version > '3.11'"), @r###" + uv_snapshot!(context.filters(), context.add().arg("requests>=2.31 ; sys_platform == 'win32' and python_version > '3.11'"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] Prepared 3 packages in [TIME] Uninstalled 3 packages in [TIME] @@ -2381,7 +2440,7 @@ fn add_update_marker() -> Result<()> { ~ project==0.1.0 (from file://[TEMP_DIR]/) - urllib3==2.2.1 + urllib3==1.23 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2409,18 +2468,19 @@ fn add_update_marker() -> Result<()> { }); // Restrict the `requests` version on Windows - uv_snapshot!(context.filters(), context.add().arg("requests>=2.10 ; sys_platform == 'win32'"), @r###" + uv_snapshot!(context.filters(), context.add().arg("requests>=2.10 ; sys_platform == 'win32'"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2450,12 +2510,13 @@ fn add_update_marker() -> Result<()> { }); // Remove `requests` - uv_snapshot!(context.filters(), context.remove().arg("requests"), @r###" + uv_snapshot!(context.filters(), context.remove().arg("requests"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] Prepared 1 package in [TIME] Uninstalled 6 packages in [TIME] @@ -2466,7 +2527,7 @@ fn add_update_marker() -> Result<()> { ~ project==0.1.0 (from file://[TEMP_DIR]/) - requests==2.31.0 - urllib3==1.23 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2513,12 +2574,13 @@ fn update_source_replace_url() -> Result<()> { "#})?; // Change the source. The existing URL should be removed. - uv_snapshot!(context.filters(), context.add().arg("requests @ git+https://github.com/psf/requests").arg("--tag=v2.32.3"), @r###" + uv_snapshot!(context.filters(), context.add().arg("requests @ git+https://github.com/psf/requests").arg("--tag=v2.32.3"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] Prepared 6 packages in [TIME] Installed 6 packages in [TIME] @@ -2528,7 +2590,7 @@ fn update_source_replace_url() -> Result<()> { + project==0.1.0 (from file://[TEMP_DIR]/) + requests==2.32.3 (from git+https://github.com/psf/requests@0e322af87745eff34caffe4df68456ebc20d9068) + urllib3==2.2.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2576,28 +2638,30 @@ fn add_inexact() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==3.7.0 + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); // Manually remove a dependency. pyproject_toml.write_str(indoc! {r#" @@ -2612,19 +2676,20 @@ fn add_inexact() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("iniconfig==2.0.0"), @r###" + uv_snapshot!(context.filters(), context.add().arg("iniconfig==2.0.0"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Uninstalled 1 package in [TIME] Installed 2 packages in [TIME] + iniconfig==2.0.0 ~ project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2685,27 +2750,29 @@ fn add_inexact() -> Result<()> { }); // Install from the lockfile without removing extraneous packages from the environment. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--inexact"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--inexact"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 2 packages in [TIME] - "###); + "#); // Install from the lockfile, performing an exact sync. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Uninstalled 3 packages in [TIME] - anyio==3.7.0 - idna==3.6 - sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -2728,35 +2795,38 @@ fn remove_registry() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==3.7.0 + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); - uv_snapshot!(context.filters(), context.remove().arg("anyio"), @r###" + uv_snapshot!(context.filters(), context.remove().arg("anyio"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] Prepared 1 package in [TIME] Uninstalled 4 packages in [TIME] @@ -2765,7 +2835,7 @@ fn remove_registry() -> Result<()> { - idna==3.6 ~ project==0.1.0 (from file://[TEMP_DIR]/) - sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2809,14 +2879,15 @@ fn remove_registry() -> Result<()> { }); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Audited 1 package in [TIME] - "###); + "#); Ok(()) } @@ -2838,12 +2909,13 @@ fn add_preserves_indentation_in_pyproject_toml() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("requests==2.31.0"), @r###" + uv_snapshot!(context.filters(), context.add().arg("requests==2.31.0"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] Prepared 8 packages in [TIME] Installed 8 packages in [TIME] @@ -2855,7 +2927,7 @@ fn add_preserves_indentation_in_pyproject_toml() -> Result<()> { + requests==2.31.0 + sniffio==1.3.1 + urllib3==2.2.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2899,12 +2971,13 @@ fn add_puts_default_indentation_in_pyproject_toml_if_not_observed() -> Result<() build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("requests==2.31.0"), @r###" + uv_snapshot!(context.filters(), context.add().arg("requests==2.31.0"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] Prepared 8 packages in [TIME] Installed 8 packages in [TIME] @@ -2916,7 +2989,7 @@ fn add_puts_default_indentation_in_pyproject_toml_if_not_observed() -> Result<() + requests==2.31.0 + sniffio==1.3.1 + urllib3==2.2.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -2961,13 +3034,14 @@ fn add_frozen() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("anyio==3.7.0").arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio==3.7.0").arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- - "###); + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3014,14 +3088,15 @@ fn add_no_sync() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("anyio==3.7.0").arg("--no-sync"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio==3.7.0").arg("--no-sync"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3136,24 +3211,26 @@ fn add_error() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("xyz"), @r###" + uv_snapshot!(context.filters(), context.add().arg("xyz"), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored × No solution found when resolving dependencies: ╰─▶ Because there are no versions of xyz and your project depends on xyz, we can conclude that your project's requirements are unsatisfiable. help: If this is intentional, run `uv add --frozen` to skip the lock and sync steps. - "###); + "#); - uv_snapshot!(context.filters(), context.add().arg("xyz").arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.add().arg("xyz").arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- - "###); + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored + "#); let lock = context.temp_dir.join("uv.lock"); assert!(!lock.exists()); @@ -3180,12 +3257,13 @@ fn add_lower_bound() -> Result<()> { "#})?; // Adding `anyio` should include a lower-bound. - uv_snapshot!(context.filters(), context.add().arg("anyio"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 4 packages in [TIME] Installed 4 packages in [TIME] @@ -3193,7 +3271,7 @@ fn add_lower_bound() -> Result<()> { + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3240,12 +3318,13 @@ fn add_lower_bound_existing() -> Result<()> { // Adding `anyio` should _not_ set a lower-bound, since it's already present (even if // unconstrained). - uv_snapshot!(context.filters(), context.add().arg("anyio"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 4 packages in [TIME] Installed 4 packages in [TIME] @@ -3253,7 +3332,7 @@ fn add_lower_bound_existing() -> Result<()> { + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3299,12 +3378,13 @@ fn add_lower_bound_raw() -> Result<()> { "#})?; // Adding `anyio` should _not_ set a lower-bound when using `--raw-sources`. - uv_snapshot!(context.filters(), context.add().arg("anyio").arg("--raw-sources"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio").arg("--raw-sources"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 4 packages in [TIME] Installed 4 packages in [TIME] @@ -3312,7 +3392,7 @@ fn add_lower_bound_raw() -> Result<()> { + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3358,12 +3438,13 @@ fn add_lower_bound_dev() -> Result<()> { "#})?; // Adding `anyio` should include a lower-bound. - uv_snapshot!(context.filters(), context.add().arg("anyio").arg("--dev"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio").arg("--dev"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 4 packages in [TIME] Installed 4 packages in [TIME] @@ -3371,7 +3452,7 @@ fn add_lower_bound_dev() -> Result<()> { + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3420,12 +3501,13 @@ fn add_lower_bound_optional() -> Result<()> { "#})?; // Adding `anyio` should include a lower-bound. - uv_snapshot!(context.filters(), context.add().arg("anyio").arg("--optional=io"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio").arg("--optional=io"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 4 packages in [TIME] Installed 4 packages in [TIME] @@ -3433,7 +3515,7 @@ fn add_lower_bound_optional() -> Result<()> { + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3542,18 +3624,19 @@ fn add_lower_bound_local() -> Result<()> { "#})?; // Adding `torch` should include a lower-bound, but no local segment. - uv_snapshot!(context.filters(), context.add().arg("local-simple-a").arg("--extra-index-url").arg(packse_index_url()).env_remove("UV_EXCLUDE_NEWER"), @r###" + uv_snapshot!(context.filters(), context.add().arg("local-simple-a").arg("--extra-index-url").arg(packse_index_url()).env_remove("UV_EXCLUDE_NEWER"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + local-simple-a==1.2.3+foo + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3647,18 +3730,19 @@ fn add_non_project() -> Result<()> { "###); // Adding `iniconfig` as a dev dependency should succeed. - uv_snapshot!(context.filters(), context.add().arg("iniconfig").arg("--dev"), @r###" + uv_snapshot!(context.filters(), context.add().arg("iniconfig").arg("--dev"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`. Resolved 1 package in [TIME] Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3726,12 +3810,13 @@ fn add_repeat() -> Result<()> { build-backend = "setuptools.build_meta" "#})?; - uv_snapshot!(context.filters(), context.add().arg("anyio"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 4 packages in [TIME] Installed 4 packages in [TIME] @@ -3739,7 +3824,7 @@ fn add_repeat() -> Result<()> { + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3763,15 +3848,16 @@ fn add_repeat() -> Result<()> { ); }); - uv_snapshot!(context.filters(), context.add().arg("anyio"), @r###" + uv_snapshot!(context.filters(), context.add().arg("anyio"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Audited 4 packages in [TIME] - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -3820,12 +3906,13 @@ fn add_requirements_file() -> Result<()> { requirements_txt .write_str("Flask==2.3.2\nanyio @ git+https://github.com/agronholm/anyio.git@4.4.0")?; - uv_snapshot!(context.filters(), context.add().arg("-r").arg("requirements.txt"), @r###" + uv_snapshot!(context.filters(), context.add().arg("-r").arg("requirements.txt"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved [N] packages in [TIME] Prepared [N] packages in [TIME] Installed [N] packages in [TIME] @@ -3840,7 +3927,7 @@ fn add_requirements_file() -> Result<()> { + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 + werkzeug==3.0.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -4420,12 +4507,13 @@ fn fail_to_add_revert_project() -> Result<()> { let filters = std::iter::once((r"exit code: 1", "exit status: 1")) .chain(context.filters()) .collect::>(); - uv_snapshot!(filters, context.add().arg("pytorch==1.0.2"), @r###" + uv_snapshot!(filters, context.add().arg("pytorch==1.0.2"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] error: Failed to prepare distributions Caused by: Failed to fetch wheel: pytorch==1.0.2 @@ -4447,7 +4535,7 @@ fn fail_to_add_revert_project() -> Result<()> { File "", line 15, in Exception: You tried to install "pytorch". The package named for PyTorch is "torch" --- - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -4491,12 +4579,13 @@ fn sorted_dependencies() -> Result<()> { ] "#})?; - uv_snapshot!(context.filters(), context.add().args(["typing-extensions", "anyio"]), @r###" + uv_snapshot!(context.filters(), context.add().args(["typing-extensions", "anyio"]), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 13 packages in [TIME] Prepared 12 packages in [TIME] Installed 12 packages in [TIME] @@ -4512,7 +4601,7 @@ fn sorted_dependencies() -> Result<()> { + sniffio==1.3.1 + typing-extensions==4.10.0 + urllib3==2.2.1 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -4560,13 +4649,14 @@ fn custom_dependencies() -> Result<()> { ] "#})?; - uv_snapshot!(context.filters(), context.add().arg("pydantic").arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.add().arg("pydantic").arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- - "###); + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; @@ -4610,18 +4700,19 @@ fn update_offset() -> Result<()> { ] "#})?; - uv_snapshot!(context.filters(), context.add().args(["typing-extensions", "iniconfig"]), @r###" + uv_snapshot!(context.filters(), context.add().args(["typing-extensions", "iniconfig"]), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + iniconfig==2.0.0 + typing-extensions==4.10.0 - "###); + "#); let pyproject_toml = fs_err::read_to_string(context.temp_dir.join("pyproject.toml"))?; diff --git a/crates/uv/tests/export.rs b/crates/uv/tests/export.rs index aca409c99ef4..80fbd98e17bb 100644 --- a/crates/uv/tests/export.rs +++ b/crates/uv/tests/export.rs @@ -30,7 +30,7 @@ fn dependency() -> Result<()> { context.lock().assert().success(); - uv_snapshot!(context.filters(), context.export(), @r###" + uv_snapshot!(context.filters(), context.export(), @r##" success: true exit_code: 0 ----- stdout ----- @@ -48,8 +48,9 @@ fn dependency() -> Result<()> { --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "##); Ok(()) } @@ -75,7 +76,7 @@ fn dependency_extra() -> Result<()> { context.lock().assert().success(); - uv_snapshot!(context.filters(), context.export(), @r###" + uv_snapshot!(context.filters(), context.export(), @r##" success: true exit_code: 0 ----- stdout ----- @@ -120,8 +121,9 @@ fn dependency_extra() -> Result<()> { --hash=sha256:90a285dc0e42ad56b34e696398b8122ee4c681833fb35b8334a095d82c56da10 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 10 packages in [TIME] - "###); + "##); Ok(()) } @@ -151,7 +153,7 @@ fn project_extra() -> Result<()> { context.lock().assert().success(); - uv_snapshot!(context.filters(), context.export(), @r###" + uv_snapshot!(context.filters(), context.export(), @r##" success: true exit_code: 0 ----- stdout ----- @@ -163,10 +165,11 @@ fn project_extra() -> Result<()> { --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "##); - uv_snapshot!(context.filters(), context.export().arg("--extra").arg("pytest"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--extra").arg("pytest"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -181,10 +184,11 @@ fn project_extra() -> Result<()> { --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "##); - uv_snapshot!(context.filters(), context.export().arg("--all-extras"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--all-extras"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -208,8 +212,9 @@ fn project_extra() -> Result<()> { --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "##); Ok(()) } @@ -235,7 +240,7 @@ fn dependency_marker() -> Result<()> { context.lock().assert().success(); - uv_snapshot!(context.filters(), context.export(), @r###" + uv_snapshot!(context.filters(), context.export(), @r##" success: true exit_code: 0 ----- stdout ----- @@ -256,8 +261,9 @@ fn dependency_marker() -> Result<()> { --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "##); Ok(()) } @@ -287,7 +293,7 @@ fn dependency_multiple_markers() -> Result<()> { context.lock().assert().success(); // Note that the `python_version > '3.11'` markers disappear due to `requires-python = ">=3.12"` - uv_snapshot!(context.filters(), context.export(), @r###" + uv_snapshot!(context.filters(), context.export(), @r##" success: true exit_code: 0 ----- stdout ----- @@ -328,8 +334,9 @@ fn dependency_multiple_markers() -> Result<()> { --hash=sha256:e6458efe29cc543e557a91e614e2b51710eba2961669329ce9c862d50c6e8e81 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 10 packages in [TIME] - "###); + "##); Ok(()) } @@ -358,7 +365,7 @@ fn dependency_conflicting_markers() -> Result<()> { context.lock().assert().success(); - uv_snapshot!(context.filters(), context.export(), @r###" + uv_snapshot!(context.filters(), context.export(), @r##" success: true exit_code: 0 ----- stdout ----- @@ -397,8 +404,9 @@ fn dependency_conflicting_markers() -> Result<()> { --hash=sha256:e6458efe29cc543e557a91e614e2b51710eba2961669329ce9c862d50c6e8e81 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] - "###); + "##); Ok(()) } @@ -445,7 +453,7 @@ fn non_root() -> Result<()> { context.lock().assert().success(); - uv_snapshot!(context.filters(), context.export().arg("--package").arg("child"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--package").arg("child"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -457,8 +465,9 @@ fn non_root() -> Result<()> { --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "##); Ok(()) } @@ -505,15 +514,16 @@ fn relative_path() -> Result<()> { // Pipe the output to requirements.txt. let file = std::fs::File::create(project.child("requirements.txt")).unwrap(); - uv_snapshot!(context.filters(), context.export().stdout(Stdio::from(file)).current_dir(&project), @r###" + uv_snapshot!(context.filters(), context.export().stdout(Stdio::from(file)).current_dir(&project), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 3 packages in [TIME] - "###); + "#); // Read the file contents. let contents = apply_filters( @@ -531,19 +541,20 @@ fn relative_path() -> Result<()> { "###); // Install the dependencies. - uv_snapshot!(context.filters(), context.pip_install().arg("--requirement").arg("requirements.txt").current_dir(&project), @r###" + uv_snapshot!(context.filters(), context.pip_install().arg("--requirement").arg("requirements.txt").current_dir(&project), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 3 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 3 packages in [TIME] Installed 3 packages in [TIME] + dependency==0.1.0 (from file://[TEMP_DIR]/dependency) + iniconfig==2.0.0 + project==0.1.0 (from file://[TEMP_DIR]/project) - "###); + "#); Ok(()) } @@ -572,7 +583,7 @@ fn dev() -> Result<()> { context.lock().assert().success(); - uv_snapshot!(context.filters(), context.export(), @r###" + uv_snapshot!(context.filters(), context.export(), @r##" success: true exit_code: 0 ----- stdout ----- @@ -593,10 +604,11 @@ fn dev() -> Result<()> { --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "##); - uv_snapshot!(context.filters(), context.export().arg("--no-dev"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--no-dev"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -608,8 +620,9 @@ fn dev() -> Result<()> { --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "##); Ok(()) } @@ -635,7 +648,7 @@ fn no_hashes() -> Result<()> { context.lock().assert().success(); - uv_snapshot!(context.filters(), context.export().arg("--no-hashes"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--no-hashes"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -647,8 +660,9 @@ fn no_hashes() -> Result<()> { sniffio==1.3.1 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "##); Ok(()) } @@ -674,7 +688,7 @@ fn output_file() -> Result<()> { context.lock().assert().success(); - uv_snapshot!(context.filters(), context.export().arg("--output-file").arg("requirements.txt"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--output-file").arg("requirements.txt"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -692,8 +706,9 @@ fn output_file() -> Result<()> { --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "##); let contents = apply_filters( fs_err::read_to_string(context.temp_dir.child("requirements.txt")).unwrap(), @@ -760,7 +775,7 @@ fn no_emit() -> Result<()> { context.lock().assert().success(); // Exclude `anyio`. - uv_snapshot!(context.filters(), context.export().arg("--no-emit-package").arg("anyio"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--no-emit-package").arg("anyio"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -779,11 +794,12 @@ fn no_emit() -> Result<()> { --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "##); // Exclude `project`. - uv_snapshot!(context.filters(), context.export().arg("--no-emit-project"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--no-emit-project"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -804,11 +820,12 @@ fn no_emit() -> Result<()> { --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "##); // Exclude `child`. - uv_snapshot!(context.filters(), context.export().arg("--no-emit-project").arg("--package").arg("child"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--no-emit-project").arg("--package").arg("child"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -819,11 +836,12 @@ fn no_emit() -> Result<()> { --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "##); // Exclude the workspace. - uv_snapshot!(context.filters(), context.export().arg("--no-emit-workspace"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--no-emit-workspace"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -843,8 +861,9 @@ fn no_emit() -> Result<()> { --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "##); // Remove the member. let pyproject_toml = context.temp_dir.child("pyproject.toml"); @@ -863,7 +882,7 @@ fn no_emit() -> Result<()> { )?; // Exclude the workspace. - uv_snapshot!(context.filters(), context.export().arg("--no-emit-workspace"), @r###" + uv_snapshot!(context.filters(), context.export().arg("--no-emit-workspace"), @r##" success: true exit_code: 0 ----- stdout ----- @@ -880,8 +899,9 @@ fn no_emit() -> Result<()> { --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "##); Ok(()) } diff --git a/crates/uv/tests/init.rs b/crates/uv/tests/init.rs index 4c7092219266..df7f4828fbf7 100644 --- a/crates/uv/tests/init.rs +++ b/crates/uv/tests/init.rs @@ -43,15 +43,16 @@ fn init() -> Result<()> { }); // Run `uv lock` in the new project. - uv_snapshot!(context.filters(), context.lock().current_dir(context.temp_dir.join("foo")), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(context.temp_dir.join("foo")), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 1 package in [TIME] - "###); + "#); let python_version = fs_err::read_to_string(context.temp_dir.join("foo").join(".python-version"))?; @@ -598,15 +599,16 @@ fn init_library_current_dir() -> Result<()> { }); // Run `uv lock` in the new project. - uv_snapshot!(context.filters(), context.lock().current_dir(&dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 1 package in [TIME] - "###); + "#); Ok(()) } @@ -662,15 +664,16 @@ fn init_application_current_dir() -> Result<()> { }); // Run `uv lock` in the new project. - uv_snapshot!(context.filters(), context.lock().current_dir(&dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 1 package in [TIME] - "###); + "#); Ok(()) } @@ -727,15 +730,16 @@ fn init_dot_args() -> Result<()> { }); // Run `uv lock` in the new project. - uv_snapshot!(context.filters(), context.lock().current_dir(&dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 1 package in [TIME] - "###); + "#); Ok(()) } @@ -823,14 +827,15 @@ fn init_workspace() -> Result<()> { }); // Run `uv lock` in the workspace. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); Ok(()) } @@ -917,14 +922,15 @@ fn init_workspace_relative_sub_package() -> Result<()> { }); // Run `uv lock` in the workspace. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); Ok(()) } @@ -1012,14 +1018,15 @@ fn init_workspace_outside() -> Result<()> { }); // Run `uv lock` in the workspace. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); Ok(()) } diff --git a/crates/uv/tests/lock.rs b/crates/uv/tests/lock.rs index d4de1bd4df60..75ff5dd6b8a1 100644 --- a/crates/uv/tests/lock.rs +++ b/crates/uv/tests/lock.rs @@ -35,14 +35,15 @@ fn lock_wheel_registry() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -103,40 +104,43 @@ fn lock_wheel_registry() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==3.7.0 + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -161,14 +165,15 @@ fn lock_sdist_registry() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock().env_remove("UV_EXCLUDE_NEWER"), @r###" + uv_snapshot!(context.filters(), context.lock().env_remove("UV_EXCLUDE_NEWER"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -201,27 +206,29 @@ fn lock_sdist_registry() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove("UV_EXCLUDE_NEWER"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove("UV_EXCLUDE_NEWER"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").env_remove("UV_EXCLUDE_NEWER"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").env_remove("UV_EXCLUDE_NEWER"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) + source-distribution==0.0.1 - "###); + "#); Ok(()) } @@ -250,14 +257,15 @@ fn lock_sdist_git() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -292,38 +300,41 @@ fn lock_sdist_git() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) + uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979) - "###); + "#); // Re-lock with a precise commit that maps to the same tag. let pyproject_toml = context.temp_dir.child("pyproject.toml"); @@ -344,14 +355,15 @@ fn lock_sdist_git() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -404,14 +416,15 @@ fn lock_sdist_git() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -464,14 +477,15 @@ fn lock_sdist_git() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -529,14 +543,15 @@ fn lock_sdist_git_subdirectory() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -571,27 +586,29 @@ fn lock_sdist_git_subdirectory() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r##" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + example-pkg-a==1 (from git+https://github.com/pypa/sample-namespace-packages.git@df7530eeb8fa0cb7dbb8ecb28363e8e36bfa2f45#subdirectory=pkg_resources/pkg_a) + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "##); Ok(()) } @@ -617,14 +634,15 @@ fn lock_sdist_git_pep508() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -659,14 +677,15 @@ fn lock_sdist_git_pep508() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Re-lock with a precise commit that maps to the same tag. let pyproject_toml = context.temp_dir.child("pyproject.toml"); @@ -684,14 +703,15 @@ fn lock_sdist_git_pep508() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -741,14 +761,15 @@ fn lock_sdist_git_pep508() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -798,14 +819,15 @@ fn lock_sdist_git_pep508() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -866,14 +888,15 @@ fn lock_sdist_git_short_rev() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -908,38 +931,41 @@ fn lock_sdist_git_short_rev() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) + uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979) - "###); + "#); Ok(()) } @@ -964,14 +990,15 @@ fn lock_wheel_url() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -1053,40 +1080,43 @@ fn lock_wheel_url() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Re-run with `--offline`. This should fail: we need network access to resolve mutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Failed to download: `anyio @ https://files.pythonhosted.org/packages/14/fd/2f20c40b45e4fb4324834aea24bd4afdf1143390242c0b33774da0e2e34f/anyio-4.3.0-py3-none-any.whl` Caused by: Network connectivity is disabled, but the requested data wasn't found in the cache for: `https://files.pythonhosted.org/packages/14/fd/2f20c40b45e4fb4324834aea24bd4afdf1143390242c0b33774da0e2e34f/anyio-4.3.0-py3-none-any.whl` - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 3 packages in [TIME] Installed 4 packages in [TIME] + anyio==4.3.0 (from https://files.pythonhosted.org/packages/14/fd/2f20c40b45e4fb4324834aea24bd4afdf1143390242c0b33774da0e2e34f/anyio-4.3.0-py3-none-any.whl) + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -1111,14 +1141,15 @@ fn lock_sdist_url() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -1198,29 +1229,31 @@ fn lock_sdist_url() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==4.3.0 (from https://files.pythonhosted.org/packages/db/4d/3970183622f0330d3c23d9b8a5f52e365e50381fd484d08e3285104333d3/anyio-4.3.0.tar.gz) + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -1248,14 +1281,15 @@ fn lock_project_extra() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -1333,41 +1367,44 @@ fn lock_project_extra() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); // Install the base dependencies from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==3.7.0 + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); // Install the extras from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--extra").arg("test"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--extra").arg("test"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); Ok(()) } @@ -1394,32 +1431,35 @@ fn lock_project_with_overrides() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 9 packages in [TIME] - "###); + "#); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 9 packages in [TIME] - "###); + "#); // Install the base dependencies from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 8 packages in [TIME] Installed 8 packages in [TIME] + blinker==1.7.0 @@ -1430,7 +1470,7 @@ fn lock_project_with_overrides() -> Result<()> { + markupsafe==2.1.5 + project==0.1.0 (from file://[TEMP_DIR]/) + werkzeug==2.3.8 - "###); + "#); Ok(()) } @@ -1458,39 +1498,42 @@ fn lock_project_with_constraints() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Install the base dependencies from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==3.7.0 + idna==3.3 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -1515,14 +1558,15 @@ fn lock_dependency_extra() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 10 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -1663,22 +1707,24 @@ fn lock_dependency_extra() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 10 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 9 packages in [TIME] Installed 9 packages in [TIME] + blinker==1.7.0 @@ -1690,7 +1736,7 @@ fn lock_dependency_extra() -> Result<()> { + project==0.1.0 (from file://[TEMP_DIR]/) + python-dotenv==1.0.1 + werkzeug==3.0.1 - "###); + "#); Ok(()) } @@ -1717,14 +1763,15 @@ fn lock_conditional_dependency_extra() -> Result<()> { let lockfile = context.temp_dir.join("uv.lock"); - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -1928,12 +1975,13 @@ fn lock_conditional_dependency_extra() -> Result<()> { // "###); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + certifi==2024.2.2 @@ -1942,7 +1990,7 @@ fn lock_conditional_dependency_extra() -> Result<()> { + project==0.1.0 (from file://[TEMP_DIR]/) + requests==2.31.0 + urllib3==2.0.7 - "###); + "#); // Validate that the extra is included on relevant Python versions. let context_38 = TestContext::new("3.8"); @@ -1951,22 +1999,24 @@ fn lock_conditional_dependency_extra() -> Result<()> { fs_err::copy(lockfile, context_38.temp_dir.join("uv.lock"))?; // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context_38.filters(), context_38.sync().arg("--frozen"), @r###" + uv_snapshot!(context_38.filters(), context_38.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 7 packages in [TIME] Installed 7 packages in [TIME] + certifi==2024.2.2 @@ -1976,7 +2026,7 @@ fn lock_conditional_dependency_extra() -> Result<()> { + pysocks==1.7.1 + requests==2.31.0 + urllib3==2.0.7 - "###); + "#); Ok(()) } @@ -2001,15 +2051,16 @@ fn lock_dependency_non_existent_extra() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 9 packages in [TIME] warning: The package `flask==3.0.2` does not have an extra named `foo` - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -2136,22 +2187,24 @@ fn lock_dependency_non_existent_extra() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 9 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 8 packages in [TIME] Installed 8 packages in [TIME] + blinker==1.7.0 @@ -2162,7 +2215,7 @@ fn lock_dependency_non_existent_extra() -> Result<()> { + markupsafe==2.1.5 + project==0.1.0 (from file://[TEMP_DIR]/) + werkzeug==3.0.1 - "###); + "#); Ok(()) } @@ -2187,14 +2240,15 @@ fn lock_upgrade_log() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -2243,14 +2297,15 @@ fn lock_upgrade_log() -> Result<()> { }); // Run with `--upgrade`; ensure that nothing is changed. - uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); // Modify the `pyproject.toml` to loosen a requirement, drop a requirement, and add a // requirement. @@ -2269,17 +2324,18 @@ fn lock_upgrade_log() -> Result<()> { )?; // Run with `--upgrade`; ensure that the updates are reported. - uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] Removed iniconfig v2.0.0 Updated markupsafe v1.1.1 -> v2.1.5 Added typing-extensions v4.10.0 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -2363,14 +2419,15 @@ fn lock_upgrade_log_multi_version() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -2426,14 +2483,15 @@ fn lock_upgrade_log_multi_version() -> Result<()> { }); // Run with `--upgrade`; ensure that nothing is changed. - uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); // Modify the `pyproject.toml` to loosen the requirement. pyproject_toml.write_str( @@ -2451,15 +2509,16 @@ fn lock_upgrade_log_multi_version() -> Result<()> { )?; // Run with `--upgrade`; ensure that `markupsafe` is upgraded. - uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Updated markupsafe v1.1.1, v2.0.0 -> v2.1.5 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -2529,14 +2588,15 @@ fn lock_preference() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -2592,14 +2652,15 @@ fn lock_preference() -> Result<()> { // Ensure that the locked version is still respected. // // Note that we do not use `deterministic!` here because the results depend on the existing lockfile. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -2637,15 +2698,16 @@ fn lock_preference() -> Result<()> { ); }); - uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Updated iniconfig v1.1.1 -> v2.0.0 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -2752,24 +2814,26 @@ fn lock_git_sha() -> Result<()> { )?; // The lockfile should be unchanged. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Relock with `--upgrade`. - uv_snapshot!(context.filters(), context.lock().arg("--upgrade-package").arg("uv-public-pypackage"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--upgrade-package").arg("uv-public-pypackage"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -2831,12 +2895,13 @@ fn lock_requires_python() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored × No solution found when resolving dependencies: ╰─▶ Because the requested Python version (>=3.7) does not satisfy Python>=3.8 and the requested Python version (>=3.7) does not satisfy Python>=3.7.9,<3.8, we can conclude that Python>=3.7.9 is incompatible. And because pygls>=1.1.0,<=1.2.1 depends on Python>=3.7.9,<4 and only pygls<=1.3.0 is available, we can conclude that all of: @@ -2854,7 +2919,7 @@ fn lock_requires_python() -> Result<()> { hint: Pre-releases are available for pygls in the requested range (e.g., 2.0.0a1), but pre-releases weren't enabled (try: `--prerelease=allow`) hint: The `requires-python` value (>=3.7) includes Python versions that are not supported by your dependencies (e.g., pygls>=1.1.0,<=1.2.1 only supports >=3.7.9, <4). Consider using a more restrictive `requires-python` value (like >=3.7.9, <4). - "###); + "#); // Require >=3.7, and allow locking to a version of `pygls` that is compatible (==1.0.1). pyproject_toml.write_str( @@ -2871,14 +2936,15 @@ fn lock_requires_python() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 10 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -3026,14 +3092,15 @@ fn lock_requires_python() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 9 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -3171,14 +3238,15 @@ fn lock_requires_python() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -3269,25 +3337,27 @@ fn lock_requires_python() -> Result<()> { .collect(); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); // Install from the lockfile. // Note we need to disable Python fetches or we'll just download 3.12 - uv_snapshot!(filters, context38.sync().arg("--frozen").arg("--no-python-downloads"), @r###" + uv_snapshot!(filters, context38.sync().arg("--frozen").arg("--no-python-downloads"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: No interpreter found for Python >=3.12 in system path - "###); + "#); Ok(()) } @@ -3316,14 +3386,15 @@ fn lock_requires_python_upper() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock().env("UV_EXCLUDE_NEWER", "2024-08-29T00:00:00Z"), @r###" + uv_snapshot!(context.filters(), context.lock().env("UV_EXCLUDE_NEWER", "2024-08-29T00:00:00Z"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -3432,14 +3503,15 @@ fn lock_requires_python_upper() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked").env("UV_EXCLUDE_NEWER", "2024-08-29T00:00:00Z"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").env("UV_EXCLUDE_NEWER", "2024-08-29T00:00:00Z"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); Ok(()) } @@ -3467,15 +3539,16 @@ fn lock_requires_python_wheels() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -3529,15 +3602,16 @@ fn lock_requires_python_wheels() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 2 packages in [TIME] - "###); + "#); // Change to ==3.11.*, which should different wheels in the lockfile. pyproject_toml.write_str( @@ -3554,15 +3628,16 @@ fn lock_requires_python_wheels() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.11.[X] interpreter at: [PYTHON-3.11] Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -3631,15 +3706,16 @@ fn lock_requires_python_wheels() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.11.[X] interpreter at: [PYTHON-3.11] Resolved 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -3667,14 +3743,15 @@ fn lock_requires_python_star() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -3757,14 +3834,15 @@ fn lock_requires_python_star() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "#); Ok(()) } @@ -3793,14 +3871,15 @@ fn lock_requires_python_pre() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -3883,14 +3962,15 @@ fn lock_requires_python_pre() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "#); Ok(()) } @@ -3917,15 +3997,16 @@ fn lock_requires_python_unbounded() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: The workspace `requires-python` value does not contain a lower bound: `<=3.12`. Set a lower bound to indicate the minimum compatible Python version (e.g., `>=3.11`). Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -3964,15 +4045,16 @@ fn lock_requires_python_unbounded() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: The workspace `requires-python` value does not contain a lower bound: `<=3.12`. Set a lower bound to indicate the minimum compatible Python version (e.g., `>=3.11`). Resolved 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -4012,14 +4094,15 @@ fn lock_python_version_marker_complement() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -4091,14 +4174,15 @@ fn lock_python_version_marker_complement() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); Ok(()) } @@ -4126,14 +4210,15 @@ fn lock_dev() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -4188,38 +4273,41 @@ fn lock_dev() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); // Install from the lockfile, excluding development dependencies. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--no-dev"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--no-dev"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + iniconfig==2.0.0 + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); // Install from the lockfile, including development dependencies (the default). - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Installed 1 package in [TIME] + typing-extensions==4.12.2 (from https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl) - "###); + "#); Ok(()) } @@ -4244,14 +4332,15 @@ fn lock_conditional_unconditional() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -4293,14 +4382,15 @@ fn lock_conditional_unconditional() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -4325,14 +4415,15 @@ fn lock_multiple_markers() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -4374,14 +4465,15 @@ fn lock_multiple_markers() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -4445,14 +4537,15 @@ fn lock_relative_and_absolute_paths() -> Result<()> { "#})?; context.temp_dir.child("c/c/__init__.py").touch()?; - uv_snapshot!(context.filters(), context.lock(), @r###" - success: true - exit_code: 0 - ----- stdout ----- + uv_snapshot!(context.filters(), context.lock(), @r#" + success: true + exit_code: 0 + ----- stdout ----- - ----- stderr ----- - Resolved 3 packages in [TIME] - "###); + ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored + Resolved 3 packages in [TIME] + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -4496,14 +4589,15 @@ fn lock_relative_and_absolute_paths() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); Ok(()) } @@ -4528,14 +4622,15 @@ fn lock_cycles() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -4681,22 +4776,24 @@ fn lock_cycles() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 11 packages in [TIME] Installed 11 packages in [TIME] + argparse==1.4.0 @@ -4710,7 +4807,7 @@ fn lock_cycles() -> Result<()> { + testtools==2.3.0 + traceback2==1.4.0 + unittest2==1.1.0 - "###); + "#); Ok(()) } @@ -4736,14 +4833,15 @@ fn lock_new_extras() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" - success: true - exit_code: 0 - ----- stdout ----- + uv_snapshot!(context.filters(), context.lock(), @r#" + success: true + exit_code: 0 + ----- stdout ----- - ----- stderr ----- - Resolved 6 packages in [TIME] - "###); + ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored + Resolved 6 packages in [TIME] + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -4839,14 +4937,15 @@ fn lock_new_extras() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "#); // Enable a new extra. pyproject_toml.write_str( @@ -4864,15 +4963,16 @@ fn lock_new_extras() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" - success: true - exit_code: 0 - ----- stdout ----- + uv_snapshot!(context.filters(), context.lock(), @r#" + success: true + exit_code: 0 + ----- stdout ----- - ----- stderr ----- - Resolved 7 packages in [TIME] - Added pysocks v1.7.1 - "###); + ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored + Resolved 7 packages in [TIME] + Added pysocks v1.7.1 + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -4982,14 +5082,15 @@ fn lock_new_extras() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "###); + "#); Ok(()) } @@ -5064,23 +5165,25 @@ fn lock_invalid_hash() -> Result<()> { "#)?; // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove("UV_EXCLUDE_NEWER"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove("UV_EXCLUDE_NEWER"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").env_remove("UV_EXCLUDE_NEWER"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").env_remove("UV_EXCLUDE_NEWER"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Failed to prepare distributions Caused by: Failed to fetch wheel: idna==3.6 Caused by: Hash mismatch for `idna==3.6` @@ -5091,7 +5194,7 @@ fn lock_invalid_hash() -> Result<()> { Computed: sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f - "###); + "#); Ok(()) } @@ -5116,14 +5219,15 @@ fn lock_resolution_mode() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -5184,26 +5288,28 @@ fn lock_resolution_mode() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Locking with `lowest-direct` should ignore the existing lockfile. - uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Ignoring existing lockfile due to change in resolution mode: `highest` vs. `lowest-direct` Resolved 4 packages in [TIME] Updated anyio v4.3.0 -> v3.0.0 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -5265,14 +5371,15 @@ fn lock_resolution_mode() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct").arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct").arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); Ok(()) } @@ -5298,15 +5405,16 @@ fn lock_requires_python_no_wheels() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored × No solution found when resolving dependencies: ╰─▶ Because dearpygui==1.9.1 has no wheels with a matching Python ABI tag and your project depends on dearpygui==1.9.1, we can conclude that your project's requirements are unsatisfiable. - "###); + "#); Ok(()) } @@ -5371,14 +5479,15 @@ fn lock_same_version_multiple_urls() -> Result<()> { Url::from_file_path(context.temp_dir.join("v2")).unwrap(), })?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -5494,14 +5603,15 @@ fn lock_same_version_multiple_urls() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "###); + "#); Ok(()) } @@ -5531,24 +5641,26 @@ fn lock_unsafe_lowest() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct").arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest-direct").arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -5598,15 +5710,16 @@ fn lock_exclusion() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock().current_dir(&child), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&child), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(child.join("uv.lock")).unwrap(); @@ -5641,14 +5754,15 @@ fn lock_exclusion() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Unable to find lockfile at `uv.lock`. To create a lockfile, run `uv lock` or `uv sync`. - "###); + "#); Ok(()) } @@ -5726,15 +5840,16 @@ fn lock_dev_transitive() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock().current_dir(&bar), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&bar), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 5 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(bar.join("uv.lock")).unwrap(); @@ -5862,14 +5977,15 @@ fn lock_redact_https() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock().arg("--index-url").arg("https://public:heron@pypi-proxy.fly.dev/basic-auth/simple"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--index-url").arg("https://public:heron@pypi-proxy.fly.dev/basic-auth/simple"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -5909,92 +6025,99 @@ fn lock_redact_https() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Installing from the lockfile should fail without credentials. Omit the root, so that we fail // when installing `iniconfig`, rather than when building `foo`. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--index-url").arg("https://pypi-proxy.fly.dev/basic-auth/simple").arg("--no-install-project"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--index-url").arg("https://pypi-proxy.fly.dev/basic-auth/simple").arg("--no-install-project"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Failed to prepare distributions Caused by: Failed to fetch wheel: iniconfig==2.0.0 Caused by: HTTP status client error (401 Unauthorized) for url (https://pypi-proxy.fly.dev/basic-auth/files/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl) - "###); + "#); // Installing from the lockfile should fail without an index. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--no-install-project"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--no-install-project"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Failed to prepare distributions Caused by: Failed to fetch wheel: iniconfig==2.0.0 Caused by: HTTP status client error (401 Unauthorized) for url (https://pypi-proxy.fly.dev/basic-auth/files/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl) - "###); + "#); // Installing from the lockfile should succeed when credentials are included on the command-line. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--index-url").arg("https://public:heron@pypi-proxy.fly.dev/basic-auth/simple"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--index-url").arg("https://public:heron@pypi-proxy.fly.dev/basic-auth/simple"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + foo==0.1.0 (from file://[TEMP_DIR]/) + iniconfig==2.0.0 - "###); + "#); // A subsequent sync will succeed because the credentials are in uv's request cache. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--reinstall"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--reinstall"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Uninstalled 2 packages in [TIME] Installed 2 packages in [TIME] ~ foo==0.1.0 (from file://[TEMP_DIR]/) ~ iniconfig==2.0.0 - "###); + "#); // Installing without credentials will fail without a cache. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--reinstall").arg("--no-cache").arg("--no-install-project"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--reinstall").arg("--no-cache").arg("--no-install-project"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Failed to prepare distributions Caused by: Failed to fetch wheel: iniconfig==2.0.0 Caused by: HTTP status client error (401 Unauthorized) for url (https://pypi-proxy.fly.dev/basic-auth/files/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl) - "###); + "#); // Installing with credentials from with `UV_INDEX_URL` should succeed. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--reinstall").arg("--no-cache").env("UV_INDEX_URL", "https://public:heron@pypi-proxy.fly.dev/basic-auth/simple"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--reinstall").arg("--no-cache").env("UV_INDEX_URL", "https://public:heron@pypi-proxy.fly.dev/basic-auth/simple"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Uninstalled 2 packages in [TIME] Installed 2 packages in [TIME] ~ foo==0.1.0 (from file://[TEMP_DIR]/) ~ iniconfig==2.0.0 - "###); + "#); let pyproject_toml = context.temp_dir.child("pyproject.toml"); pyproject_toml.write_str( @@ -6016,18 +6139,19 @@ fn lock_redact_https() -> Result<()> { // Installing from the lockfile should succeed when credentials are included via // `pyproject.toml`. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--reinstall").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").arg("--reinstall").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Uninstalled 2 packages in [TIME] Installed 2 packages in [TIME] ~ foo==0.1.0 (from file://[TEMP_DIR]/) ~ iniconfig==2.0.0 - "###); + "#); Ok(()) } @@ -6059,14 +6183,15 @@ fn lock_redact_git() -> Result<()> { token = token, })?; - uv_snapshot!(&filters, context.lock(), @r###" + uv_snapshot!(&filters, context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -6101,27 +6226,29 @@ fn lock_redact_git() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(&filters, context.lock().arg("--locked"), @r###" + uv_snapshot!(&filters, context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(&filters, context.sync().arg("--frozen"), @r###" + uv_snapshot!(&filters, context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + foo==0.1.0 (from file://[TEMP_DIR]/) + uv-private-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-private-pypackage@d780faf0ac91257d4d5a4f0c5a0e4509608c0071) - "###); + "#); Ok(()) } @@ -6149,14 +6276,15 @@ fn lock_relative_index() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -6195,27 +6323,29 @@ fn lock_relative_index() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + foo==0.1.0 (from file://[TEMP_DIR]/) + iniconfig==2.0.0 - "###); + "#); Ok(()) } @@ -6262,14 +6392,15 @@ fn lock_no_sources() -> Result<()> { )?; // Lock the root package with `tool.uv.sources` enabled. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -6319,28 +6450,30 @@ fn lock_no_sources() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); // Lock the root package with `tool.uv.sources` disabled. - uv_snapshot!(context.filters(), context.lock().arg("--no-sources"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--no-sources"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Updated anyio v0.1.0 -> v4.3.0 Added idna v3.6 Removed iniconfig v2.0.0 Added sniffio v1.3.1 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -6401,14 +6534,15 @@ fn lock_no_sources() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--no-sources").arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--no-sources").arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); Ok(()) } @@ -6484,18 +6618,19 @@ fn lock_migrate() -> Result<()> { "# )?; - uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&context.temp_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Added anyio v4.3.0 Added idna v3.6 Added project v0.1.0 Added sniffio v1.3.1 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -6580,24 +6715,26 @@ fn lock_upgrade_package() -> Result<()> { )?; // Lock the root package. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -6678,25 +6815,27 @@ fn lock_upgrade_package() -> Result<()> { )?; // Upgrade `anyio`, but nothing else. - uv_snapshot!(context.filters(), context.lock().arg("--upgrade-package").arg("anyio"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--upgrade-package").arg("anyio"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Updated anyio v2.0.0 -> v4.3.0 - "###); + "#); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -6761,25 +6900,27 @@ fn lock_upgrade_package() -> Result<()> { }); // Upgrade everything. - uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--upgrade"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Updated idna v3.0 -> v3.6 - "###); + "#); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -6909,17 +7050,18 @@ fn lock_warn_missing_transitive_lower_bounds() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--resolution").arg("lowest"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] warning: The transitive dependency `packaging` is unpinned. Consider setting a lower bound with a constraint when using `--resolution-strategy lowest` to avoid using outdated versions. warning: The transitive dependency `colorama` is unpinned. Consider setting a lower bound with a constraint when using `--resolution-strategy lowest` to avoid using outdated versions. warning: The transitive dependency `iniconfig` is unpinned. Consider setting a lower bound with a constraint when using `--resolution-strategy lowest` to avoid using outdated versions. - "###); + "#); Ok(()) } @@ -6968,15 +7110,16 @@ fn lock_find_links_local_wheel() -> Result<()> { context.temp_dir.join("links/").portable_display(), })?; - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(workspace.join("uv.lock")).unwrap(); @@ -7014,30 +7157,32 @@ fn lock_find_links_local_wheel() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: .venv Prepared 1 package in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/workspace) + tqdm==1000.0.0 - "###); + "#); Ok(()) } @@ -7086,15 +7231,16 @@ fn lock_find_links_local_sdist() -> Result<()> { context.temp_dir.join("links/").portable_display(), })?; - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(workspace.join("uv.lock")).unwrap(); @@ -7130,30 +7276,32 @@ fn lock_find_links_local_sdist() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: .venv Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/workspace) + tqdm==999.0.0 - "###); + "#); Ok(()) } @@ -7182,14 +7330,15 @@ fn lock_find_links_http_wheel() -> Result<()> { build_vendor_links_url() })?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -7228,27 +7377,29 @@ fn lock_find_links_http_wheel() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 1 package in [TIME] Installed 2 packages in [TIME] + packaging==23.2 + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); Ok(()) } @@ -7277,14 +7428,15 @@ fn lock_find_links_http_sdist() -> Result<()> { build_vendor_links_url() })?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -7323,27 +7475,29 @@ fn lock_find_links_http_sdist() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 1 package in [TIME] Installed 2 packages in [TIME] + packaging==23.2 + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); Ok(()) } @@ -7406,14 +7560,15 @@ fn lock_local_index() -> Result<()> { Url::from_directory_path(&root).unwrap().as_str() })?; - uv_snapshot!(context.filters(), context.lock().env_remove("UV_EXCLUDE_NEWER"), @r###" + uv_snapshot!(context.filters(), context.lock().env_remove("UV_EXCLUDE_NEWER"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -7454,27 +7609,29 @@ fn lock_local_index() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove("UV_EXCLUDE_NEWER"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove("UV_EXCLUDE_NEWER"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").env_remove("UV_EXCLUDE_NEWER"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").env_remove("UV_EXCLUDE_NEWER"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 1 package in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) + tqdm==1000.0.0 - "###); + "#); Ok(()) } @@ -7503,14 +7660,15 @@ fn lock_sources_url() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -7583,22 +7741,24 @@ fn lock_sources_url() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 5 packages in [TIME] Installed 5 packages in [TIME] + anyio==4.3.0 @@ -7606,7 +7766,7 @@ fn lock_sources_url() -> Result<()> { + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 + workspace==0.1.0 (from https://github.com/user-attachments/files/16592193/workspace.zip) - "###); + "#); Ok(()) } @@ -7643,14 +7803,15 @@ fn lock_sources_archive() -> Result<()> { Url::from_file_path(&workspace_archive).unwrap(), })?; - uv_snapshot!( context.lock(), @r###" + uv_snapshot!( context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=/home/aditya/data/mywork/HarkiratCohort/rust/uv/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -7722,22 +7883,24 @@ fn lock_sources_archive() -> Result<()> { // }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 5 packages in [TIME] Installed 5 packages in [TIME] + anyio==4.3.0 @@ -7745,7 +7908,7 @@ fn lock_sources_archive() -> Result<()> { + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 + workspace==0.1.0 (from file://[TEMP_DIR]/workspace.zip) - "###); + "#); Ok(()) } @@ -7793,14 +7956,15 @@ fn lock_sources_source_tree() -> Result<()> { context.temp_dir.child("workspace").portable_display() })?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -7846,28 +8010,30 @@ fn lock_sources_source_tree() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 3 packages in [TIME] Installed 3 packages in [TIME] + anyio==0.1.0 (from file://[TEMP_DIR]/workspace/anyio) + project==0.1.0 (from file://[TEMP_DIR]/) + workspace==0.1.0 (from file://[TEMP_DIR]/workspace) - "###); + "#); Ok(()) } @@ -7933,14 +8099,15 @@ fn lock_editable() -> Result<()> { library.child("src/__init__.py").touch()?; // First, lock without marking the dependency as editable from either member. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -7992,14 +8159,15 @@ fn lock_editable() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); // Next, mark the dependency as editable from one member. leaf.child("pyproject.toml").write_str(indoc! {r#" @@ -8016,14 +8184,15 @@ fn lock_editable() -> Result<()> { library = { path = "../../library", editable = true } "#})?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -8075,27 +8244,29 @@ fn lock_editable() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + library==0.1.0 (from file://[TEMP_DIR]/library) + workspace==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); Ok(()) } @@ -8187,15 +8358,16 @@ fn lock_mixed_extras() -> Result<()> { leaf2.child("src/__init__.py").touch()?; // Lock the first workspace. - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace1), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace1), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 6 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(workspace1.join("uv.lock")).unwrap(); @@ -8291,24 +8463,26 @@ fn lock_mixed_extras() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked").current_dir(&workspace1), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").current_dir(&workspace1), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 6 packages in [TIME] - "###); + "#); // Install from the lockfile. This should include the first-party packages, but no third-party // packages, since they all rely on extras. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&workspace1), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&workspace1), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: .venv Prepared 4 packages in [TIME] @@ -8317,21 +8491,22 @@ fn lock_mixed_extras() -> Result<()> { + leaf2==0.1.0 (from file://[TEMP_DIR]/workspace2/packages/leaf2) + workspace1==0.1.0 (from file://[TEMP_DIR]/workspace1) + workspace2==0.1.0 (from file://[TEMP_DIR]/workspace2) - "###); + "#); // Install from the lockfile with the `async` extra. This should include `typing-extensions`, // but not `iniconfig` or `packaging`, since we're installing the root package, whereas // `iniconfig` is an extra on another package, and `packaging` is an extra in another workspace. - uv_snapshot!(context.filters(), context.sync().arg("--extra").arg("async").arg("--frozen").current_dir(&workspace1), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--extra").arg("async").arg("--frozen").current_dir(&workspace1), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 1 package in [TIME] Installed 1 package in [TIME] + typing-extensions==4.10.0 - "###); + "#); Ok(()) } @@ -8385,15 +8560,16 @@ fn lock_transitive_extra() -> Result<()> { leaf.child("src/__init__.py").touch()?; // Lock the workspace. - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(workspace.join("uv.lock")).unwrap(); @@ -8470,45 +8646,48 @@ fn lock_transitive_extra() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 4 packages in [TIME] - "###); + "#); // Install from the lockfile. This should include the first-party packages, but no third-party // packages, since they all rely on extras. - uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen").current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: .venv Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + leaf==0.1.0 (from file://[TEMP_DIR]/workspace/packages/leaf) + workspace==0.1.0 (from file://[TEMP_DIR]/workspace) - "###); + "#); // Install from the lockfile with the `async` extra. This should include `typing-extensions` // and `iniconfig`. - uv_snapshot!(context.filters(), context.sync().arg("--extra").arg("async").arg("--frozen").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--extra").arg("async").arg("--frozen").current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + iniconfig==2.0.0 + typing-extensions==4.10.0 - "###); + "#); Ok(()) } @@ -8535,16 +8714,17 @@ fn lock_mismatched_sources() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Failed to build: `project @ file://[TEMP_DIR]/` Caused by: Failed to parse entry for: `uv-public-pypackage` Caused by: Can't combine URLs from both `project.dependencies` and `tool.uv.sources` - "###); + "#); Ok(()) } @@ -8575,14 +8755,15 @@ fn lock_mismatched_versions() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -8617,27 +8798,29 @@ fn lock_mismatched_versions() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) + uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979) - "###); + "#); Ok(()) } @@ -8666,15 +8849,16 @@ fn unconditional_overlapping_marker_disjoint_version_constraints() -> Result<()> "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored × No solution found when resolving dependencies: ╰─▶ Because only datasets<2.19 is available and your project depends on datasets>=2.19, we can conclude that your project's requirements are unsatisfiable. - "###); + "#); Ok(()) } @@ -8699,14 +8883,15 @@ fn lock_change_index() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock().arg("--index-url").arg("https://public:heron@pypi-proxy.fly.dev/basic-auth/simple"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--index-url").arg("https://public:heron@pypi-proxy.fly.dev/basic-auth/simple"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -8745,14 +8930,15 @@ fn lock_change_index() -> Result<()> { }); // Re-run against PyPI. - uv_snapshot!(context.filters(), context.lock().arg("--index-url").arg("https://pypi.org/simple"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--index-url").arg("https://pypi.org/simple"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -8791,14 +8977,15 @@ fn lock_change_index() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -8846,14 +9033,15 @@ fn lock_remove_member() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -8931,14 +9119,15 @@ fn lock_remove_member() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); // Remove the member. pyproject_toml.write_str( @@ -8952,29 +9141,31 @@ fn lock_remove_member() -> Result<()> { )?; // Re-run with `--locked`. This should fail. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. - "###); + "#); // Re-run without `--locked`. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] Removed anyio v4.3.0 Removed idna v3.6 Removed leaf v0.1.0 Removed sniffio v1.3.1 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -9028,14 +9219,15 @@ fn lock_add_member() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -9059,14 +9251,15 @@ fn lock_add_member() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] - "###); + "#); // Create a workspace member. let leaf = context.temp_dir.child("leaf"); @@ -9103,53 +9296,57 @@ fn lock_add_member() -> Result<()> { )?; // Re-run with `--locked`. This should fail. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. - "###); + "#); // Re-run with `--offline`. This should also fail, during the resolve phase. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored × No solution found when resolving dependencies: ╰─▶ Because anyio was not found in the cache and leaf depends on anyio>3, we can conclude that leaf's requirements are unsatisfiable. And because your workspace requires leaf, we can conclude that your workspace's requirements are unsatisfiable. hint: Packages were unavailable because the network was disabled. When the network is disabled, registry packages may only be read from the cache. - "###); + "#); // Re-run without `--locked`. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] Added anyio v4.3.0 Added idna v3.6 Added leaf v0.1.0 Added sniffio v1.3.1 - "###); + "#); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -9249,14 +9446,15 @@ fn lock_redundant_add_member() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -9317,14 +9515,15 @@ fn lock_redundant_add_member() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Add a dependency that's already included in the lockfile. pyproject_toml.write_str( @@ -9346,25 +9545,27 @@ fn lock_redundant_add_member() -> Result<()> { // Re-run with `--locked`. This will fail, though in theory it could succeed, since the current // _resolution_ satisfies the requirements, even if the inputs are not identical - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. - "###); + "#); // Re-run without `--locked`. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -9452,14 +9653,15 @@ fn lock_new_constraints() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -9520,14 +9722,15 @@ fn lock_new_constraints() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Add a constraint. pyproject_toml.write_str( @@ -9550,26 +9753,28 @@ fn lock_new_constraints() -> Result<()> { )?; // Re-run with `--locked`. This should fail. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. - "###); + "#); // Re-run without `--locked`. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Updated anyio v4.3.0 -> v4.2.0 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -9670,14 +9875,15 @@ fn lock_remove_member_non_project() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -9743,14 +9949,15 @@ fn lock_remove_member_non_project() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Remove the member. pyproject_toml.write_str( @@ -9761,31 +9968,33 @@ fn lock_remove_member_non_project() -> Result<()> { )?; // Re-run with `--locked`. This should fail. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`. Resolved in [TIME] error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. - "###); + "#); // Re-run without `--locked`. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`. Resolved in [TIME] Removed anyio v4.3.0 Removed idna v3.6 Removed leaf v0.1.0 Removed sniffio v1.3.1 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -9828,14 +10037,15 @@ fn lock_rename_project() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -9874,14 +10084,15 @@ fn lock_rename_project() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Rename the project. pyproject_toml.write_str( @@ -9899,27 +10110,29 @@ fn lock_rename_project() -> Result<()> { )?; // Re-run with `--locked`. This should fail. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. - "###); + "#); // Re-run without `--locked`. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Removed project v0.1.0 Added renamed v0.1.0 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -10031,14 +10244,15 @@ fn lock_missing_metadata() -> Result<()> { "#)?; // Re-locking should add `[package.metadata]`. - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -10122,14 +10336,15 @@ fn lock_reorder() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -10203,14 +10418,15 @@ fn lock_reorder() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); // Reorder the dependencies. pyproject_toml.write_str( @@ -10228,14 +10444,15 @@ fn lock_reorder() -> Result<()> { )?; // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "###); + "#); Ok(()) } @@ -10279,14 +10496,15 @@ fn lock_narrowed_python_version() -> Result<()> { let lockfile = context.temp_dir.join("uv.lock"); - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(&lockfile).unwrap(); @@ -10344,14 +10562,15 @@ fn lock_narrowed_python_version() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); Ok(()) } @@ -10381,14 +10600,15 @@ fn lock_exclude_unnecessary_python_forks() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -10456,14 +10676,15 @@ fn lock_exclude_unnecessary_python_forks() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); Ok(()) } @@ -10491,14 +10712,15 @@ fn lock_constrained_environment() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -10599,25 +10821,27 @@ fn lock_constrained_environment() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "###); + "#); // Rewrite with a list, rather than a string. let pyproject_toml = context.temp_dir.child("pyproject.toml"); @@ -10639,14 +10863,15 @@ fn lock_constrained_environment() -> Result<()> { )?; // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "###); + "#); // Re-lock without the environment constraint. let pyproject_toml = context.temp_dir.child("pyproject.toml"); @@ -10665,27 +10890,29 @@ fn lock_constrained_environment() -> Result<()> { )?; // Re-run with `--locked`. This should fail. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Ignoring existing lockfile due to change in supported environments Resolved 8 packages in [TIME] error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. - "###); + "#); - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Ignoring existing lockfile due to change in supported environments Resolved 8 packages in [TIME] Added colorama v0.4.6 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -10818,16 +11045,17 @@ fn lock_overlapping_environment() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Supported environments must be disjoint, but the following markers overlap: `platform_system != 'Windows'` and `python_full_version >= '3.11'`. hint: replace `python_full_version >= '3.11'` with `python_full_version >= '3.11' and platform_system == 'Windows'`. - "###); + "#); Ok(()) } @@ -10851,15 +11079,16 @@ fn lock_non_project_fork() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.10`. Resolved 6 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -10958,27 +11187,29 @@ fn lock_non_project_fork() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.10`. Resolved 6 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.10`. Resolved 6 packages in [TIME] - "###); + "#); // Add `iniconfig`. pyproject_toml.write_str( @@ -10995,23 +11226,25 @@ fn lock_non_project_fork() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.10`. Resolved 7 packages in [TIME] Added iniconfig v2.0.0 - "###); + "#); - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + anyio==4.3.0 @@ -11020,7 +11253,7 @@ fn lock_non_project_fork() -> Result<()> { + iniconfig==2.0.0 + sniffio==1.3.1 + typing-extensions==4.10.0 - "###); + "#); Ok(()) } @@ -11041,15 +11274,16 @@ fn lock_non_project_conditional() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`. Resolved 3 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -11102,27 +11336,29 @@ fn lock_non_project_conditional() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`. Resolved 3 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`. Resolved 3 packages in [TIME] - "###); + "#); Ok(()) } @@ -11149,14 +11385,15 @@ fn lock_dropped_dev_extra() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -11208,38 +11445,41 @@ fn lock_dropped_dev_extra() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + coverage==7.4.4 + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); Ok(()) } @@ -11267,14 +11507,15 @@ fn lock_trailing_slash() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -11335,40 +11576,43 @@ fn lock_trailing_slash() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==3.7.0 + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -11399,14 +11643,15 @@ fn lock_explicit_virtual_project() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -11552,33 +11797,36 @@ fn lock_explicit_virtual_project() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] - "###); + "#); // Install from the lockfile. The virtual project should _not_ be installed. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 9 packages in [TIME] Installed 9 packages in [TIME] + anyio==4.3.0 @@ -11590,7 +11838,7 @@ fn lock_explicit_virtual_project() -> Result<()> { + pathspec==0.12.1 + platformdirs==4.2.0 + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -11616,14 +11864,15 @@ fn lock_implicit_virtual_project() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -11769,33 +12018,36 @@ fn lock_implicit_virtual_project() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] - "###); + "#); // Install from the lockfile. The virtual project should _not_ be installed. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 9 packages in [TIME] Installed 9 packages in [TIME] + anyio==4.3.0 @@ -11807,7 +12059,7 @@ fn lock_implicit_virtual_project() -> Result<()> { + pathspec==0.12.1 + platformdirs==4.2.0 + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -11843,14 +12095,15 @@ fn lock_implicit_virtual_path() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -11935,40 +12188,43 @@ fn lock_implicit_virtual_path() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "###); + "#); // Install from the lockfile. The virtual project should _not_ be installed. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==4.3.0 + idna==3.6 + iniconfig==2.0.0 + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -11995,14 +12251,15 @@ fn lock_conflicting_environment() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Environment markers `python_full_version < '3.11'` don't overlap with Python requirement `>=3.12` - "###); + "#); Ok(()) } @@ -12029,14 +12286,15 @@ fn lock_split_python_environment() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -12098,25 +12356,27 @@ fn lock_split_python_environment() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -12143,14 +12403,15 @@ fn lock_python_upper_bound() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 18 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -12470,25 +12731,27 @@ fn lock_python_upper_bound() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 18 packages in [TIME] - "###); + "#); // Re-run with `--offline`. We shouldn't need a network connection to validate an // already-correct lockfile with immutable metadata. - uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--offline").arg("--no-cache"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 18 packages in [TIME] - "###); + "#); Ok(()) } @@ -12512,14 +12775,15 @@ fn lock_strip_fragment() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -12557,27 +12821,29 @@ fn lock_strip_fragment() -> Result<()> { }); // Re-run with `--locked`. - uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "###); + "#); // Install from the lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + iniconfig==2.0.0 (from https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl) + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); Ok(()) } @@ -12602,29 +12868,31 @@ fn lock_request_requires_python() -> Result<()> { )?; // Request a version that conflicts with `--requires-python`. - uv_snapshot!(context.filters(), context.lock().arg("--python").arg("3.12"), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--python").arg("3.12"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] error: The requested interpreter resolved to Python 3.12.[X], which is incompatible with the project's Python requirement: `>=3.8, <=3.10` - "###); + "#); // Add a `.python-version` file that conflicts. let python_version = context.temp_dir.child(".python-version"); python_version.write_str("3.12")?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] error: The Python request from `.python-version` resolved to Python 3.12.[X], which is incompatible with the project's Python requirement: `>=3.8, <=3.10` - "###); + "#); Ok(()) } diff --git a/crates/uv/tests/lock_scenarios.rs b/crates/uv/tests/lock_scenarios.rs index 2cdb24da9287..2090e587e113 100644 --- a/crates/uv/tests/lock_scenarios.rs +++ b/crates/uv/tests/lock_scenarios.rs @@ -67,14 +67,15 @@ fn fork_allows_non_conflicting_non_overlapping_dependencies() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -184,14 +185,15 @@ fn fork_allows_non_conflicting_repeated_dependencies() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -283,14 +285,15 @@ fn fork_basic() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -417,12 +420,13 @@ fn conflict_in_fork() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored × No solution found when resolving dependencies for split (sys_platform == 'darwin'): ╰─▶ Because only package-b==1.0.0 is available and package-b==1.0.0 depends on package-d==1, we can conclude that all versions of package-b depend on package-d==1. And because package-c==1.0.0 depends on package-d==2 and only package-c==1.0.0 is available, we can conclude that all versions of package-b and all versions of package-c are incompatible. @@ -431,7 +435,7 @@ fn conflict_in_fork() -> Result<()> { package-a{sys_platform == 'darwin'}==1.0.0 package-a{sys_platform == 'darwin'}>2 and your project depends on package-a{sys_platform == 'darwin'}<2, we can conclude that your project's requirements are unsatisfiable. - "### + "# ); Ok(()) @@ -485,15 +489,16 @@ fn fork_conflict_unsatisfiable() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored × No solution found when resolving dependencies: ╰─▶ Because your project depends on package-a>=2 and package-a<2, we can conclude that your project's requirements are unsatisfiable. - "### + "# ); Ok(()) @@ -568,14 +573,15 @@ fn fork_filter_sibling_dependencies() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -746,14 +752,15 @@ fn fork_upgrade() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -866,14 +873,15 @@ fn fork_incomplete_markers() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -1019,14 +1027,15 @@ fn fork_marker_accrue() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -1152,15 +1161,16 @@ fn fork_marker_disjoint() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored × No solution found when resolving dependencies for split (sys_platform == 'linux'): ╰─▶ Because your project depends on package-a{sys_platform == 'linux'}>=2 and package-a{sys_platform == 'linux'}<2, we can conclude that your project's requirements are unsatisfiable. - "### + "# ); Ok(()) @@ -1222,14 +1232,15 @@ fn fork_marker_inherit_combined_allowed() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -1402,14 +1413,15 @@ fn fork_marker_inherit_combined_disallowed() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -1571,14 +1583,15 @@ fn fork_marker_inherit_combined() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -1733,14 +1746,15 @@ fn fork_marker_inherit_isolated() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -1881,14 +1895,15 @@ fn fork_marker_inherit_transitive() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -2037,14 +2052,15 @@ fn fork_marker_inherit() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -2175,14 +2191,15 @@ fn fork_marker_limited_inherit() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -2330,14 +2347,15 @@ fn fork_marker_selection() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -2485,14 +2503,15 @@ fn fork_marker_track() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -2637,14 +2656,15 @@ fn fork_non_fork_marker_transitive() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -2771,16 +2791,17 @@ fn fork_non_local_fork_marker_direct() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored × No solution found when resolving dependencies: ╰─▶ Because package-b{sys_platform == 'darwin'}==1.0.0 depends on package-c>=2.0.0 and package-a{sys_platform == 'linux'}==1.0.0 depends on package-c<2.0.0, we can conclude that package-a{sys_platform == 'linux'}==1.0.0 and package-b{sys_platform == 'darwin'}==1.0.0 are incompatible. And because your project depends on package-a{sys_platform == 'linux'}==1.0.0 and package-b{sys_platform == 'darwin'}==1.0.0, we can conclude that your project's requirements are unsatisfiable. - "### + "# ); Ok(()) @@ -2843,12 +2864,13 @@ fn fork_non_local_fork_marker_transitive() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored × No solution found when resolving dependencies: ╰─▶ Because package-b==1.0.0 depends on package-c{sys_platform == 'darwin'}>=2.0.0 and only package-c{sys_platform == 'darwin'}<=2.0.0 is available, we can conclude that package-b==1.0.0 depends on package-c{sys_platform == 'darwin'}==2.0.0. And because only the following versions of package-c{sys_platform == 'linux'} are available: @@ -2856,7 +2878,7 @@ fn fork_non_local_fork_marker_transitive() -> Result<()> { package-c{sys_platform == 'linux'}>2.0.0 and package-a==1.0.0 depends on package-c{sys_platform == 'linux'}<2.0.0, we can conclude that package-a==1.0.0 and package-b==1.0.0 are incompatible. And because your project depends on package-a==1.0.0 and package-b==1.0.0, we can conclude that your project's requirements are unsatisfiable. - "### + "# ); Ok(()) @@ -2936,14 +2958,15 @@ fn fork_overlapping_markers_basic() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -3103,14 +3126,15 @@ fn preferences_dependent_forking_bistable() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -3339,14 +3363,15 @@ fn preferences_dependent_forking_conflicting() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "### + "# ); Ok(()) @@ -3481,14 +3506,15 @@ fn preferences_dependent_forking_tristable() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -3764,14 +3790,15 @@ fn preferences_dependent_forking() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -3938,14 +3965,15 @@ fn fork_remaining_universe_partitioning() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -4090,14 +4118,15 @@ fn fork_requires_python_full_prerelease() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -4174,14 +4203,15 @@ fn fork_requires_python_full() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -4262,14 +4292,15 @@ fn fork_requires_python_patch_overlap() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -4355,14 +4386,15 @@ fn fork_requires_python() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 1 package in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -4438,14 +4470,15 @@ fn unreachable_package() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -4539,14 +4572,15 @@ fn unreachable_wheels() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -4656,14 +4690,15 @@ fn requires_python_wheels() -> Result<()> { let mut cmd = context.lock(); cmd.env_remove("UV_EXCLUDE_NEWER"); cmd.arg("--index-url").arg(packse_index_url()); - uv_snapshot!(filters, cmd, @r###" + uv_snapshot!(filters, cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; diff --git a/crates/uv/tests/pip_install.rs b/crates/uv/tests/pip_install.rs index edd43681985d..77c409d6bb05 100644 --- a/crates/uv/tests/pip_install.rs +++ b/crates/uv/tests/pip_install.rs @@ -1048,17 +1048,18 @@ fn install_editable_bare_cli() { uv_snapshot!(context.filters(), context.pip_install() .arg("-e") .arg("black_editable") - .current_dir(&packages_dir), @r###" + .current_dir(&packages_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 1 package in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 1 package in [TIME] Installed 1 package in [TIME] + black==0.1.0 (from file://[WORKSPACE]/scripts/packages/black_editable) - "### + "# ); } @@ -1074,17 +1075,18 @@ fn install_editable_bare_requirements_txt() -> Result<()> { uv_snapshot!(context.filters(), context.pip_install() .arg("-r") .arg(requirements_txt.path()) - .current_dir(&packages_dir), @r###" + .current_dir(&packages_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 1 package in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 1 package in [TIME] Installed 1 package in [TIME] + black==0.1.0 (from file://[WORKSPACE]/scripts/packages/black_editable) - "### + "# ); Ok(()) @@ -3072,20 +3074,21 @@ requires-python = ">=3.8" uv_snapshot!(context.filters(), context.pip_install() .arg("example @ .") - .current_dir(editable_dir.path()), @r###" + .current_dir(editable_dir.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==4.0.0 + example==0.0.0 (from file://[TEMP_DIR]/editable) + idna==3.6 + sniffio==1.3.1 - "### + "# ); // Installing again should be a no-op. @@ -3116,20 +3119,21 @@ requires-python = ">=3.8" // Installing again should update the package. uv_snapshot!(context.filters(), context.pip_install() .arg("example @ .") - .current_dir(editable_dir.path()), @r###" + .current_dir(editable_dir.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 2 packages in [TIME] Uninstalled 2 packages in [TIME] Installed 2 packages in [TIME] - anyio==4.0.0 + anyio==3.7.1 ~ example==0.0.0 (from file://[TEMP_DIR]/editable) - "### + "# ); Ok(()) @@ -3163,20 +3167,21 @@ fn invalidate_path_on_cache_key() -> Result<()> { uv_snapshot!(context.filters(), context.pip_install() .arg("example @ .") - .current_dir(editable_dir.path()), @r###" + .current_dir(editable_dir.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==4.0.0 + example==0.0.0 (from file://[TEMP_DIR]/editable) + idna==3.6 + sniffio==1.3.1 - "### + "# ); // Installing again should be a no-op. @@ -3198,18 +3203,19 @@ fn invalidate_path_on_cache_key() -> Result<()> { // Installing again should update the package. uv_snapshot!(context.filters(), context.pip_install() .arg("example @ .") - .current_dir(editable_dir.path()), @r###" + .current_dir(editable_dir.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ example==0.0.0 (from file://[TEMP_DIR]/editable) - "### + "# ); // Modify the requirements file. @@ -3218,18 +3224,19 @@ fn invalidate_path_on_cache_key() -> Result<()> { // Installing again should update the package. uv_snapshot!(context.filters(), context.pip_install() .arg("example @ .") - .current_dir(editable_dir.path()), @r###" + .current_dir(editable_dir.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ example==0.0.0 (from file://[TEMP_DIR]/editable) - "### + "# ); // Modify the `pyproject.toml` file (but not in a meaningful way). @@ -3280,18 +3287,19 @@ fn invalidate_path_on_cache_key() -> Result<()> { // Installing again should update the package. uv_snapshot!(context.filters(), context.pip_install() .arg("example @ .") - .current_dir(editable_dir.path()), @r###" + .current_dir(editable_dir.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ example==0.0.0 (from file://[TEMP_DIR]/editable) - "### + "# ); // Write a new file in the current directory. @@ -3300,18 +3308,19 @@ fn invalidate_path_on_cache_key() -> Result<()> { // Installing again should update the package. uv_snapshot!(context.filters(), context.pip_install() .arg("example @ .") - .current_dir(editable_dir.path()), @r###" + .current_dir(editable_dir.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ example==0.0.0 (from file://[TEMP_DIR]/editable) - "### + "# ); Ok(()) @@ -3355,20 +3364,21 @@ fn invalidate_path_on_commit() -> Result<()> { uv_snapshot!(context.filters(), context.pip_install() .arg("example @ .") - .current_dir(editable_dir.path()), @r###" + .current_dir(editable_dir.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==4.0.0 + example==0.0.0 (from file://[TEMP_DIR]/editable) + idna==3.6 + sniffio==1.3.1 - "### + "# ); // Installing again should be a no-op. @@ -3396,18 +3406,19 @@ fn invalidate_path_on_commit() -> Result<()> { // Installing again should update the package. uv_snapshot!(context.filters(), context.pip_install() .arg("example @ .") - .current_dir(editable_dir.path()), @r###" + .current_dir(editable_dir.path()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] ~ example==0.0.0 (from file://[TEMP_DIR]/editable) - "### + "# ); Ok(()) @@ -4495,19 +4506,20 @@ fn deptry_gitignore() { uv_snapshot!(context.filters(), context.pip_install() .arg(format!("deptry_reproducer @ {}", source_dist_dir.join("deptry_reproducer-0.1.0.tar.gz").simplified_display())) .arg("--strict") - .current_dir(source_dist_dir), @r###" + .current_dir(source_dist_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 3 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Prepared 3 packages in [TIME] Installed 3 packages in [TIME] + cffi==1.16.0 + deptry-reproducer==0.1.0 (from file://[WORKSPACE]/scripts/packages/deptry_reproducer/deptry_reproducer-0.1.0.tar.gz) + pycparser==2.21 - "### + "# ); // Check that we packed the python source files diff --git a/crates/uv/tests/run.rs b/crates/uv/tests/run.rs index 9d8a3078c1a1..c44553b8df06 100644 --- a/crates/uv/tests/run.rs +++ b/crates/uv/tests/run.rs @@ -231,7 +231,7 @@ fn run_pep723_script() -> Result<()> { })?; // Running the script should install the requirements. - uv_snapshot!(context.filters(), context.run().arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -239,10 +239,11 @@ fn run_pep723_script() -> Result<()> { ----- stderr ----- Reading inline script metadata from: main.py Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); // Running again should use the existing environment. uv_snapshot!(context.filters(), context.run().arg("main.py"), @r###" @@ -411,7 +412,7 @@ fn run_pep723_script_requires_python() -> Result<()> { "# })?; - uv_snapshot!(context.filters(), context.run().arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("main.py"), @r#" success: false exit_code: 1 ----- stdout ----- @@ -420,6 +421,7 @@ fn run_pep723_script_requires_python() -> Result<()> { Reading inline script metadata from: main.py warning: The Python request from `.python-version` resolved to Python 3.8.[X], which is incompatible with the script's Python requirement: `>=3.11` Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 @@ -427,12 +429,12 @@ fn run_pep723_script_requires_python() -> Result<()> { File "main.py", line 10, in x: str | int = "hello" TypeError: unsupported operand type(s) for |: 'type' and 'type' - "###); + "#); // Delete the `.python-version` file to allow the script to run. fs_err::remove_file(&python_version)?; - uv_snapshot!(context.filters(), context.run().arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -441,9 +443,10 @@ fn run_pep723_script_requires_python() -> Result<()> { ----- stderr ----- Reading inline script metadata from: main.py Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); Ok(()) } @@ -515,7 +518,7 @@ fn run_pep723_script_metadata() -> Result<()> { })?; // Running the script should fail without network access. - uv_snapshot!(context.filters(), context.run().arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -523,10 +526,11 @@ fn run_pep723_script_metadata() -> Result<()> { ----- stderr ----- Reading inline script metadata from: main.py Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==1.0.1 - "###); + "#); // Respect `tool.uv.sources`. let test_script = context.temp_dir.child("main.py"); @@ -546,7 +550,7 @@ fn run_pep723_script_metadata() -> Result<()> { })?; // The script should succeed with the specified source. - uv_snapshot!(context.filters(), context.run().arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -554,10 +558,11 @@ fn run_pep723_script_metadata() -> Result<()> { ----- stderr ----- Reading inline script metadata from: main.py Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979) - "###); + "#); Ok(()) } @@ -621,7 +626,7 @@ fn run_with() -> Result<()> { })?; // Requesting an unsatisfied requirement should install it. - uv_snapshot!(context.filters(), context.run().arg("--with").arg("iniconfig").arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("--with").arg("iniconfig").arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -635,10 +640,11 @@ fn run_with() -> Result<()> { + idna==3.6 + sniffio==1.3.1 Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); // Requesting a satisfied requirement should use the base environment. uv_snapshot!(context.filters(), context.run().arg("--with").arg("sniffio").arg("main.py"), @r###" @@ -652,7 +658,7 @@ fn run_with() -> Result<()> { "###); // Unless the user requests a different version. - uv_snapshot!(context.filters(), context.run().arg("--with").arg("sniffio<1.3.1").arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("--with").arg("sniffio<1.3.1").arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -661,10 +667,11 @@ fn run_with() -> Result<()> { Resolved 6 packages in [TIME] Audited 4 packages in [TIME] Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + sniffio==1.3.0 - "###); + "#); // If the dependencies can't be resolved, we should reference `--with`. uv_snapshot!(context.filters(), context.run().arg("--with").arg("add").arg("main.py"), @r###" @@ -721,7 +728,7 @@ fn run_with_editable() -> Result<()> { })?; // Requesting an editable requirement should install it in a layer. - uv_snapshot!(context.filters(), context.run().arg("--with-editable").arg("./src/black_editable").arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("--with-editable").arg("./src/black_editable").arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -735,13 +742,14 @@ fn run_with_editable() -> Result<()> { + idna==3.6 + sniffio==1.3.1 Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + black==0.1.0 (from file://[TEMP_DIR]/src/black_editable) - "###); + "#); // Requesting an editable requirement should install it in a layer, even if it satisfied - uv_snapshot!(context.filters(), context.run().arg("--with-editable").arg("./src/anyio_local").arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("--with-editable").arg("./src/anyio_local").arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -750,10 +758,11 @@ fn run_with_editable() -> Result<()> { Resolved 6 packages in [TIME] Audited 4 packages in [TIME] Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + anyio==4.3.0+foo (from file://[TEMP_DIR]/src/anyio_local) - "###); + "#); // Requesting the project itself should use the base environment. uv_snapshot!(context.filters(), context.run().arg("--with-editable").arg(".").arg("main.py"), @r###" @@ -783,12 +792,13 @@ fn run_with_editable() -> Result<()> { "# })?; - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] Prepared 1 package in [TIME] Uninstalled 3 packages in [TIME] @@ -797,7 +807,7 @@ fn run_with_editable() -> Result<()> { + anyio==4.3.0+foo (from file://[TEMP_DIR]/src/anyio_local) ~ foo==1.0.0 (from file://[TEMP_DIR]/) - idna==3.6 - "###); + "#); uv_snapshot!(context.filters(), context.run().arg("--with-editable").arg("./src/anyio_local").arg("main.py"), @r###" success: true @@ -1120,7 +1130,7 @@ fn run_requirements_txt() -> Result<()> { let requirements_txt = context.temp_dir.child("requirements.txt"); requirements_txt.write_str("iniconfig")?; - uv_snapshot!(context.filters(), context.run().arg("--with-requirements").arg(requirements_txt.as_os_str()).arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("--with-requirements").arg(requirements_txt.as_os_str()).arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1134,10 +1144,11 @@ fn run_requirements_txt() -> Result<()> { + idna==3.6 + sniffio==1.3.1 Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); // Requesting a satisfied requirement should use the base environment. requirements_txt.write_str("sniffio")?; @@ -1155,7 +1166,7 @@ fn run_requirements_txt() -> Result<()> { // Unless the user requests a different version. requirements_txt.write_str("sniffio<1.3.1")?; - uv_snapshot!(context.filters(), context.run().arg("--with-requirements").arg(requirements_txt.as_os_str()).arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("--with-requirements").arg(requirements_txt.as_os_str()).arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1164,10 +1175,11 @@ fn run_requirements_txt() -> Result<()> { Resolved 6 packages in [TIME] Audited 4 packages in [TIME] Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + sniffio==1.3.0 - "###); + "#); // Or includes an unsatisfied requirement via `--with`. requirements_txt.write_str("sniffio")?; @@ -1177,7 +1189,7 @@ fn run_requirements_txt() -> Result<()> { .arg(requirements_txt.as_os_str()) .arg("--with") .arg("iniconfig") - .arg("main.py"), @r###" + .arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1186,11 +1198,12 @@ fn run_requirements_txt() -> Result<()> { Resolved 6 packages in [TIME] Audited 4 packages in [TIME] Resolved 2 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 2 packages in [TIME] + iniconfig==2.0.0 + sniffio==1.3.1 - "###); + "#); // But reject `-` as a requirements file. uv_snapshot!(context.filters(), context.run() @@ -1243,7 +1256,7 @@ fn run_requirements_txt_arguments() -> Result<()> { " })?; - uv_snapshot!(context.filters(), context.run().arg("--with-requirements").arg(requirements_txt.as_os_str()).arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("--with-requirements").arg(requirements_txt.as_os_str()).arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1256,10 +1269,11 @@ fn run_requirements_txt_arguments() -> Result<()> { + typing-extensions==4.10.0 warning: Ignoring `--index-url` from requirements file: `https://test.pypi.org/simple`. Instead, use the `--index-url` command-line argument, or set `index-url` in a `uv.toml` or `pyproject.toml` file. Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + idna==3.6 - "###); + "#); Ok(()) } @@ -1297,7 +1311,7 @@ fn run_editable() -> Result<()> { })?; // We treat arguments before the command as uv arguments - uv_snapshot!(context.filters(), context.run().arg("--with").arg("iniconfig").arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("--with").arg("iniconfig").arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1309,10 +1323,11 @@ fn run_editable() -> Result<()> { Installed 1 package in [TIME] + foo==1.0.0 (from file://[TEMP_DIR]/) Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); Ok(()) } @@ -1401,15 +1416,16 @@ fn run_without_output() -> Result<()> { })?; // On the first run, we only show the summary line for each environment. - uv_snapshot!(context.filters(), context.run().env_remove("UV_SHOW_RESOLUTION").arg("--with").arg("iniconfig").arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().env_remove("UV_SHOW_RESOLUTION").arg("--with").arg("iniconfig").arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Installed 4 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Installed 1 package in [TIME] - "###); + "#); // Subsequent runs are quiet. uv_snapshot!(context.filters(), context.run().env_remove("UV_SHOW_RESOLUTION").arg("--with").arg("iniconfig").arg("main.py"), @r###" @@ -1476,7 +1492,7 @@ fn run_isolated_python_version() -> Result<()> { + typing-extensions==4.10.0 "###); - uv_snapshot!(context.filters(), context.run().arg("--isolated").arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("--isolated").arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1484,6 +1500,7 @@ fn run_isolated_python_version() -> Result<()> { ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 5 packages in [TIME] Installed 6 packages in [TIME] + anyio==4.3.0 @@ -1492,7 +1509,7 @@ fn run_isolated_python_version() -> Result<()> { + idna==3.6 + sniffio==1.3.1 + typing-extensions==4.10.0 - "###); + "#); // Set the `.python-version` to `3.12`. context @@ -1500,7 +1517,7 @@ fn run_isolated_python_version() -> Result<()> { .child(PYTHON_VERSION_FILENAME) .write_str("3.12")?; - uv_snapshot!(context.filters(), context.run().arg("--isolated").arg("main.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("--isolated").arg("main.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1508,13 +1525,14 @@ fn run_isolated_python_version() -> Result<()> { ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 3 packages in [TIME] Installed 4 packages in [TIME] + anyio==4.3.0 + foo==1.0.0 (from file://[TEMP_DIR]/) + idna==3.6 + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -1848,7 +1866,7 @@ fn run_compiled_python_file() -> Result<()> { "# })?; - uv_snapshot!(context.filters(), context.run().arg("script.py"), @r###" + uv_snapshot!(context.filters(), context.run().arg("script.py"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1856,10 +1874,11 @@ fn run_compiled_python_file() -> Result<()> { ----- stderr ----- Reading inline script metadata from: script.py Resolved 1 package in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); // Compile the PEP 723 script. let compile_output = context diff --git a/crates/uv/tests/snapshots/ecosystem__black-uv-lock-output.snap b/crates/uv/tests/snapshots/ecosystem__black-uv-lock-output.snap index 606d26a1743a..a04f40f2f409 100644 --- a/crates/uv/tests/snapshots/ecosystem__black-uv-lock-output.snap +++ b/crates/uv/tests/snapshots/ecosystem__black-uv-lock-output.snap @@ -7,4 +7,5 @@ exit_code: 0 ----- stdout ----- ----- stderr ----- +warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 39 packages in [TIME] diff --git a/crates/uv/tests/snapshots/ecosystem__github-wikidata-bot-uv-lock-output.snap b/crates/uv/tests/snapshots/ecosystem__github-wikidata-bot-uv-lock-output.snap index 3f148eb035d3..f10b061e8531 100644 --- a/crates/uv/tests/snapshots/ecosystem__github-wikidata-bot-uv-lock-output.snap +++ b/crates/uv/tests/snapshots/ecosystem__github-wikidata-bot-uv-lock-output.snap @@ -7,4 +7,5 @@ exit_code: 0 ----- stdout ----- ----- stderr ----- +warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 31 packages in [TIME] diff --git a/crates/uv/tests/snapshots/ecosystem__home-assistant-core-uv-lock-output.snap b/crates/uv/tests/snapshots/ecosystem__home-assistant-core-uv-lock-output.snap index a827fc15395c..f5f12e252844 100644 --- a/crates/uv/tests/snapshots/ecosystem__home-assistant-core-uv-lock-output.snap +++ b/crates/uv/tests/snapshots/ecosystem__home-assistant-core-uv-lock-output.snap @@ -7,4 +7,5 @@ exit_code: 0 ----- stdout ----- ----- stderr ----- +warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 97 packages in [TIME] diff --git a/crates/uv/tests/snapshots/ecosystem__packse-uv-lock-output.snap b/crates/uv/tests/snapshots/ecosystem__packse-uv-lock-output.snap index fa8729fb8d37..2cbab4df480d 100644 --- a/crates/uv/tests/snapshots/ecosystem__packse-uv-lock-output.snap +++ b/crates/uv/tests/snapshots/ecosystem__packse-uv-lock-output.snap @@ -7,4 +7,5 @@ exit_code: 0 ----- stdout ----- ----- stderr ----- +warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 49 packages in [TIME] diff --git a/crates/uv/tests/snapshots/ecosystem__transformers-uv-lock-output.snap b/crates/uv/tests/snapshots/ecosystem__transformers-uv-lock-output.snap index 3f50a5c1cb07..d9f8d69c5180 100644 --- a/crates/uv/tests/snapshots/ecosystem__transformers-uv-lock-output.snap +++ b/crates/uv/tests/snapshots/ecosystem__transformers-uv-lock-output.snap @@ -7,4 +7,5 @@ exit_code: 0 ----- stdout ----- ----- stderr ----- +warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 296 packages in [TIME] diff --git a/crates/uv/tests/snapshots/ecosystem__warehouse-uv-lock-output.snap b/crates/uv/tests/snapshots/ecosystem__warehouse-uv-lock-output.snap index 508bbbfa4d48..b8caaed3226c 100644 --- a/crates/uv/tests/snapshots/ecosystem__warehouse-uv-lock-output.snap +++ b/crates/uv/tests/snapshots/ecosystem__warehouse-uv-lock-output.snap @@ -7,4 +7,5 @@ exit_code: 0 ----- stdout ----- ----- stderr ----- +warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 323 packages in [TIME] diff --git a/crates/uv/tests/sync.rs b/crates/uv/tests/sync.rs index bff1a3def208..e7f927ec9d47 100644 --- a/crates/uv/tests/sync.rs +++ b/crates/uv/tests/sync.rs @@ -31,18 +31,19 @@ fn sync() -> Result<()> { )?; // Running `uv sync` should generate a lockfile. - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + iniconfig==2.0.0 + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); assert!(context.temp_dir.child("uv.lock").exists()); @@ -69,14 +70,15 @@ fn locked() -> Result<()> { )?; // Running with `--locked` should error, if no lockfile is present. - uv_snapshot!(context.filters(), context.sync().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--locked"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Unable to find lockfile at `uv.lock`. To create a lockfile, run `uv lock` or `uv sync`. - "###); + "#); // Lock the initial requirements. context.lock().assert().success(); @@ -99,15 +101,16 @@ fn locked() -> Result<()> { )?; // Running with `--locked` should error. - uv_snapshot!(context.filters(), context.sync().arg("--locked"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--locked"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`. - "###); + "#); let updated = fs_err::read_to_string(context.temp_dir.child("uv.lock"))?; @@ -137,14 +140,15 @@ fn frozen() -> Result<()> { )?; // Running with `--frozen` should error, if no lockfile is present. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: Unable to find lockfile at `uv.lock`. To create a lockfile, run `uv lock` or `uv sync`. - "###); + "#); context.lock().assert().success(); @@ -164,19 +168,20 @@ fn frozen() -> Result<()> { )?; // Running with `--frozen` should install the stale lockfile. - uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + anyio==3.7.0 + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -194,30 +199,32 @@ fn empty() -> Result<()> { )?; // Running `uv sync` should generate an empty lockfile. - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`. Resolved in [TIME] Audited in [TIME] - "###); + "#); assert!(context.temp_dir.child("uv.lock").exists()); // Running `uv sync` again should succeed. - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`. Resolved in [TIME] Audited in [TIME] - "###); + "#); Ok(()) } @@ -278,18 +285,19 @@ fn package() -> Result<()> { let init = src.child("__init__.py"); init.touch()?; - uv_snapshot!(context.filters(), context.sync().arg("--package").arg("child"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--package").arg("child"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + child==0.1.0 (from file://[TEMP_DIR]/child) + iniconfig==2.0.0 - "###); + "#); Ok(()) } @@ -352,12 +360,13 @@ fn mixed_requires_python() -> Result<()> { )?; // Running `uv sync` should succeed, locking for Python 3.12. - uv_snapshot!(context.filters(), context.sync().arg("-p").arg("3.12"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("-p").arg("3.12"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: .venv Resolved 5 packages in [TIME] @@ -368,18 +377,19 @@ fn mixed_requires_python() -> Result<()> { + bird-feeder==0.1.0 (from file://[TEMP_DIR]/packages/bird-feeder) + idna==3.6 + sniffio==1.3.1 - "###); + "#); // Running `uv sync` again should fail. - uv_snapshot!(context.filters(), context.sync().arg("-p").arg("3.8"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("-p").arg("3.8"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.8.[X] interpreter at: [PYTHON-3.8] error: The requested interpreter resolved to Python 3.8.[X], which is incompatible with the project's Python requirement: `>=3.12`. However, a workspace member (`bird-feeder`) supports Python >=3.8. To install the workspace member on its own, navigate to `packages/bird-feeder`, then run `uv venv --python 3.8.[X]` followed by `uv pip install -e .`. - "###); + "#); Ok(()) } @@ -431,27 +441,29 @@ fn virtual_workspace_dev_dependencies() -> Result<()> { init.touch()?; // Syncing with `--no-dev` should omit all dependencies except `iniconfig`. - uv_snapshot!(context.filters(), context.sync().arg("--no-dev"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-dev"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + child==0.1.0 (from file://[TEMP_DIR]/child) + iniconfig==2.0.0 - "###); + "#); // Syncing without `--no-dev` should include `anyio`, `requests`, `pysocks`, and their // dependencies, but not `typing-extensions`. - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 11 packages in [TIME] Prepared 8 packages in [TIME] Installed 8 packages in [TIME] @@ -463,7 +475,7 @@ fn virtual_workspace_dev_dependencies() -> Result<()> { + requests==2.31.0 + sniffio==1.3.1 + urllib3==2.2.1 - "###); + "#); Ok(()) } @@ -516,12 +528,13 @@ fn sync_build_isolation() -> Result<()> { "###); // Running `uv sync` should succeed. - uv_snapshot!(context.filters(), context.sync().arg("--no-build-isolation"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-build-isolation"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Uninstalled 7 packages in [TIME] @@ -535,7 +548,7 @@ fn sync_build_isolation() -> Result<()> { + source-distribution==0.0.1 (from https://files.pythonhosted.org/packages/10/1f/57aa4cce1b1abf6b433106676e15f9fa2c92ed2bd4cf77c3b50a9e9ac773/source_distribution-0.0.1.tar.gz) - trove-classifiers==2024.3.3 - wheel==0.43.0 - "###); + "#); assert!(context.temp_dir.child("uv.lock").exists()); @@ -568,12 +581,13 @@ fn sync_build_isolation_package() -> Result<()> { let filters = std::iter::once((r"exit code: 1", "exit status: 1")) .chain(context.filters()) .collect::>(); - uv_snapshot!(filters, context.sync().arg("--no-build-isolation-package").arg("source-distribution"), @r###" + uv_snapshot!(filters, context.sync().arg("--no-build-isolation-package").arg("source-distribution"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] error: Failed to prepare distributions Caused by: Failed to fetch wheel: source-distribution @ https://files.pythonhosted.org/packages/10/1f/57aa4cce1b1abf6b433106676e15f9fa2c92ed2bd4cf77c3b50a9e9ac773/source_distribution-0.0.1.tar.gz @@ -585,7 +599,7 @@ fn sync_build_isolation_package() -> Result<()> { File "", line 8, in ModuleNotFoundError: No module named 'hatchling' --- - "###); + "#); // Install `hatchling` for `source-distribution`. uv_snapshot!(context.filters(), context.pip_install().arg("hatchling"), @r###" @@ -605,12 +619,13 @@ fn sync_build_isolation_package() -> Result<()> { "###); // Running `uv sync` should succeed. - uv_snapshot!(context.filters(), context.sync().arg("--no-build-isolation-package").arg("source-distribution"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-build-isolation-package").arg("source-distribution"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Uninstalled 5 packages in [TIME] @@ -622,7 +637,7 @@ fn sync_build_isolation_package() -> Result<()> { + project==0.1.0 (from file://[TEMP_DIR]/) + source-distribution==0.0.1 (from https://files.pythonhosted.org/packages/10/1f/57aa4cce1b1abf6b433106676e15f9fa2c92ed2bd4cf77c3b50a9e9ac773/source_distribution-0.0.1.tar.gz) - trove-classifiers==2024.3.3 - "###); + "#); assert!(context.temp_dir.child("uv.lock").exists()); @@ -660,12 +675,13 @@ fn sync_build_isolation_extra() -> Result<()> { let filters = std::iter::once((r"exit code: 1", "exit status: 1")) .chain(context.filters()) .collect::>(); - uv_snapshot!(&filters, context.sync().arg("--extra").arg("compile"), @r###" + uv_snapshot!(&filters, context.sync().arg("--extra").arg("compile"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] error: Failed to prepare distributions Caused by: Failed to fetch wheel: source-distribution @ https://files.pythonhosted.org/packages/10/1f/57aa4cce1b1abf6b433106676e15f9fa2c92ed2bd4cf77c3b50a9e9ac773/source_distribution-0.0.1.tar.gz @@ -677,15 +693,16 @@ fn sync_build_isolation_extra() -> Result<()> { File "", line 8, in ModuleNotFoundError: No module named 'hatchling' --- - "###); + "#); // Running `uv sync` with `--all-extras` should also fail. - uv_snapshot!(&filters, context.sync().arg("--all-extras"), @r###" + uv_snapshot!(&filters, context.sync().arg("--all-extras"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] error: Failed to prepare distributions Caused by: Failed to fetch wheel: source-distribution @ https://files.pythonhosted.org/packages/10/1f/57aa4cce1b1abf6b433106676e15f9fa2c92ed2bd4cf77c3b50a9e9ac773/source_distribution-0.0.1.tar.gz @@ -697,15 +714,16 @@ fn sync_build_isolation_extra() -> Result<()> { File "", line 8, in ModuleNotFoundError: No module named 'hatchling' --- - "###); + "#); // Install the build dependencies. - uv_snapshot!(context.filters(), context.sync().arg("--extra").arg("build"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--extra").arg("build"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] Prepared 6 packages in [TIME] Installed 6 packages in [TIME] @@ -715,15 +733,16 @@ fn sync_build_isolation_extra() -> Result<()> { + pluggy==1.4.0 + project==0.1.0 (from file://[TEMP_DIR]/) + trove-classifiers==2024.3.3 - "###); + "#); // Running `uv sync` for the `compile` extra should succeed, and remove the build dependencies. - uv_snapshot!(context.filters(), context.sync().arg("--extra").arg("compile"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--extra").arg("compile"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] Prepared 1 package in [TIME] Uninstalled 5 packages in [TIME] @@ -734,7 +753,7 @@ fn sync_build_isolation_extra() -> Result<()> { - pluggy==1.4.0 + source-distribution==0.0.1 (from https://files.pythonhosted.org/packages/10/1f/57aa4cce1b1abf6b433106676e15f9fa2c92ed2bd4cf77c3b50a9e9ac773/source_distribution-0.0.1.tar.gz) - trove-classifiers==2024.3.3 - "###); + "#); assert!(context.temp_dir.child("uv.lock").exists()); @@ -788,19 +807,20 @@ fn sync_reset_state() -> Result<()> { init.touch()?; // Running `uv sync` should succeed. - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] Prepared 3 packages in [TIME] Installed 3 packages in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) + pydantic-core==2.17.0 + typing-extensions==4.10.0 - "###); + "#); assert!(context.temp_dir.child("uv.lock").exists()); @@ -842,18 +862,19 @@ fn sync_relative_wheel() -> Result<()> { context.temp_dir.join("wheels/ok-1.0.0-py3-none-any.whl"), )?; - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 1 package in [TIME] Installed 2 packages in [TIME] + ok==1.0.0 (from file://[TEMP_DIR]/wheels/ok-1.0.0-py3-none-any.whl) + relative-wheel==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; @@ -894,15 +915,16 @@ fn sync_relative_wheel() -> Result<()> { ); // Check that we can re-read the lockfile. - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Audited 2 packages in [TIME] - "###); + "#); Ok(()) } @@ -930,15 +952,16 @@ fn sync_environment() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] error: The current Python platform is not compatible with the lockfile's supported environments: `python_full_version < '3.11'` - "###); + "#); assert!(context.temp_dir.child("uv.lock").exists()); @@ -1008,19 +1031,20 @@ fn no_install_project() -> Result<()> { context.lock().assert().success(); // Running with `--no-install-project` should install `anyio`, but not `project`. - uv_snapshot!(context.filters(), context.sync().arg("--no-install-project"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-install-project"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 3 packages in [TIME] Installed 3 packages in [TIME] + anyio==3.7.0 + idna==3.6 + sniffio==1.3.1 - "###); + "#); // However, we do require the `pyproject.toml`. fs_err::remove_file(pyproject_toml)?; @@ -1090,12 +1114,13 @@ fn no_install_workspace() -> Result<()> { // Running with `--no-install-workspace` should install `anyio` and `iniconfig`, but not // `project` or `child`. - uv_snapshot!(context.filters(), context.sync().arg("--no-install-workspace"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-install-workspace"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] Prepared 4 packages in [TIME] Installed 4 packages in [TIME] @@ -1103,7 +1128,7 @@ fn no_install_workspace() -> Result<()> { + idna==3.6 + iniconfig==2.0.0 + sniffio==1.3.1 - "###); + "#); // Remove the virtual environment. fs_err::remove_dir_all(&context.venv)?; @@ -1111,12 +1136,13 @@ fn no_install_workspace() -> Result<()> { // We don't require the `pyproject.toml` for non-root members, if `--frozen` is provided. fs_err::remove_file(child.join("pyproject.toml"))?; - uv_snapshot!(context.filters(), context.sync().arg("--no-install-workspace").arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-install-workspace").arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: .venv Prepared 4 packages in [TIME] @@ -1125,30 +1151,32 @@ fn no_install_workspace() -> Result<()> { + idna==3.6 + iniconfig==2.0.0 + sniffio==1.3.1 - "###); + "#); // Even if `--package` is used. - uv_snapshot!(context.filters(), context.sync().arg("--package").arg("child").arg("--no-install-workspace").arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--package").arg("child").arg("--no-install-workspace").arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Uninstalled 3 packages in [TIME] - anyio==3.7.0 - idna==3.6 - sniffio==1.3.1 - "###); + "#); // Unless the package doesn't exist. - uv_snapshot!(context.filters(), context.sync().arg("--package").arg("fake").arg("--no-install-workspace").arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--package").arg("fake").arg("--no-install-workspace").arg("--frozen"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored error: could not find root package `fake` - "###); + "#); // But we do require the root `pyproject.toml`. fs_err::remove_file(context.temp_dir.join("pyproject.toml"))?; @@ -1189,35 +1217,37 @@ fn no_install_package() -> Result<()> { context.lock().assert().success(); // Running with `--no-install-package anyio` should skip anyio but include everything else - uv_snapshot!(context.filters(), context.sync().arg("--no-install-package").arg("anyio"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-install-package").arg("anyio"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 3 packages in [TIME] Installed 3 packages in [TIME] + idna==3.6 + project==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); // Running with `--no-install-package project` should skip the project itself (not as a special // case, that's just the name of the project) - uv_snapshot!(context.filters(), context.sync().arg("--no-install-package").arg("project"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-install-package").arg("project"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] + anyio==3.7.0 - project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); Ok(()) } @@ -1246,25 +1276,27 @@ fn no_install_project_no_build() -> Result<()> { context.lock().assert().success(); // `--no-build` should raise an error, since we try to install the project. - uv_snapshot!(context.filters(), context.sync().arg("--no-build"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-build"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: Failed to validate existing lockfile: distribution project==0.1.0 @ editable+. can't be installed because it is marked as `--no-build` but has no binary distribution Resolved 4 packages in [TIME] error: distribution project==0.1.0 @ editable+. can't be installed because it is marked as `--no-build` but has no binary distribution - "###); + "#); // But it's fine to combine `--no-install-project` with `--no-build`. We shouldn't error, since // we aren't building the project. - uv_snapshot!(context.filters(), context.sync().arg("--no-install-project").arg("--no-build"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-install-project").arg("--no-build"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored warning: Failed to validate existing lockfile: distribution project==0.1.0 @ editable+. can't be installed because it is marked as `--no-build` but has no binary distribution Resolved 4 packages in [TIME] Prepared 3 packages in [TIME] @@ -1272,7 +1304,7 @@ fn no_install_project_no_build() -> Result<()> { + anyio==3.7.0 + idna==3.6 + sniffio==1.3.1 - "###); + "#); Ok(()) } @@ -1298,18 +1330,19 @@ fn convert_to_virtual() -> Result<()> { )?; // Running `uv sync` should install the project itself. - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + iniconfig==2.0.0 + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -1359,16 +1392,17 @@ fn convert_to_virtual() -> Result<()> { )?; // Running `uv sync` should remove the project itself. - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Uninstalled 1 package in [TIME] - project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -1426,17 +1460,18 @@ fn convert_to_package() -> Result<()> { )?; // Running `uv sync` should not install the project itself. - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -1490,17 +1525,18 @@ fn convert_to_package() -> Result<()> { )?; // Running `uv sync` should install the project itself. - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 1 package in [TIME] Installed 1 package in [TIME] + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap(); @@ -1557,17 +1593,18 @@ fn sync_custom_environment_path() -> Result<()> { )?; // Running `uv sync` should create `.venv` by default - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); context .temp_dir @@ -1575,19 +1612,21 @@ fn sync_custom_environment_path() -> Result<()> { .assert(predicate::path::is_dir()); // Running `uv sync` should create `foo` in the project directory when customized - uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", "foo"), @r###" + uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", "foo"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `foo` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: foo Resolved 2 packages in [TIME] + Installing to environment at foo/bin/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); context .temp_dir @@ -1601,19 +1640,21 @@ fn sync_custom_environment_path() -> Result<()> { .assert(predicate::path::is_dir()); // An absolute path can be provided - uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", "foobar/.venv"), @r###" + uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", "foobar/.venv"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `foobar/.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: foobar/.venv Resolved 2 packages in [TIME] + Installing to environment at foobar/.venv/bin/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); context .temp_dir @@ -1627,19 +1668,21 @@ fn sync_custom_environment_path() -> Result<()> { .assert(predicate::path::is_dir()); // An absolute path can be provided - uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", context.temp_dir.join("bar")), @r###" + uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", context.temp_dir.join("bar")), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `bar` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: bar Resolved 2 packages in [TIME] + Installing to environment at bar/bin/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); context .temp_dir @@ -1649,19 +1692,21 @@ fn sync_custom_environment_path() -> Result<()> { // And, it can be outside the project let tempdir = tempdir_in(TestContext::test_bucket_dir())?; context = context.with_filtered_path(tempdir.path(), "OTHER_TEMPDIR"); - uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", tempdir.path().join(".venv")), @r###" + uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", tempdir.path().join(".venv")), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `[OTHER_TEMPDIR]/.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: [OTHER_TEMPDIR]/.venv Resolved 2 packages in [TIME] + Installing to environment at [OTHER_TEMPDIR]/.venv/bin/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); ChildPath::new(tempdir.path()) .child(".venv") @@ -1689,17 +1734,18 @@ fn sync_workspace_custom_environment_path() -> Result<()> { context.init().arg("child").assert().success(); // Running `uv sync` should create `.venv` in the workspace root - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); context .temp_dir @@ -1707,16 +1753,18 @@ fn sync_workspace_custom_environment_path() -> Result<()> { .assert(predicate::path::is_dir()); // Similarly, `uv sync` from the child project uses `.venv` in the workspace root - uv_snapshot!(context.filters(), context.sync().current_dir(context.temp_dir.join("child")), @r###" + uv_snapshot!(context.filters(), context.sync().current_dir(context.temp_dir.join("child")), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `[VENV]/` and will be ignored Resolved 3 packages in [TIME] + Installing to environment at [VENV]/bin/python3 Uninstalled 1 package in [TIME] - iniconfig==2.0.0 - "###); + "#); context .temp_dir @@ -1730,19 +1778,21 @@ fn sync_workspace_custom_environment_path() -> Result<()> { .assert(predicate::path::missing()); // Running `uv sync` should create `foo` in the workspace root when customized - uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", "foo"), @r###" + uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", "foo"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `foo` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: foo Resolved 3 packages in [TIME] + Installing to environment at foo/bin/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); context .temp_dir @@ -1756,16 +1806,18 @@ fn sync_workspace_custom_environment_path() -> Result<()> { .assert(predicate::path::is_dir()); // Similarly, `uv sync` from the child project uses `foo` relative to the workspace root - uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", "foo").current_dir(context.temp_dir.join("child")), @r###" + uv_snapshot!(context.filters(), context.sync().env("UV_PROJECT_ENVIRONMENT", "foo").current_dir(context.temp_dir.join("child")), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `[TEMP_DIR]/foo` and will be ignored Resolved 3 packages in [TIME] + Installing to environment at [TEMP_DIR]/foo/bin/python3 Uninstalled 1 package in [TIME] - iniconfig==2.0.0 - "###); + "#); context .temp_dir @@ -1779,15 +1831,17 @@ fn sync_workspace_custom_environment_path() -> Result<()> { .assert(predicate::path::missing()); // And, `uv sync --package child` uses `foo` relative to the workspace root - uv_snapshot!(context.filters(), context.sync().arg("--package").arg("child").env("UV_PROJECT_ENVIRONMENT", "foo"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--package").arg("child").env("UV_PROJECT_ENVIRONMENT", "foo"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `foo` and will be ignored Resolved 3 packages in [TIME] + Installing to environment at foo/bin/python3 Audited in [TIME] - "###); + "#); context .temp_dir @@ -1887,7 +1941,7 @@ fn sync_virtual_env_warning() -> Result<()> { "###); // We should not warn if the project environment has been customized and matches - uv_snapshot!(context.filters(), context.sync().env("VIRTUAL_ENV", "foo").env("UV_PROJECT_ENVIRONMENT", "foo"), @r###" + uv_snapshot!(context.filters(), context.sync().env("VIRTUAL_ENV", "foo").env("UV_PROJECT_ENVIRONMENT", "foo"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1896,13 +1950,14 @@ fn sync_virtual_env_warning() -> Result<()> { Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: foo Resolved 2 packages in [TIME] + Installing to environment at foo/bin/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); // But we should warn if they don't match still - uv_snapshot!(context.filters(), context.sync().env("VIRTUAL_ENV", "foo").env("UV_PROJECT_ENVIRONMENT", "bar"), @r###" + uv_snapshot!(context.filters(), context.sync().env("VIRTUAL_ENV", "foo").env("UV_PROJECT_ENVIRONMENT", "bar"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1912,17 +1967,18 @@ fn sync_virtual_env_warning() -> Result<()> { Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: bar Resolved 2 packages in [TIME] + Installing to environment at bar/bin/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); let child = context.temp_dir.child("child"); child.create_dir_all()?; // And `VIRTUAL_ENV` is resolved relative to the project root so with relative paths we should // warn from a child too - uv_snapshot!(context.filters(), context.sync().env("VIRTUAL_ENV", "foo").env("UV_PROJECT_ENVIRONMENT", "foo").current_dir(&child), @r###" + uv_snapshot!(context.filters(), context.sync().env("VIRTUAL_ENV", "foo").env("UV_PROJECT_ENVIRONMENT", "foo").current_dir(&child), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1930,19 +1986,21 @@ fn sync_virtual_env_warning() -> Result<()> { ----- stderr ----- warning: `VIRTUAL_ENV=foo` does not match the project environment path `[TEMP_DIR]/foo` and will be ignored Resolved 2 packages in [TIME] + Installing to environment at [TEMP_DIR]/foo/bin/python3 Audited 1 package in [TIME] - "###); + "#); // But, a matching absolute path shouldn't warn - uv_snapshot!(context.filters(), context.sync().env("VIRTUAL_ENV", context.temp_dir.join("foo")).env("UV_PROJECT_ENVIRONMENT", "foo").current_dir(&child), @r###" + uv_snapshot!(context.filters(), context.sync().env("VIRTUAL_ENV", context.temp_dir.join("foo")).env("UV_PROJECT_ENVIRONMENT", "foo").current_dir(&child), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 2 packages in [TIME] + Installing to environment at [TEMP_DIR]/foo/bin/python3 Audited 1 package in [TIME] - "###); + "#); Ok(()) } @@ -1966,12 +2024,13 @@ fn sync_update_project() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: .venv Resolved 2 packages in [TIME] @@ -1979,7 +2038,7 @@ fn sync_update_project() -> Result<()> { Installed 2 packages in [TIME] + iniconfig==2.0.0 + my-project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); // Bump the project version. pyproject_toml.write_str( @@ -1996,19 +2055,20 @@ fn sync_update_project() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 1 package in [TIME] Uninstalled 1 package in [TIME] Installed 1 package in [TIME] - my-project==0.1.0 (from file://[TEMP_DIR]/) + my-project==0.2.0 (from file://[TEMP_DIR]/) - "###); + "#); Ok(()) } @@ -2029,19 +2089,20 @@ fn sync_environment_prompt() -> Result<()> { )?; // Running `uv sync` should create `.venv` - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: .venv Resolved 2 packages in [TIME] Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); // The `pyvenv.cfg` should contain the prompt matching the project name let pyvenv_cfg = @@ -2071,18 +2132,19 @@ fn no_binary() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.sync().arg("--no-binary-package").arg("iniconfig"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-binary-package").arg("iniconfig"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + iniconfig==2.0.0 + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); assert!(context.temp_dir.child("uv.lock").exists()); @@ -2110,15 +2172,16 @@ fn no_binary_error() -> Result<()> { context.lock().assert().success(); - uv_snapshot!(context.filters(), context.sync().arg("--no-build-package").arg("django-allauth"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-build-package").arg("django-allauth"), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 19 packages in [TIME] error: distribution django-allauth==0.51.0 @ registry+https://pypi.org/simple can't be installed because it is marked as `--no-build` but has no binary distribution - "###); + "#); assert!(context.temp_dir.child("uv.lock").exists()); @@ -2144,18 +2207,19 @@ fn no_build() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.sync().arg("--no-build-package").arg("iniconfig"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--no-build-package").arg("iniconfig"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 2 packages in [TIME] Prepared 2 packages in [TIME] Installed 2 packages in [TIME] + iniconfig==2.0.0 + project==0.1.0 (from file://[TEMP_DIR]/) - "###); + "#); assert!(context.temp_dir.child("uv.lock").exists()); @@ -2179,24 +2243,26 @@ fn sync_wheel_url_source_error() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] error: distribution cffi==1.17.1 @ direct+https://files.pythonhosted.org/packages/08/fd/cc2fedbd887223f9f5d170c96e57cbf655df9831a6546c1727ae13fa977a/cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl can't be installed because the binary distribution is incompatible with the current platform - "###); + "#); Ok(()) } @@ -2227,24 +2293,26 @@ fn sync_wheel_path_source_error() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] - "###); + "#); - uv_snapshot!(context.filters(), context.sync(), @r###" + uv_snapshot!(context.filters(), context.sync(), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 3 packages in [TIME] error: distribution cffi==1.17.1 @ path+cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl can't be installed because the binary distribution is incompatible with the current platform - "###); + "#); Ok(()) } @@ -2310,12 +2378,13 @@ fn transitive_dev() -> Result<()> { let init = src.child("__init__.py"); init.touch()?; - uv_snapshot!(context.filters(), context.sync().arg("--dev"), @r###" + uv_snapshot!(context.filters(), context.sync().arg("--dev"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] Prepared 5 packages in [TIME] Installed 5 packages in [TIME] @@ -2324,7 +2393,7 @@ fn transitive_dev() -> Result<()> { + idna==3.6 + root==0.1.0 (from file://[TEMP_DIR]/) + sniffio==1.3.1 - "###); + "#); Ok(()) } diff --git a/crates/uv/tests/tool_install.rs b/crates/uv/tests/tool_install.rs index f350c1df1754..018dd3bc2d97 100644 --- a/crates/uv/tests/tool_install.rs +++ b/crates/uv/tests/tool_install.rs @@ -29,13 +29,14 @@ fn tool_install() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -45,7 +46,7 @@ fn tool_install() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); tool_dir.child("black").assert(predicate::path::is_dir()); tool_dir @@ -107,13 +108,14 @@ fn tool_install() { .arg("flask") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/flask/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + blinker==1.7.0 @@ -124,7 +126,7 @@ fn tool_install() { + markupsafe==2.1.5 + werkzeug==3.0.1 Installed 1 executable: flask - "###); + "#); tool_dir.child("flask").assert(predicate::path::is_dir()); assert!(bin_dir @@ -188,7 +190,7 @@ fn tool_install_suggest_other_packages_with_executable() { .env("UV_EXCLUDE_NEWER", "2024-05-04T00:00:00Z") // TODO: Remove this once EXCLUDE_NEWER is bumped past 2024-05-04 // (FastAPI 0.111 is only available from this date onwards) .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: false exit_code: 1 ----- stdout ----- @@ -198,6 +200,7 @@ fn tool_install_suggest_other_packages_with_executable() { ----- stderr ----- Resolved 35 packages in [TIME] + Installing to environment at tools/fastapi/bin/python Prepared 35 packages in [TIME] Installed 35 packages in [TIME] + annotated-types==0.6.0 @@ -234,7 +237,7 @@ fn tool_install_suggest_other_packages_with_executable() { + uvicorn==0.29.0 + watchfiles==0.21.0 + websockets==12.0 - "###); + "#); } /// Test installing a tool at a version @@ -249,13 +252,14 @@ fn tool_install_version() { .arg("black==24.2.0") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + black==24.2.0 @@ -265,7 +269,7 @@ fn tool_install_version() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); tool_dir.child("black").assert(predicate::path::is_dir()); tool_dir @@ -336,18 +340,19 @@ fn tool_install_editable() { .arg(context.workspace_root.join("scripts/packages/black_editable")) .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 1 package in [TIME] + Installing to environment at tools/black/bin/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + black==0.1.0 (from file://[WORKSPACE]/scripts/packages/black_editable) Installed 1 executable: black - "###); + "#); tool_dir.child("black").assert(predicate::path::is_dir()); tool_dir @@ -439,13 +444,14 @@ fn tool_install_editable() { .arg("black==24.2.0") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python3 Prepared 6 packages in [TIME] Uninstalled 1 package in [TIME] Installed 6 packages in [TIME] @@ -457,7 +463,7 @@ fn tool_install_editable() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -489,13 +495,14 @@ fn tool_install_remove_on_empty() -> Result<()> { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + black==24.3.0 @@ -505,7 +512,7 @@ fn tool_install_remove_on_empty() -> Result<()> { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -555,7 +562,7 @@ fn tool_install_remove_on_empty() -> Result<()> { .arg(black.path()) .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: false exit_code: 1 ----- stdout ----- @@ -563,6 +570,7 @@ fn tool_install_remove_on_empty() -> Result<()> { ----- stderr ----- Resolved 1 package in [TIME] + Installing to environment at tools/black/bin/python3 Prepared 1 package in [TIME] Uninstalled 6 packages in [TIME] Installed 1 package in [TIME] @@ -573,20 +581,21 @@ fn tool_install_remove_on_empty() -> Result<()> { - packaging==24.0 - pathspec==0.12.1 - platformdirs==4.2.0 - "###); + "#); // Re-request `black`. It should reinstall, without requiring `--force`. uv_snapshot!(context.filters(), context.tool_install() .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Installed 6 packages in [TIME] + black==24.3.0 + click==8.1.7 @@ -595,7 +604,7 @@ fn tool_install_remove_on_empty() -> Result<()> { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -632,18 +641,19 @@ fn tool_install_editable_from() { .arg(context.workspace_root.join("scripts/packages/black_editable")) .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 1 package in [TIME] + Installing to environment at tools/black/bin/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + black==0.1.0 (from file://[WORKSPACE]/scripts/packages/black_editable) Installed 1 executable: black - "###); + "#); tool_dir.child("black").assert(predicate::path::is_dir()); tool_dir @@ -713,13 +723,14 @@ fn tool_install_from() { .arg("black==24.2.0") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + black==24.2.0 @@ -729,7 +740,7 @@ fn tool_install_from() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); // Attempt to install `black` using `--from` with a different package name uv_snapshot!(context.filters(), context.tool_install() @@ -778,13 +789,14 @@ fn tool_install_already_installed() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -794,7 +806,7 @@ fn tool_install_already_installed() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); tool_dir.child("black").assert(predicate::path::is_dir()); tool_dir @@ -883,13 +895,14 @@ fn tool_install_already_installed() { .arg("--reinstall") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python3 Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] @@ -900,7 +913,7 @@ fn tool_install_already_installed() { ~ pathspec==0.12.1 ~ platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); // Install `black` again with `--reinstall-package` for `black` // We should reinstall `black` in the environment and reinstall the entry points @@ -910,19 +923,20 @@ fn tool_install_already_installed() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python3 Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] ~ black==24.3.0 Installed 2 executables: black, blackd - "###); + "#); // Install `black` again with `--reinstall-package` for a dependency // We should reinstall `click` in the environment but not reinstall `black` @@ -932,19 +946,20 @@ fn tool_install_already_installed() { .arg("click") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python3 Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] ~ click==8.1.7 Installed 2 executables: black, blackd - "###); + "#); } /// Test installing a tool when its entry point already exists @@ -964,13 +979,14 @@ fn tool_install_entry_point_exists() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -980,7 +996,7 @@ fn tool_install_entry_point_exists() { + pathspec==0.12.1 + platformdirs==4.2.0 error: Executable already exists: black (use `--force` to overwrite) - "###); + "#); // We should delete the virtual environment assert!(!tool_dir.child("black").exists()); @@ -1003,13 +1019,14 @@ fn tool_install_entry_point_exists() { .arg("--reinstall") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -1019,7 +1036,7 @@ fn tool_install_entry_point_exists() { + pathspec==0.12.1 + platformdirs==4.2.0 error: Executable already exists: black (use `--force` to overwrite) - "###); + "#); // We should not create a virtual environment assert!(!tool_dir.child("black").exists()); @@ -1044,13 +1061,14 @@ fn tool_install_entry_point_exists() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Installed [N] packages in [TIME] + black==24.3.0 + click==8.1.7 @@ -1059,7 +1077,7 @@ fn tool_install_entry_point_exists() { + pathspec==0.12.1 + platformdirs==4.2.0 error: Executables already exist: black, blackd (use `--force` to overwrite) - "###); + "#); // Install `black` with `--force` uv_snapshot!(context.filters(), context.tool_install() @@ -1067,13 +1085,14 @@ fn tool_install_entry_point_exists() { .arg("--force") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Installed [N] packages in [TIME] + black==24.3.0 + click==8.1.7 @@ -1082,7 +1101,7 @@ fn tool_install_entry_point_exists() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); tool_dir.child("black").assert(predicate::path::is_dir()); @@ -1125,13 +1144,14 @@ fn tool_install_entry_point_exists() { .arg("--reinstall") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python3 Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] @@ -1142,7 +1162,7 @@ fn tool_install_entry_point_exists() { ~ pathspec==0.12.1 ~ platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); tool_dir.child("black").assert(predicate::path::is_dir()); @@ -1231,13 +1251,14 @@ fn tool_install_home() { "PATH", context.home_dir.child(".local").child("bin").as_os_str(), ); - uv_snapshot!(context.filters(), cmd, @r###" + uv_snapshot!(context.filters(), cmd, @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + black==24.3.0 @@ -1247,7 +1268,7 @@ fn tool_install_home() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); context .home_dir @@ -1268,13 +1289,14 @@ fn tool_install_xdg_data_home() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_DATA_HOME", data_home.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + black==24.3.0 @@ -1284,7 +1306,7 @@ fn tool_install_xdg_data_home() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); context .temp_dir @@ -1304,13 +1326,14 @@ fn tool_install_xdg_bin_home() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + black==24.3.0 @@ -1320,7 +1343,7 @@ fn tool_install_xdg_bin_home() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); bin_dir .child(format!("black{}", std::env::consts::EXE_SUFFIX)) @@ -1339,13 +1362,14 @@ fn tool_install_tool_bin_dir() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("UV_TOOL_BIN_DIR", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + black==24.3.0 @@ -1355,7 +1379,7 @@ fn tool_install_tool_bin_dir() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); bin_dir .child(format!("black{}", std::env::consts::EXE_SUFFIX)) @@ -1373,7 +1397,7 @@ fn tool_install_no_entrypoints() { .arg("iniconfig") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: false exit_code: 1 ----- stdout ----- @@ -1381,10 +1405,11 @@ fn tool_install_no_entrypoints() { ----- stderr ----- Resolved 1 package in [TIME] + Installing to environment at tools/iniconfig/bin/python Prepared 1 package in [TIME] Installed 1 package in [TIME] + iniconfig==2.0.0 - "###); + "#); } /// Test installing a tool with a bare URL requirement. @@ -1399,13 +1424,14 @@ fn tool_install_unnamed_package() { .arg("https://files.pythonhosted.org/packages/0f/89/294c9a6b6c75a08da55e9d05321d0707e9418735e3062b12ef0f54c33474/black-24.4.2-py3-none-any.whl") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + black==24.4.2 (from https://files.pythonhosted.org/packages/0f/89/294c9a6b6c75a08da55e9d05321d0707e9418735e3062b12ef0f54c33474/black-24.4.2-py3-none-any.whl) @@ -1415,7 +1441,7 @@ fn tool_install_unnamed_package() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); tool_dir.child("black").assert(predicate::path::is_dir()); tool_dir @@ -1512,13 +1538,14 @@ fn tool_install_unnamed_from() { .arg("https://files.pythonhosted.org/packages/0f/89/294c9a6b6c75a08da55e9d05321d0707e9418735e3062b12ef0f54c33474/black-24.4.2-py3-none-any.whl") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + black==24.4.2 (from https://files.pythonhosted.org/packages/0f/89/294c9a6b6c75a08da55e9d05321d0707e9418735e3062b12ef0f54c33474/black-24.4.2-py3-none-any.whl) @@ -1528,7 +1555,7 @@ fn tool_install_unnamed_from() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); tool_dir.child("black").assert(predicate::path::is_dir()); tool_dir @@ -1600,13 +1627,14 @@ fn tool_install_unnamed_with() { .arg("https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 7 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 7 packages in [TIME] Installed 7 packages in [TIME] + black==24.3.0 @@ -1617,7 +1645,7 @@ fn tool_install_unnamed_with() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); tool_dir.child("black").assert(predicate::path::is_dir()); tool_dir @@ -1697,13 +1725,14 @@ fn tool_install_requirements_txt() { .arg("requirements.txt") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -1714,7 +1743,7 @@ fn tool_install_requirements_txt() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -1746,20 +1775,21 @@ fn tool_install_requirements_txt() { .arg("requirements.txt") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python3 Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] + idna==3.6 - iniconfig==2.0.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -1805,7 +1835,7 @@ fn tool_install_requirements_txt_arguments() { .arg("requirements.txt") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -1813,6 +1843,7 @@ fn tool_install_requirements_txt_arguments() { ----- stderr ----- warning: Ignoring `--index-url` from requirements file: `https://test.pypi.org/simple`. Instead, use the `--index-url` command-line argument, or set `index-url` in a `uv.toml` or `pyproject.toml` file. Resolved 7 packages in [TIME] + Installing to environment at tools/black/bin/python Prepared 7 packages in [TIME] Installed 7 packages in [TIME] + black==24.3.0 @@ -1823,7 +1854,7 @@ fn tool_install_requirements_txt_arguments() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -1862,14 +1893,14 @@ fn tool_install_requirements_txt_arguments() { .arg("requirements.txt") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Installed 2 executables: black, blackd - "###); + "#); let requirements_txt = context.temp_dir.child("requirements.txt"); requirements_txt @@ -1889,13 +1920,14 @@ fn tool_install_requirements_txt_arguments() { .arg("https://test.pypi.org/simple") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 8 packages in [TIME] + Installing to environment at tools/flask/bin/python Prepared 8 packages in [TIME] Installed 8 packages in [TIME] + blinker==1.7.0 @@ -1907,7 +1939,7 @@ fn tool_install_requirements_txt_arguments() { + markupsafe==2.1.5 + werkzeug==3.0.1 Installed 1 executable: flask - "###); + "#); } /// Test upgrading an already installed tool. @@ -1924,13 +1956,14 @@ fn tool_install_upgrade() { .arg("black==24.1.1") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.1.1 @@ -1940,7 +1973,7 @@ fn tool_install_upgrade() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -1998,18 +2031,19 @@ fn tool_install_upgrade() { .arg("iniconfig @ https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python3 Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + iniconfig==2.0.0 (from https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl) Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -2038,13 +2072,14 @@ fn tool_install_upgrade() { .arg("--upgrade") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python3 Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] @@ -2052,7 +2087,7 @@ fn tool_install_upgrade() { + black==24.3.0 - iniconfig==2.0.0 (from https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl) Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -2088,13 +2123,14 @@ fn tool_install_python_request() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -2104,7 +2140,7 @@ fn tool_install_python_request() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); // Install with Python 3.12 (compatible). uv_snapshot!(context.filters(), context.tool_install() @@ -2129,7 +2165,7 @@ fn tool_install_python_request() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -2137,6 +2173,7 @@ fn tool_install_python_request() { ----- stderr ----- Existing environment for `black` does not satisfy the requested Python interpreter Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -2146,7 +2183,7 @@ fn tool_install_python_request() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); } /// Test preserving a tool environment when new but incompatible requirements are requested. @@ -2163,13 +2200,14 @@ fn tool_install_preserve_environment() { .arg("black==24.1.1") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.1.1 @@ -2179,7 +2217,7 @@ fn tool_install_preserve_environment() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); // Install `black`, but with an incompatible requirement. uv_snapshot!(context.filters(), context.tool_install() @@ -2228,13 +2266,14 @@ fn tool_install_warn_path() { .arg("black==24.1.1") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env_remove("PATH"), @r###" + .env_remove("PATH"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.1.1 @@ -2245,7 +2284,7 @@ fn tool_install_warn_path() { + platformdirs==4.2.0 Installed 2 executables: black, blackd warning: `[TEMP_DIR]/bin` is not on your PATH. To use installed tools, run `export PATH="[TEMP_DIR]/bin:$PATH"` or `uv tool update-shell`. - "###); + "#); } /// Test installing and reinstalling with an invalid receipt. @@ -2262,13 +2301,14 @@ fn tool_install_bad_receipt() -> Result<()> { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -2278,7 +2318,7 @@ fn tool_install_bad_receipt() -> Result<()> { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); tool_dir .child("black") @@ -2296,7 +2336,7 @@ fn tool_install_bad_receipt() -> Result<()> { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -2304,6 +2344,7 @@ fn tool_install_bad_receipt() -> Result<()> { ----- stderr ----- warning: Removed existing `black` with invalid receipt Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Installed [N] packages in [TIME] + black==24.3.0 + click==8.1.7 @@ -2312,7 +2353,7 @@ fn tool_install_bad_receipt() -> Result<()> { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); Ok(()) } @@ -2332,18 +2373,19 @@ fn tool_install_malformed_dist_info() { .arg("babel") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/babel/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + babel==2.14.0 Installed 1 executable: pybabel - "###); + "#); tool_dir.child("babel").assert(predicate::path::is_dir()); tool_dir @@ -2405,13 +2447,14 @@ fn tool_install_settings() { .arg("--resolution=lowest-direct") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/flask/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + blinker==1.7.0 @@ -2422,7 +2465,7 @@ fn tool_install_settings() { + markupsafe==2.1.5 + werkzeug==3.0.1 Installed 1 executable: flask - "###); + "#); tool_dir.child("flask").assert(predicate::path::is_dir()); tool_dir @@ -2509,20 +2552,21 @@ fn tool_install_settings() { .arg("--upgrade") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/flask/bin/python3 Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] - flask==3.0.0 + flask==3.0.2 Installed 1 executable: flask - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -2556,13 +2600,14 @@ fn tool_install_at_version() { .arg("black@24.1.0") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.1.0 @@ -2572,7 +2617,7 @@ fn tool_install_at_version() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -2622,13 +2667,14 @@ fn tool_install_at_latest() { .arg("black@latest") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -2638,7 +2684,7 @@ fn tool_install_at_latest() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -2672,18 +2718,19 @@ fn tool_install_from_at_latest() { .arg("babel@latest") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/babel/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + babel==2.14.0 Installed 1 executable: pybabel - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -2716,18 +2763,19 @@ fn tool_install_from_at_version() { .arg("babel@2.13.0") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/babel/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + babel==2.13.0 Installed 1 executable: pybabel - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -2759,13 +2807,14 @@ fn tool_install_at_latest_upgrade() { .arg("black==24.1.1") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.1.1 @@ -2775,7 +2824,7 @@ fn tool_install_at_latest_upgrade() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -2800,14 +2849,14 @@ fn tool_install_at_latest_upgrade() { .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), @@ -2831,20 +2880,21 @@ fn tool_install_at_latest_upgrade() { .arg("black@latest") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python3 Prepared [N] packages in [TIME] Uninstalled [N] packages in [TIME] Installed [N] packages in [TIME] - black==24.1.1 + black==24.3.0 Installed 2 executables: black, blackd - "###); + "#); insta::with_settings!({ filters => context.filters(), diff --git a/crates/uv/tests/tool_run.rs b/crates/uv/tests/tool_run.rs index 14608fc2fa6e..51170b9ab320 100644 --- a/crates/uv/tests/tool_run.rs +++ b/crates/uv/tests/tool_run.rs @@ -32,7 +32,7 @@ fn tool_run_args() { .arg("pytest") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -40,13 +40,14 @@ fn tool_run_args() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + iniconfig==2.0.0 + packaging==24.0 + pluggy==1.4.0 + pytest==8.1.1 - "###); + "#); // Can use `--` to separate uv arguments from the command arguments. uv_snapshot!(context.filters(), context.tool_run() @@ -75,7 +76,7 @@ fn tool_run_at_version() { .arg("pytest@8.0.0") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -83,13 +84,14 @@ fn tool_run_at_version() { ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + iniconfig==2.0.0 + packaging==24.0 + pluggy==1.4.0 + pytest==8.0.0 - "###); + "#); // Empty versions are just treated as package and command names uv_snapshot!(context.filters(), context.tool_run() @@ -136,7 +138,7 @@ fn tool_run_at_version() { .arg("pytest@8.0.0") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: false exit_code: 1 ----- stdout ----- @@ -147,6 +149,7 @@ fn tool_run_at_version() { ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 1 package in [TIME] Installed 4 packages in [TIME] + iniconfig==2.0.0 @@ -154,7 +157,7 @@ fn tool_run_at_version() { + pluggy==1.4.0 + pytest==8.1.1 warning: An executable named `pytest@8.0.0` is not provided by package `pytest`. - "###); + "#); } #[test] @@ -169,7 +172,7 @@ fn tool_run_from_version() { .arg("pytest") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -177,13 +180,14 @@ fn tool_run_from_version() { ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + iniconfig==2.0.0 + packaging==24.0 + pluggy==1.4.0 + pytest==8.0.0 - "###); + "#); } #[test] @@ -197,7 +201,7 @@ fn tool_run_suggest_valid_commands() { .arg("black") .arg("orange") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: false exit_code: 1 ----- stdout ----- @@ -208,6 +212,7 @@ fn tool_run_suggest_valid_commands() { ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 6 packages in [TIME] Installed 6 packages in [TIME] + black==24.3.0 @@ -217,12 +222,12 @@ fn tool_run_suggest_valid_commands() { + pathspec==0.12.1 + platformdirs==4.2.0 warning: An executable named `orange` is not provided by package `black`. - "###); + "#); uv_snapshot!(context.filters(), context.tool_run() .arg("fastapi-cli") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: false exit_code: 1 ----- stdout ----- @@ -230,13 +235,14 @@ fn tool_run_suggest_valid_commands() { ----- stderr ----- Resolved 3 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 3 packages in [TIME] Installed 3 packages in [TIME] + fastapi-cli==0.0.1 + importlib-metadata==1.7.0 + zipp==3.18.1 warning: Package `fastapi-cli` does not provide any executables. - "###); + "#); } #[test] @@ -256,13 +262,14 @@ fn tool_run_warn_executable_not_in_from() { .env("UV_EXCLUDE_NEWER", "2024-05-04T00:00:00Z") // TODO: Remove this once EXCLUDE_NEWER is bumped past 2024-05-04 // (FastAPI 0.111 is only available from this date onwards) .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- Resolved 35 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 35 packages in [TIME] Installed 35 packages in [TIME] + annotated-types==0.6.0 @@ -300,7 +307,7 @@ fn tool_run_warn_executable_not_in_from() { + watchfiles==0.21.0 + websockets==12.0 warning: An executable named `fastapi` is not provided by package `fastapi` but is available via the dependency `fastapi-cli`. Consider using `uv tool run --from fastapi-cli fastapi` instead. - "###); + "#); } #[test] @@ -339,7 +346,7 @@ fn tool_run_from_install() { .arg("black") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -348,6 +355,7 @@ fn tool_run_from_install() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -356,14 +364,14 @@ fn tool_run_from_install() { + packaging==24.0 + pathspec==0.12.1 + platformdirs==4.2.0 - "###); + "#); // Verify that `tool run black` at a different version installs the new version. uv_snapshot!(context.filters(), context.tool_run() .arg("black@24.1.1") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -372,6 +380,7 @@ fn tool_run_from_install() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.1.1 @@ -380,7 +389,7 @@ fn tool_run_from_install() { + packaging==24.0 + pathspec==0.12.1 + platformdirs==4.2.0 - "###); + "#); // Verify that `--with` installs a new version. // TODO(charlie): This could (in theory) layer the `--with` requirements on top of the existing @@ -391,7 +400,7 @@ fn tool_run_from_install() { .arg("black") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -400,6 +409,7 @@ fn tool_run_from_install() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -409,7 +419,7 @@ fn tool_run_from_install() { + packaging==24.0 + pathspec==0.12.1 + platformdirs==4.2.0 - "###); + "#); // Verify that `tool run black` at a different version (via `--from`) installs the new version. uv_snapshot!(context.filters(), context.tool_run() @@ -418,7 +428,7 @@ fn tool_run_from_install() { .arg("black") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -427,6 +437,7 @@ fn tool_run_from_install() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.2.0 @@ -435,7 +446,7 @@ fn tool_run_from_install() { + packaging==24.0 + pathspec==0.12.1 + platformdirs==4.2.0 - "###); + "#); } #[test] @@ -451,7 +462,7 @@ fn tool_run_cache() { .arg("black") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -460,6 +471,7 @@ fn tool_run_cache() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -468,7 +480,7 @@ fn tool_run_cache() { + packaging==24.0 + pathspec==0.12.1 + platformdirs==4.2.0 - "###); + "#); // Verify that `tool run black` uses the cached version. uv_snapshot!(context.filters(), context.tool_run() @@ -496,7 +508,7 @@ fn tool_run_cache() { .arg("black") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -505,6 +517,7 @@ fn tool_run_cache() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -513,7 +526,7 @@ fn tool_run_cache() { + packaging==24.0 + pathspec==0.12.1 + platformdirs==4.2.0 - "###); + "#); // Verify that `--refresh-package` recreates everything. We may want to change this. uv_snapshot!(context.filters(), context.tool_run() @@ -524,7 +537,7 @@ fn tool_run_cache() { .arg("black") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -533,6 +546,7 @@ fn tool_run_cache() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -541,7 +555,7 @@ fn tool_run_cache() { + packaging==24.0 + pathspec==0.12.1 + platformdirs==4.2.0 - "###); + "#); // Verify that varying the interpreter leads to a fresh environment. uv_snapshot!(context.filters(), context.tool_run() @@ -550,7 +564,7 @@ fn tool_run_cache() { .arg("black") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -559,6 +573,7 @@ fn tool_run_cache() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -567,7 +582,7 @@ fn tool_run_cache() { + packaging==24.0 + pathspec==0.12.1 + platformdirs==4.2.0 - "###); + "#); // But that re-invoking with the previous interpreter retains the cached version. uv_snapshot!(context.filters(), context.tool_run() @@ -596,7 +611,7 @@ fn tool_run_cache() { .arg("black") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -605,6 +620,7 @@ fn tool_run_cache() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==24.3.0 @@ -614,7 +630,7 @@ fn tool_run_cache() { + packaging==24.0 + pathspec==0.12.1 + platformdirs==4.2.0 - "###); + "#); } #[test] @@ -629,7 +645,7 @@ fn tool_run_url() { .arg("flask") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -639,6 +655,7 @@ fn tool_run_url() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + blinker==1.7.0 @@ -648,7 +665,7 @@ fn tool_run_url() { + jinja2==3.1.3 + markupsafe==2.1.5 + werkzeug==3.0.1 - "###); + "#); } /// Read requirements from a `requirements.txt` file. @@ -669,7 +686,7 @@ fn tool_run_requirements_txt() { .arg("flask") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -679,6 +696,7 @@ fn tool_run_requirements_txt() { ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + blinker==1.7.0 @@ -690,7 +708,7 @@ fn tool_run_requirements_txt() { + markupsafe==2.1.5 + typing-extensions==4.10.0 + werkzeug==3.0.1 - "###); + "#); } /// Ignore and warn when (e.g.) the `--index-url` argument is a provided `requirements.txt`. @@ -715,7 +733,7 @@ fn tool_run_requirements_txt_arguments() { .arg("flask") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -726,6 +744,7 @@ fn tool_run_requirements_txt_arguments() { ----- stderr ----- warning: Ignoring `--index-url` from requirements file: `https://test.pypi.org/simple`. Instead, use the `--index-url` command-line argument, or set `index-url` in a `uv.toml` or `pyproject.toml` file. Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + blinker==1.7.0 @@ -736,7 +755,7 @@ fn tool_run_requirements_txt_arguments() { + jinja2==3.1.3 + markupsafe==2.1.5 + werkzeug==3.0.1 - "###); + "#); } /// List installed tools when no command arg is given (e.g. `uv tool run`). @@ -796,15 +815,16 @@ fn tool_run_without_output() { .arg("pytest") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- pytest 8.1.1 ----- stderr ----- + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Installed [N] packages in [TIME] - "###); + "#); // Subsequent runs are quiet. uv_snapshot!(context.filters(), context.tool_run() @@ -832,7 +852,7 @@ fn warn_no_executables_found() { uv_snapshot!(context.filters(), context.tool_run() .arg("requests") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: false exit_code: 1 ----- stdout ----- @@ -840,6 +860,7 @@ fn warn_no_executables_found() { ----- stderr ----- Resolved 5 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 5 packages in [TIME] Installed 5 packages in [TIME] + certifi==2024.2.2 @@ -848,7 +869,7 @@ fn warn_no_executables_found() { + requests==2.31.0 + urllib3==2.2.1 warning: Package `requests` does not provide any executables. - "###); + "#); } /// Warn when a user passes `--upgrade` to `uv tool run`. @@ -863,7 +884,7 @@ fn tool_run_upgrade_warn() { .arg("pytest") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -872,13 +893,14 @@ fn tool_run_upgrade_warn() { ----- stderr ----- warning: Tools cannot be upgraded via `uv tool run`; use `uv tool upgrade --all` to upgrade all installed tools, or `uv tool run package@latest` to run the latest version of a tool. Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + iniconfig==2.0.0 + packaging==24.0 + pluggy==1.4.0 + pytest==8.1.1 - "###); + "#); uv_snapshot!(context.filters(), context.tool_run() .arg("--upgrade") @@ -887,7 +909,7 @@ fn tool_run_upgrade_warn() { .arg("pytest") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -896,6 +918,7 @@ fn tool_run_upgrade_warn() { ----- stderr ----- warning: Tools cannot be upgraded via `uv tool run`; use `uv tool upgrade --all` to upgrade all installed tools, `uv tool run package@latest` to run the latest version of a tool, or `uv tool run --refresh package` to upgrade any `--with` dependencies. Resolved [N] packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + iniconfig==2.0.0 @@ -903,7 +926,7 @@ fn tool_run_upgrade_warn() { + pluggy==1.4.0 + pytest==8.1.1 + typing-extensions==4.10.0 - "###); + "#); } /// If we fail to resolve the tool, we should include "tool" in the error message. @@ -961,7 +984,7 @@ fn tool_run_latest() { .arg("pytest@latest") .arg("--version") .env("UV_TOOL_DIR", tool_dir.as_os_str()) - .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r###" + .env("XDG_BIN_HOME", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- @@ -969,13 +992,14 @@ fn tool_run_latest() { ----- stderr ----- Resolved 4 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 4 packages in [TIME] Installed 4 packages in [TIME] + iniconfig==2.0.0 + packaging==24.0 + pluggy==1.4.0 + pytest==8.1.1 - "###); + "#); // Run `pytest`, which should use the installed version. uv_snapshot!(context.filters(), context.tool_run() diff --git a/crates/uv/tests/tool_uninstall.rs b/crates/uv/tests/tool_uninstall.rs index 9a9a3e7fb31a..4b0cda002a40 100644 --- a/crates/uv/tests/tool_uninstall.rs +++ b/crates/uv/tests/tool_uninstall.rs @@ -50,13 +50,14 @@ fn tool_uninstall() { .arg("black==24.2.0") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved 6 packages in [TIME] + Installing to environment at tools/black/bin/python Installed 6 packages in [TIME] + black==24.2.0 + click==8.1.7 @@ -65,7 +66,7 @@ fn tool_uninstall() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); } #[test] diff --git a/crates/uv/tests/tool_upgrade.rs b/crates/uv/tests/tool_upgrade.rs index fbb065cbf005..5519ac46f810 100644 --- a/crates/uv/tests/tool_upgrade.rs +++ b/crates/uv/tests/tool_upgrade.rs @@ -21,19 +21,20 @@ fn test_tool_upgrade_name() { .arg("https://test.pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/babel/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + babel==2.6.0 + pytz==2018.5 Installed 1 executable: pybabel - "###); + "#); // Upgrade `babel` by installing from PyPI, which should upgrade to the latest version. uv_snapshot!(context.filters(), context.tool_upgrade() @@ -42,18 +43,19 @@ fn test_tool_upgrade_name() { .arg("https://pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + Installing to environment at tools/babel/bin/python3 Updated babel v2.6.0 -> v2.14.0 - babel==2.6.0 + babel==2.14.0 - pytz==2018.5 Installed 1 executable: pybabel - "###); + "#); } #[test] @@ -71,18 +73,19 @@ fn test_tool_upgrade_multiple_names() { .arg("https://test.pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/python-dotenv/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + python-dotenv==0.10.2.post2 Installed 1 executable: dotenv - "###); + "#); // Install `babel` from Test PyPI, to get an outdated version. uv_snapshot!(context.filters(), context.tool_install() @@ -91,19 +94,20 @@ fn test_tool_upgrade_multiple_names() { .arg("https://test.pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/babel/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + babel==2.6.0 + pytz==2018.5 Installed 1 executable: pybabel - "###); + "#); // Upgrade `babel` and `python-dotenv` from PyPI. uv_snapshot!(context.filters(), context.tool_upgrade() @@ -113,22 +117,24 @@ fn test_tool_upgrade_multiple_names() { .arg("https://pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + Installing to environment at tools/babel/bin/python3 Updated babel v2.6.0 -> v2.14.0 - babel==2.6.0 + babel==2.14.0 - pytz==2018.5 Installed 1 executable: pybabel + Installing to environment at tools/python-dotenv/bin/python3 Updated python-dotenv v0.10.2.post2 -> v1.0.1 - python-dotenv==0.10.2.post2 + python-dotenv==1.0.1 Installed 1 executable: dotenv - "###); + "#); } #[test] @@ -146,18 +152,19 @@ fn test_tool_upgrade_all() { .arg("https://test.pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/python-dotenv/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + python-dotenv==0.10.2.post2 Installed 1 executable: dotenv - "###); + "#); // Install `babel` from Test PyPI, to get an outdated version. uv_snapshot!(context.filters(), context.tool_install() @@ -166,19 +173,20 @@ fn test_tool_upgrade_all() { .arg("https://test.pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/babel/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + babel==2.6.0 + pytz==2018.5 Installed 1 executable: pybabel - "###); + "#); // Upgrade all from PyPI. uv_snapshot!(context.filters(), context.tool_upgrade() @@ -187,22 +195,24 @@ fn test_tool_upgrade_all() { .arg("https://pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + Installing to environment at tools/babel/bin/python3 Updated babel v2.6.0 -> v2.14.0 - babel==2.6.0 + babel==2.14.0 - pytz==2018.5 Installed 1 executable: pybabel + Installing to environment at tools/python-dotenv/bin/python3 Updated python-dotenv v0.10.2.post2 -> v1.0.1 - python-dotenv==0.10.2.post2 + python-dotenv==1.0.1 Installed 1 executable: dotenv - "###); + "#); } #[test] @@ -257,18 +267,19 @@ fn test_tool_upgrade_not_stop_if_upgrade_fails() -> anyhow::Result<()> { .arg("https://test.pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/python-dotenv/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + python-dotenv==0.10.2.post2 Installed 1 executable: dotenv - "###); + "#); // Install `babel` from Test PyPI, to get an outdated version. uv_snapshot!(context.filters(), context.tool_install() @@ -277,19 +288,20 @@ fn test_tool_upgrade_not_stop_if_upgrade_fails() -> anyhow::Result<()> { .arg("https://test.pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/babel/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + babel==2.6.0 + pytz==2018.5 Installed 1 executable: pybabel - "###); + "#); // Break the receipt for python-dotenv tool_dir @@ -304,19 +316,20 @@ fn test_tool_upgrade_not_stop_if_upgrade_fails() -> anyhow::Result<()> { .arg("https://pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + Installing to environment at tools/babel/bin/python3 Updated babel v2.6.0 -> v2.14.0 - babel==2.6.0 + babel==2.14.0 - pytz==2018.5 Installed 1 executable: pybabel Failed to upgrade `python-dotenv`: `python-dotenv` is missing a valid receipt; run `uv tool install --force python-dotenv` to reinstall - "###); + "#); Ok(()) } @@ -335,13 +348,14 @@ fn test_tool_upgrade_settings() { .arg("--resolution=lowest-direct") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/black/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + black==23.1.0 @@ -351,21 +365,22 @@ fn test_tool_upgrade_settings() { + pathspec==0.12.1 + platformdirs==4.2.0 Installed 2 executables: black, blackd - "###); + "#); // Upgrade `black`. This should be a no-op, since the resolution is set to `lowest-direct`. uv_snapshot!(context.filters(), context.tool_upgrade() .arg("black") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + Installing to environment at tools/black/bin/python3 Nothing to upgrade - "###); + "#); // Upgrade `black`, but override the resolution. uv_snapshot!(context.filters(), context.tool_upgrade() @@ -373,17 +388,18 @@ fn test_tool_upgrade_settings() { .arg("--resolution=highest") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + Installing to environment at tools/black/bin/python3 Updated black v23.1.0 -> v24.3.0 - black==23.1.0 + black==24.3.0 Installed 2 executables: black, blackd - "###); + "#); } #[test] @@ -401,19 +417,20 @@ fn test_tool_upgrade_respect_constraints() { .arg("https://test.pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/babel/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + babel==2.6.0 + pytz==2018.5 Installed 1 executable: pybabel - "###); + "#); // Upgrade `babel` from PyPI. It should be updated, but not beyond the constraint. uv_snapshot!(context.filters(), context.tool_upgrade() @@ -422,19 +439,20 @@ fn test_tool_upgrade_respect_constraints() { .arg("https://pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + Installing to environment at tools/babel/bin/python3 Updated babel v2.6.0 -> v2.9.1 - babel==2.6.0 + babel==2.9.1 - pytz==2018.5 + pytz==2024.1 Installed 1 executable: pybabel - "###); + "#); } #[test] @@ -452,19 +470,20 @@ fn test_tool_upgrade_constraint() { .arg("https://test.pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/babel/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + babel==2.6.0 + pytz==2018.5 Installed 1 executable: pybabel - "###); + "#); // Upgrade `babel`, but apply a constraint. uv_snapshot!(context.filters(), context.tool_upgrade() @@ -475,19 +494,20 @@ fn test_tool_upgrade_constraint() { .arg("babel<2.14.0") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + Installing to environment at tools/babel/bin/python3 Updated babel v2.6.0 -> v2.13.1 - babel==2.6.0 + babel==2.13.1 - pytz==2018.5 + setuptools==69.2.0 Installed 1 executable: pybabel - "###); + "#); // Upgrade `babel` without a constraint. uv_snapshot!(context.filters(), context.tool_upgrade() @@ -496,18 +516,19 @@ fn test_tool_upgrade_constraint() { .arg("https://pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + Installing to environment at tools/babel/bin/python3 Updated babel v2.13.1 -> v2.14.0 - babel==2.13.1 + babel==2.14.0 - setuptools==69.2.0 Installed 1 executable: pybabel - "###); + "#); // Passing `--upgrade` explicitly should warn. uv_snapshot!(context.filters(), context.tool_upgrade() @@ -517,15 +538,16 @@ fn test_tool_upgrade_constraint() { .arg("--upgrade") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- warning: `--upgrade` is enabled by default on `uv tool upgrade` + Installing to environment at tools/babel/bin/python3 Nothing to upgrade - "###); + "#); } /// Upgrade a tool, but only by upgrading one of it's `--with` dependencies, and not the tool @@ -545,19 +567,20 @@ fn test_tool_upgrade_with() { .arg("https://test.pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- Resolved [N] packages in [TIME] + Installing to environment at tools/babel/bin/python Prepared [N] packages in [TIME] Installed [N] packages in [TIME] + babel==2.6.0 + pytz==2018.5 Installed 1 executable: pybabel - "###); + "#); // Upgrade `babel` from PyPI. It shouldn't be updated, but `pytz` should be. uv_snapshot!(context.filters(), context.tool_upgrade() @@ -566,14 +589,15 @@ fn test_tool_upgrade_with() { .arg("https://pypi.org/simple/") .env("UV_TOOL_DIR", tool_dir.as_os_str()) .env("XDG_BIN_HOME", bin_dir.as_os_str()) - .env("PATH", bin_dir.as_os_str()), @r###" + .env("PATH", bin_dir.as_os_str()), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + Installing to environment at tools/babel/bin/python3 Modified babel environment - pytz==2018.5 + pytz==2024.1 - "###); + "#); } diff --git a/crates/uv/tests/tree.rs b/crates/uv/tests/tree.rs index 3f33ace8d6e0..d7e37bb6f752 100644 --- a/crates/uv/tests/tree.rs +++ b/crates/uv/tests/tree.rs @@ -26,7 +26,7 @@ fn nested_dependencies() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -39,8 +39,9 @@ fn nested_dependencies() -> Result<()> { └── threadpoolctl v3.4.0 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "### + "# ); // `uv tree` should update the lockfile @@ -68,7 +69,7 @@ fn invert() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.tree().arg("--invert"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--invert"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -84,11 +85,12 @@ fn invert() -> Result<()> { (*) Package tree already displayed ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "### + "# ); - uv_snapshot!(context.filters(), context.tree().arg("--invert").arg("--no-dedupe"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--invert").arg("--no-dedupe"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -106,8 +108,9 @@ fn invert() -> Result<()> { └── project v0.1.0 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "### + "# ); Ok(()) @@ -129,7 +132,7 @@ fn frozen() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -139,8 +142,9 @@ fn frozen() -> Result<()> { └── sniffio v1.3.1 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 4 packages in [TIME] - "### + "# ); // `uv tree` should update the lockfile @@ -161,7 +165,7 @@ fn frozen() -> Result<()> { )?; // Running with `--frozen` should show the stale tree. - uv_snapshot!(context.filters(), context.tree().arg("--frozen"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--frozen"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -171,7 +175,8 @@ fn frozen() -> Result<()> { └── sniffio v1.3.1 ----- stderr ----- - "### + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored + "# ); Ok(()) @@ -197,7 +202,7 @@ fn platform_dependencies() -> Result<()> { // When `--universal` is _not_ provided, `colorama` should _not_ be included. #[cfg(not(windows))] - uv_snapshot!(context.filters(), context.tree(), @r###" + uv_snapshot!(context.filters(), context.tree(), @r#" success: true exit_code: 0 ----- stdout ----- @@ -210,11 +215,12 @@ fn platform_dependencies() -> Result<()> { └── platformdirs v4.2.0 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] - "###); + "#); // Unless `--python-platform` is set to `windows`, in which case it should be included. - uv_snapshot!(context.filters(), context.tree().arg("--python-platform").arg("windows"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--python-platform").arg("windows"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -228,12 +234,13 @@ fn platform_dependencies() -> Result<()> { └── platformdirs v4.2.0 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] - "###); + "#); // When `--universal` is _not_ provided, should include `colorama`, even though it's only // included on Windows. - uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -247,8 +254,9 @@ fn platform_dependencies() -> Result<()> { └── platformdirs v4.2.0 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] - "### + "# ); // `uv tree` should update the lockfile @@ -278,7 +286,7 @@ fn repeated_dependencies() -> Result<()> { )?; // Should include both versions of `anyio`, which have different dependencies. - uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -292,8 +300,9 @@ fn repeated_dependencies() -> Result<()> { └── sniffio v1.3.1 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 6 packages in [TIME] - "### + "# ); // `uv tree` should update the lockfile @@ -351,7 +360,7 @@ fn repeated_version() -> Result<()> { Url::from_file_path(context.temp_dir.join("v2")).unwrap(), })?; - uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -366,8 +375,9 @@ fn repeated_version() -> Result<()> { └── sniffio v1.3.1 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 7 packages in [TIME] - "### + "# ); // `uv tree` should update the lockfile @@ -396,7 +406,7 @@ fn dev_dependencies() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -407,8 +417,9 @@ fn dev_dependencies() -> Result<()> { └── sniffio v1.3.1 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "### + "# ); // `uv tree` should update the lockfile @@ -436,7 +447,7 @@ fn dev_dependencies_inverted() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.tree().arg("--universal").arg("--invert"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--universal").arg("--invert"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -450,8 +461,9 @@ fn dev_dependencies_inverted() -> Result<()> { (*) Package tree already displayed ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 5 packages in [TIME] - "### + "# ); // `uv tree` should update the lockfile @@ -480,7 +492,7 @@ fn optional_dependencies() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--universal"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -501,8 +513,9 @@ fn optional_dependencies() -> Result<()> { └── sniffio v1.3.1 ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 14 packages in [TIME] - "### + "# ); // `uv tree` should update the lockfile @@ -531,7 +544,7 @@ fn optional_dependencies_inverted() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.tree().arg("--universal").arg("--invert"), @r###" + uv_snapshot!(context.filters(), context.tree().arg("--universal").arg("--invert"), @r#" success: true exit_code: 0 ----- stdout ----- @@ -560,8 +573,9 @@ fn optional_dependencies_inverted() -> Result<()> { (*) Package tree already displayed ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 14 packages in [TIME] - "### + "# ); // `uv tree` should update the lockfile diff --git a/crates/uv/tests/venv.rs b/crates/uv/tests/venv.rs index 83698045eb31..60b89aebe76c 100644 --- a/crates/uv/tests/venv.rs +++ b/crates/uv/tests/venv.rs @@ -86,16 +86,17 @@ fn create_venv_project_environment() -> Result<()> { )?; // But, if we're in a project we'll respect it - uv_snapshot!(context.filters(), context.venv().env("UV_PROJECT_ENVIRONMENT", "foo"), @r###" + uv_snapshot!(context.filters(), context.venv().env("UV_PROJECT_ENVIRONMENT", "foo"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `foo` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: foo Activate with: source foo/bin/activate - "### + "# ); context @@ -124,16 +125,17 @@ fn create_venv_project_environment() -> Result<()> { child.child(".venv").assert(predicates::path::is_dir()); // Or, if a name is provided - uv_snapshot!(context.filters(), context.venv().arg("bar"), @r###" + uv_snapshot!(context.filters(), context.venv().arg("bar"), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: bar Activate with: source bar/bin/activate - "### + "# ); context @@ -314,16 +316,17 @@ fn create_venv_respects_pyproject_requires_python() -> Result<()> { "# })?; - uv_snapshot!(context.filters(), context.venv(), @r###" + uv_snapshot!(context.filters(), context.venv(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.9.[X] interpreter at: [PYTHON-3.9] Creating virtualenv at: .venv Activate with: source .venv/bin/activate - "### + "# ); // With `requires-python = "==3.11.*"`, we prefer exact version (3.11) @@ -343,6 +346,7 @@ fn create_venv_respects_pyproject_requires_python() -> Result<()> { ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.11.[X] interpreter at: [PYTHON-3.11] Creating virtualenv at: .venv Activate with: source .venv/bin/activate @@ -366,6 +370,7 @@ fn create_venv_respects_pyproject_requires_python() -> Result<()> { ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.11.[X] interpreter at: [PYTHON-3.11] Creating virtualenv at: .venv Activate with: source .venv/bin/activate @@ -400,6 +405,7 @@ fn create_venv_respects_pyproject_requires_python() -> Result<()> { ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.11.[X] interpreter at: [PYTHON-3.11] Creating virtualenv at: .venv Activate with: source .venv/bin/activate @@ -423,6 +429,7 @@ fn create_venv_respects_pyproject_requires_python() -> Result<()> { ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.11.[X] interpreter at: [PYTHON-3.11] Creating virtualenv at: .venv Activate with: source .venv/bin/activate @@ -446,6 +453,7 @@ fn create_venv_respects_pyproject_requires_python() -> Result<()> { ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Creating virtualenv at: .venv Activate with: source .venv/bin/activate diff --git a/crates/uv/tests/workflow.rs b/crates/uv/tests/workflow.rs index f70e144ef439..dcc94b26c416 100644 --- a/crates/uv/tests/workflow.rs +++ b/crates/uv/tests/workflow.rs @@ -13,14 +13,15 @@ fn packse_add_remove_one_package() -> Result<()> { let context = TestContext::new("3.12"); context.copy_ecosystem_project("packse"); - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 49 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; insta::with_settings!({ @@ -222,14 +223,15 @@ fn packse_add_remove_existing_package_noop() -> Result<()> { let context = TestContext::new("3.12"); context.copy_ecosystem_project("packse"); - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 49 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; insta::with_settings!({ @@ -259,14 +261,15 @@ fn packse_promote_transitive_to_direct_then_remove() -> Result<()> { let context = TestContext::new("3.12"); context.copy_ecosystem_project("packse"); - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 49 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; insta::with_settings!({ @@ -418,14 +421,15 @@ fn jax_instability() -> Result<()> { "#, )?; - uv_snapshot!(context.filters(), context.lock(), @r###" + uv_snapshot!(context.filters(), context.lock(), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Resolved 8 packages in [TIME] - "###); + "#); let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?; insta::with_settings!({ diff --git a/crates/uv/tests/workspace.rs b/crates/uv/tests/workspace.rs index c9f4bca62600..dab766a36f8d 100644 --- a/crates/uv/tests/workspace.rs +++ b/crates/uv/tests/workspace.rs @@ -594,13 +594,14 @@ fn test_uv_run_isolate() -> Result<()> { .arg("--package") .arg("bird-feeder") .arg("check_installed_albatross.py") - .current_dir(&work_dir), @r###" + .current_dir(&work_dir), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- Resolved 8 packages in [TIME] + Installing to environment at [CACHE_DIR]/builds-v0/[TMP]/python Prepared 3 packages in [TIME] Installed 5 packages in [TIME] + anyio==4.3.0 @@ -612,7 +613,7 @@ fn test_uv_run_isolate() -> Result<()> { File "[TEMP_DIR]/albatross-root-workspace/check_installed_albatross.py", line 1, in from albatross import fly ModuleNotFoundError: No module named 'albatross' - "### + "# ); Ok(()) @@ -757,15 +758,16 @@ fn workspace_to_workspace_paths_dependencies() -> Result<()> { "#}; make_project(&other_workspace.join("packages").join("e"), "e", deps)?; - uv_snapshot!(context.filters(), context.lock().current_dir(&main_workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&main_workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 4 packages in [TIME] - "### + "# ); let lock: SourceLock = @@ -862,15 +864,16 @@ fn workspace_hidden_files() -> Result<()> { // ... and a hidden c. fs_err::create_dir_all(workspace.join("packages").join(".c"))?; - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 2 packages in [TIME] - "### + "# ); let lock: SourceLock = toml::from_str(&fs_err::read_to_string(workspace.join("uv.lock"))?)?; @@ -925,15 +928,16 @@ fn workspace_hidden_member() -> Result<()> { "}; make_project(&workspace.join("packages").join(".c"), "c", deps)?; - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 3 packages in [TIME] - "### + "# ); let lock: SourceLock = toml::from_str(&fs_err::read_to_string(workspace.join("uv.lock"))?)?; @@ -989,15 +993,16 @@ fn workspace_non_included_member() -> Result<()> { make_project(&workspace.join("c"), "c", deps)?; // Locking from `c` should not include any workspace members. - uv_snapshot!(context.filters(), context.lock().current_dir(workspace.join("c")), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(workspace.join("c")), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 1 package in [TIME] - "### + "# ); let lock: SourceLock = toml::from_str(&fs_err::read_to_string( @@ -1070,19 +1075,20 @@ fn workspace_inherit_sources() -> Result<()> { library.child("src/__init__.py").touch()?; // As-is, resolving should fail. - uv_snapshot!(context.filters(), context.lock().arg("--offline").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--offline").current_dir(&workspace), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] × No solution found when resolving dependencies: ╰─▶ Because library was not found in the cache and leaf depends on library, we can conclude that leaf's requirements are unsatisfiable. And because your workspace requires leaf, we can conclude that your workspace's requirements are unsatisfiable. hint: Packages were unavailable because the network was disabled. When the network is disabled, registry packages may only be read from the cache. - "### + "# ); // Update the leaf to include the source. @@ -1102,15 +1108,16 @@ fn workspace_inherit_sources() -> Result<()> { leaf.child("src/__init__.py").touch()?; // Resolving should succeed. - uv_snapshot!(context.filters(), context.lock().arg("--offline").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--offline").current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 3 packages in [TIME] - "### + "# ); // Revert that change. @@ -1145,15 +1152,16 @@ fn workspace_inherit_sources() -> Result<()> { "#})?; // Resolving should succeed. - uv_snapshot!(context.filters(), context.lock().arg("--offline").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--offline").current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 3 packages in [TIME] - "### + "# ); let lock = fs_err::read_to_string(workspace.join("uv.lock")).unwrap(); @@ -1236,15 +1244,16 @@ fn workspace_inherit_sources() -> Result<()> { // Resolving should succeed; the member should still use the root's source, despite defining // some of its own - uv_snapshot!(context.filters(), context.lock().arg("--offline").current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--offline").current_dir(&workspace), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 3 packages in [TIME] - "### + "# ); Ok(()) @@ -1289,17 +1298,18 @@ fn workspace_unsatisfiable_member_dependencies() -> Result<()> { leaf.child("src/__init__.py").touch()?; // Resolving should fail. - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] × No solution found when resolving dependencies: ╰─▶ Because only httpx<=1.0.0b0 is available and leaf depends on httpx>9999, we can conclude that leaf's requirements are unsatisfiable. And because your workspace requires leaf, we can conclude that your workspace's requirements are unsatisfiable. - "### + "# ); Ok(()) @@ -1357,17 +1367,18 @@ fn workspace_unsatisfiable_member_dependencies_conflicting() -> Result<()> { bar.child("src/__init__.py").touch()?; // Resolving should fail. - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] × No solution found when resolving dependencies: ╰─▶ Because bar depends on anyio==4.2.0 and foo depends on anyio==4.1.0, we can conclude that bar and foo are incompatible. And because your workspace requires bar and foo, we can conclude that your workspace's requirements are unsatisfiable. - "### + "# ); Ok(()) @@ -1440,17 +1451,18 @@ fn workspace_unsatisfiable_member_dependencies_conflicting_threeway() -> Result< bird.child("src/__init__.py").touch()?; // Resolving should fail. - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] × No solution found when resolving dependencies: ╰─▶ Because bird depends on anyio==4.3.0 and knot depends on anyio==4.2.0, we can conclude that bird and knot are incompatible. And because your workspace requires bird and knot, we can conclude that your workspace's requirements are unsatisfiable. - "### + "# ); Ok(()) @@ -1510,17 +1522,18 @@ fn workspace_unsatisfiable_member_dependencies_conflicting_extra() -> Result<()> bar.child("src/__init__.py").touch()?; // Resolving should fail. - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] × No solution found when resolving dependencies: ╰─▶ Because bar[some-extra] depends on anyio==4.2.0 and foo depends on anyio==4.1.0, we can conclude that foo and bar[some-extra] are incompatible. And because your workspace requires bar[some-extra] and foo, we can conclude that your workspace's requirements are unsatisfiable. - "### + "# ); Ok(()) @@ -1580,18 +1593,19 @@ fn workspace_unsatisfiable_member_dependencies_conflicting_dev() -> Result<()> { bar.child("src/__init__.py").touch()?; // Resolving should fail. - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] × No solution found when resolving dependencies: ╰─▶ Because bar depends on bar:dev and bar:dev depends on anyio==4.2.0, we can conclude that bar depends on anyio==4.2.0. And because foo depends on anyio==4.1.0, we can conclude that bar and foo are incompatible. And because your workspace requires bar and foo, we can conclude that your workspace's requirements are unsatisfiable. - "### + "# ); Ok(()) @@ -1652,17 +1666,18 @@ fn workspace_member_name_shadows_dependencies() -> Result<()> { // We should fail // TODO(zanieb): This error message is bad? - uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r###" + uv_snapshot!(context.filters(), context.lock().current_dir(&workspace), @r#" success: false exit_code: 2 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] error: Failed to build: `foo @ file://[TEMP_DIR]/workspace/packages/foo` Caused by: Failed to parse entry for: `anyio` Caused by: Package is not included as workspace package in `tool.uv.workspace` - "### + "# ); Ok(()) @@ -1696,15 +1711,16 @@ fn test_path_hopping() -> Result<()> { // ... that depends on bar, a stub project. make_project(&context.temp_dir.join("libs").join("bar"), "bar", "")?; - uv_snapshot!(context.filters(), context.lock().arg("--preview").current_dir(&main_project_dir), @r###" + uv_snapshot!(context.filters(), context.lock().arg("--preview").current_dir(&main_project_dir), @r#" success: true exit_code: 0 ----- stdout ----- ----- stderr ----- + warning: `VIRTUAL_ENV=[WORKSPACE]/.venv` does not match the project environment path `.venv` and will be ignored Using Python 3.12.[X] interpreter at: [PYTHON-3.12] Resolved 3 packages in [TIME] - "### + "# ); let lock: SourceLock =