Skip to content

Commit 59efe06

Browse files
authored
Update more tests not to use Python 3.8 (#13755)
## Summary Update a few more tests to avoid using Python 3.8 unnecessarily. From what I can see, neither of these really need that specific Python version, so just update them to use 3.9 instead. Bug #13676 ## Test Plan Uninstall Python 3.8 and run: `cargo test --no-default-features --features git,pypi,python` One test failure remains.
1 parent 9423f05 commit 59efe06

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

crates/uv/tests/it/init.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,7 +2408,7 @@ fn init_requires_python_version() -> Result<()> {
24082408
/// specifiers verbatim.
24092409
#[test]
24102410
fn init_requires_python_specifiers() -> Result<()> {
2411-
let context = TestContext::new_with_versions(&["3.8", "3.12"]);
2411+
let context = TestContext::new_with_versions(&["3.9", "3.12"]);
24122412

24132413
let pyproject_toml = context.temp_dir.child("pyproject.toml");
24142414
pyproject_toml.write_str(indoc! {
@@ -2424,7 +2424,7 @@ fn init_requires_python_specifiers() -> Result<()> {
24242424
})?;
24252425

24262426
let child = context.temp_dir.join("foo");
2427-
uv_snapshot!(context.filters(), context.init().current_dir(&context.temp_dir).arg(&child).arg("--python").arg("==3.8.*"), @r###"
2427+
uv_snapshot!(context.filters(), context.init().current_dir(&context.temp_dir).arg(&child).arg("--python").arg("==3.9.*"), @r###"
24282428
success: true
24292429
exit_code: 0
24302430
----- stdout -----
@@ -2445,7 +2445,7 @@ fn init_requires_python_specifiers() -> Result<()> {
24452445
version = "0.1.0"
24462446
description = "Add your description here"
24472447
readme = "README.md"
2448-
requires-python = "==3.8.*"
2448+
requires-python = "==3.9.*"
24492449
dependencies = []
24502450
"###
24512451
);
@@ -2456,7 +2456,7 @@ fn init_requires_python_specifiers() -> Result<()> {
24562456
filters => context.filters(),
24572457
}, {
24582458
assert_snapshot!(
2459-
python_version, @"3.8"
2459+
python_version, @"3.9"
24602460
);
24612461
});
24622462

@@ -2503,7 +2503,7 @@ fn init_requires_python_version_file() -> Result<()> {
25032503
/// Run `uv init`, inferring the Python version from an existing `.venv`
25042504
#[test]
25052505
fn init_existing_environment() -> Result<()> {
2506-
let context = TestContext::new_with_versions(&["3.8", "3.12"]);
2506+
let context = TestContext::new_with_versions(&["3.9", "3.12"]);
25072507

25082508
let child = context.temp_dir.child("foo");
25092509
child.create_dir_all()?;
@@ -2552,7 +2552,7 @@ fn init_existing_environment() -> Result<()> {
25522552
/// Run `uv init`, it should ignore a the Python version from a parent `.venv`
25532553
#[test]
25542554
fn init_existing_environment_parent() -> Result<()> {
2555-
let context = TestContext::new_with_versions(&["3.8", "3.12"]);
2555+
let context = TestContext::new_with_versions(&["3.9", "3.12"]);
25562556

25572557
// Create a new virtual environment in the parent directory
25582558
uv_snapshot!(context.filters(), context.venv().current_dir(&context.temp_dir).arg("--python").arg("3.12"), @r###"
@@ -2588,7 +2588,7 @@ fn init_existing_environment_parent() -> Result<()> {
25882588
version = "0.1.0"
25892589
description = "Add your description here"
25902590
readme = "README.md"
2591-
requires-python = ">=3.8"
2591+
requires-python = ">=3.9"
25922592
dependencies = []
25932593
"###
25942594
);

crates/uv/tests/it/run.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,7 +2732,7 @@ fn run_without_output() -> Result<()> {
27322732
/// Ensure that we can import from the root project when layering `--with` requirements.
27332733
#[test]
27342734
fn run_isolated_python_version() -> Result<()> {
2735-
let context = TestContext::new_with_versions(&["3.8", "3.12"]);
2735+
let context = TestContext::new_with_versions(&["3.9", "3.12"]);
27362736

27372737
let pyproject_toml = context.temp_dir.child("pyproject.toml");
27382738
pyproject_toml.write_str(indoc! { r#"
@@ -2766,10 +2766,10 @@ fn run_isolated_python_version() -> Result<()> {
27662766
success: true
27672767
exit_code: 0
27682768
----- stdout -----
2769-
(3, 8)
2769+
(3, 9)
27702770
27712771
----- stderr -----
2772-
Using CPython 3.8.[X] interpreter at: [PYTHON-3.8]
2772+
Using CPython 3.9.[X] interpreter at: [PYTHON-3.9]
27732773
Creating virtual environment at: .venv
27742774
Resolved 6 packages in [TIME]
27752775
Prepared 6 packages in [TIME]
@@ -2786,7 +2786,7 @@ fn run_isolated_python_version() -> Result<()> {
27862786
success: true
27872787
exit_code: 0
27882788
----- stdout -----
2789-
(3, 8)
2789+
(3, 9)
27902790
27912791
----- stderr -----
27922792
Resolved 6 packages in [TIME]
@@ -3281,7 +3281,7 @@ fn run_exit_code() -> Result<()> {
32813281

32823282
#[test]
32833283
fn run_invalid_project_table() -> Result<()> {
3284-
let context = TestContext::new_with_versions(&["3.12", "3.11", "3.8"]);
3284+
let context = TestContext::new_with_versions(&["3.12"]);
32853285

32863286
let pyproject_toml = context.temp_dir.child("pyproject.toml");
32873287
pyproject_toml.write_str(indoc! { r#"

crates/uv/tests/it/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8000,7 +8000,7 @@ fn sync_dry_run_and_frozen() -> Result<()> {
80008000

80018001
#[test]
80028002
fn sync_script() -> Result<()> {
8003-
let context = TestContext::new_with_versions(&["3.8", "3.12"]);
8003+
let context = TestContext::new_with_versions(&["3.9", "3.12"]);
80048004

80058005
let script = context.temp_dir.child("script.py");
80068006
script.write_str(indoc! { r#"
@@ -8150,7 +8150,7 @@ fn sync_script() -> Result<()> {
81508150

81518151
#[test]
81528152
fn sync_locked_script() -> Result<()> {
8153-
let context = TestContext::new_with_versions(&["3.8", "3.12"]);
8153+
let context = TestContext::new_with_versions(&["3.9", "3.12"]);
81548154

81558155
let script = context.temp_dir.child("script.py");
81568156
script.write_str(indoc! { r#"

0 commit comments

Comments
 (0)