From 42a35b59cd86c0b8d4ec09eb22913bdba5599df8 Mon Sep 17 00:00:00 2001 From: konsti Date: Wed, 4 Dec 2024 15:17:18 +0100 Subject: [PATCH] Fix lock_requires_python_exact perf (#9551) When running `lock_requires_python_exact`, we would download CPython 3.12.0 each time. By instead downloading CPython 3.13.0 ahead of time and passing it in, we speed the test up and avoid timeouts. Locally in pycharm, the test goes from 6.5s to 500ms. --- crates/uv/tests/it/lock.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/uv/tests/it/lock.rs b/crates/uv/tests/it/lock.rs index a814220bb..190e338ed 100644 --- a/crates/uv/tests/it/lock.rs +++ b/crates/uv/tests/it/lock.rs @@ -3789,9 +3789,10 @@ fn lock_requires_python_upper() -> Result<()> { } /// Lock a requirement from PyPI with an exact Python bound. +#[cfg(feature = "python-patch")] #[test] fn lock_requires_python_exact() -> Result<()> { - let context = TestContext::new("3.12"); + let context = TestContext::new("3.13.0"); let lockfile = context.temp_dir.join("uv.lock"); @@ -3801,7 +3802,7 @@ fn lock_requires_python_exact() -> Result<()> { [project] name = "warehouse" version = "1.0.0" - requires-python = "==3.12" + requires-python = "==3.13" dependencies = ["iniconfig"] [build-system] @@ -3816,8 +3817,7 @@ fn lock_requires_python_exact() -> Result<()> { ----- stdout ----- ----- stderr ----- - Using CPython 3.12.[X] - warning: The workspace `requires-python` value (`==3.12`) contains an exact match without a patch version. When omitted, the patch version is implicitly `0` (e.g., `==3.12.[X]`). Did you mean `==3.12.*`? + warning: The workspace `requires-python` value (`==3.13`) contains an exact match without a patch version. When omitted, the patch version is implicitly `0` (e.g., `==3.13.0`). Did you mean `==3.13.*`? Resolved 2 packages in [TIME] "###); @@ -3829,7 +3829,7 @@ fn lock_requires_python_exact() -> Result<()> { assert_snapshot!( lock, @r###" version = 1 - requires-python = "==3.12" + requires-python = "==3.13" [options] exclude-newer = "2024-03-25T00:00:00Z" @@ -3864,8 +3864,7 @@ fn lock_requires_python_exact() -> Result<()> { ----- stdout ----- ----- stderr ----- - Using CPython 3.12.[X] - warning: The workspace `requires-python` value (`==3.12`) contains an exact match without a patch version. When omitted, the patch version is implicitly `0` (e.g., `==3.12.[X]`). Did you mean `==3.12.*`? + warning: The workspace `requires-python` value (`==3.13`) contains an exact match without a patch version. When omitted, the patch version is implicitly `0` (e.g., `==3.13.0`). Did you mean `==3.13.*`? Resolved 2 packages in [TIME] "###);