diff --git a/crates/uv/tests/pip_compile_scenarios.rs b/crates/uv/tests/pip_compile_scenarios.rs index 00787f107..7398d84b1 100644 --- a/crates/uv/tests/pip_compile_scenarios.rs +++ b/crates/uv/tests/pip_compile_scenarios.rs @@ -1,6 +1,6 @@ //! DO NOT EDIT //! -//! Generated with ./scripts/scenarios/sync.sh +//! Generated with `./scripts/sync_scenarios.sh` //! Scenarios from //! #![cfg(all(feature = "python", feature = "pypi"))] diff --git a/crates/uv/tests/pip_install_scenarios.rs b/crates/uv/tests/pip_install_scenarios.rs index e9e85a949..c2cbcb85c 100644 --- a/crates/uv/tests/pip_install_scenarios.rs +++ b/crates/uv/tests/pip_install_scenarios.rs @@ -1,6 +1,6 @@ //! DO NOT EDIT //! -//! Generated with ./scripts/scenarios/sync.sh +//! Generated with `./scripts/sync_scenarios.sh` //! Scenarios from //! #![cfg(all(feature = "python", feature = "pypi"))] diff --git a/scripts/scenarios/generate.py b/scripts/scenarios/generate.py index 8574a5fc5..37bd180e3 100755 --- a/scripts/scenarios/generate.py +++ b/scripts/scenarios/generate.py @@ -4,7 +4,7 @@ Generates and updates snapshot test cases from packse scenarios. Important: - This script is the backend called by `./scripts/scenarios/sync.sh`, consider using that + This script is the backend called by `./scripts/sync_scenarios.sh`, consider using that if not developing scenarios. Requirements: @@ -170,7 +170,7 @@ def main(scenarios: list[Path], snapshot_update: bool = True): data["generated_from"] = ( f"https://github.com/zanieb/packse/tree/{ref}/scenarios" ) - data["generated_with"] = "./scripts/scenarios/sync.sh" + data["generated_with"] = "./scripts/sync_scenarios.sh" data["vendor_links"] = ( f"https://raw.githubusercontent.com/zanieb/packse/{ref}/vendor/links.html" ) diff --git a/scripts/scenarios/templates/compile.mustache b/scripts/scenarios/templates/compile.mustache index fa18d1573..6a21783e1 100644 --- a/scripts/scenarios/templates/compile.mustache +++ b/scripts/scenarios/templates/compile.mustache @@ -1,6 +1,6 @@ //! DO NOT EDIT //! -//! Generated with {{generated_with}} +//! Generated with `{{generated_with}}` //! Scenarios from <{{generated_from}}> //! #![cfg(all(feature = "python", feature = "pypi"))] @@ -13,7 +13,7 @@ use assert_cmd::assert::OutputAssertExt; use assert_fs::fixture::{FileWriteStr, PathChild}; use predicates::prelude::predicate; -use common::{create_bin_with_executables, get_bin, uv_snapshot, TestContext, INSTA_FILTERS}; +use common::{create_bin_with_executables, get_bin, uv_snapshot, TestContext}; mod common; diff --git a/scripts/scenarios/templates/install.mustache b/scripts/scenarios/templates/install.mustache index 3d39720de..06517014f 100644 --- a/scripts/scenarios/templates/install.mustache +++ b/scripts/scenarios/templates/install.mustache @@ -1,6 +1,6 @@ //! DO NOT EDIT //! -//! Generated with {{generated_with}} +//! Generated with `{{generated_with}}` //! Scenarios from <{{generated_from}}> //! #![cfg(all(feature = "python", feature = "pypi"))] @@ -11,7 +11,7 @@ use std::process::Command; use assert_cmd::assert::Assert; use assert_cmd::prelude::*; -use common::{venv_to_interpreter, INSTA_FILTERS}; +use common::{venv_to_interpreter}; use crate::common::{get_bin, uv_snapshot, TestContext}; diff --git a/scripts/scenarios/sync.sh b/scripts/sync_scenarios.sh similarity index 78% rename from scripts/scenarios/sync.sh rename to scripts/sync_scenarios.sh index bf6e4772b..80a253a37 100755 --- a/scripts/scenarios/sync.sh +++ b/scripts/sync_scenarios.sh @@ -19,7 +19,8 @@ set -eu script_root="$(realpath "$(dirname "$0")")" -cd "$script_root" + +cd "$script_root/scenarios" echo "Setting up a temporary environment..." uv venv @@ -27,9 +28,9 @@ source ".venv/bin/activate" uv pip install -r requirements.txt --refresh-package packse echo "Fetching packse scenarios..." -packse fetch --dest "$script_root/scenarios" --force +packse fetch --dest "$script_root/scenarios/.downloads" --force -python "$script_root/generate.py" "$script_root/scenarios" "$@" +python "$script_root/scenarios/generate.py" "$script_root/scenarios/.downloads" "$@" # Cleanup -rm -r "$script_root/scenarios" +rm -r "$script_root/scenarios/.downloads"