From 0cd6b7be8cd01adc8f4aa87a2f8dac170d3e5feb Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 12 Feb 2024 12:51:49 -0600 Subject: [PATCH] Fix incompatible wheel test scenarios (#1284) I had specified the tags incorrectly https://github.com/zanieb/packse/pull/105 --- crates/puffin/tests/pip_compile_scenarios.rs | 2 +- crates/puffin/tests/pip_install_scenarios.rs | 51 +++++++++++++++++--- scripts/scenarios/update.py | 4 +- 3 files changed, 47 insertions(+), 10 deletions(-) diff --git a/crates/puffin/tests/pip_compile_scenarios.rs b/crates/puffin/tests/pip_compile_scenarios.rs index c26a03630..d015fbba9 100644 --- a/crates/puffin/tests/pip_compile_scenarios.rs +++ b/crates/puffin/tests/pip_compile_scenarios.rs @@ -1,7 +1,7 @@ //! DO NOT EDIT //! //! Generated with ./scripts/scenarios/update.py -//! Scenarios from +//! Scenarios from //! #![cfg(all(feature = "python", feature = "pypi"))] diff --git a/crates/puffin/tests/pip_install_scenarios.rs b/crates/puffin/tests/pip_install_scenarios.rs index 694c2de91..5548f6894 100644 --- a/crates/puffin/tests/pip_install_scenarios.rs +++ b/crates/puffin/tests/pip_install_scenarios.rs @@ -1,7 +1,7 @@ //! DO NOT EDIT //! //! Generated with ./scripts/scenarios/update.py -//! Scenarios from +//! Scenarios from //! #![cfg(all(feature = "python", feature = "pypi"))] @@ -2418,10 +2418,10 @@ fn no_wheels() { /// no-wheels-with-matching-platform /// -/// No wheels with valid tags are available, just source distributions. +/// No wheels with matching platform tags are available, just source distributions. /// /// ```text -/// 0c9f8397 +/// f1a1f15c /// ├── environment /// │ └── python3.8 /// ├── root @@ -2436,11 +2436,11 @@ fn no_wheels_with_matching_platform() { // In addition to the standard filters, swap out package names for more realistic messages let mut filters = INSTA_FILTERS.to_vec(); - filters.push((r"a-0c9f8397", "albatross")); - filters.push((r"-0c9f8397", "")); + filters.push((r"a-f1a1f15c", "albatross")); + filters.push((r"-f1a1f15c", "")); puffin_snapshot!(filters, command(&context) - .arg("a-0c9f8397") + .arg("a-f1a1f15c") , @r###" success: true exit_code: 0 @@ -2454,6 +2454,45 @@ fn no_wheels_with_matching_platform() { "###); } +/// no-sdist-no-wheels-with-matching-platform +/// +/// No wheels with matching platform tags are available, nor are any source +/// distributions available +/// +/// ```text +/// af6bcec1 +/// ├── environment +/// │ └── python3.8 +/// ├── root +/// │ └── requires a +/// │ └── satisfied by a-1.0.0 +/// └── a +/// └── a-1.0.0 +/// ``` +#[test] +fn no_sdist_no_wheels_with_matching_platform() { + let context = TestContext::new("3.8"); + + // In addition to the standard filters, swap out package names for more realistic messages + let mut filters = INSTA_FILTERS.to_vec(); + filters.push((r"a-af6bcec1", "albatross")); + filters.push((r"-af6bcec1", "")); + + puffin_snapshot!(filters, command(&context) + .arg("a-af6bcec1") + , @r###" + success: false + exit_code: 1 + ----- stdout ----- + + ----- stderr ----- + × No solution found when resolving dependencies: + ╰─▶ Because there are no versions of albatross and you require albatross, we can conclude that the requirements are unsatisfiable. + "###); + + assert_not_installed(&context.venv, "a_af6bcec1", &context.temp_dir); +} + /// no-wheels-no-build /// /// No wheels are available, only source distributions but the user has disabled diff --git a/scripts/scenarios/update.py b/scripts/scenarios/update.py index e70421c62..374da89ea 100755 --- a/scripts/scenarios/update.py +++ b/scripts/scenarios/update.py @@ -45,7 +45,7 @@ import textwrap from pathlib import Path -PACKSE_COMMIT = "c2ddf2466db9bfdcb72de3ec04b393667f2bfe28" +PACKSE_COMMIT = "a2c483f055f5cb01fbbbcf9189c238ee487a7a8e" TOOL_ROOT = Path(__file__).parent TEMPLATES = TOOL_ROOT / "templates" INSTALL_TEMPLATE = TEMPLATES / "install.mustache" @@ -164,8 +164,6 @@ data["scenarios"] = [ for scenario in data["scenarios"] # Drop the example scenario if scenario["name"] != "example" - # TODO(zanieb): Restore this scenario - and scenario["name"] != "no-sdist-no-wheels-with-matching-platform" ] # Wrap the description onto multiple lines