Move scenario sync script to top-level scripts (#2788)

Same idea as https://github.com/astral-sh/uv/pull/2787
This commit is contained in:
Zanie Blue 2024-04-02 18:27:05 -05:00 committed by GitHub
parent 4838c4da0a
commit 20d4762776
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 13 additions and 12 deletions

View file

@ -1,6 +1,6 @@
//! DO NOT EDIT
//!
//! Generated with ./scripts/scenarios/sync.sh
//! Generated with `./scripts/sync_scenarios.sh`
//! Scenarios from <https://github.com/zanieb/packse/tree/0.3.12/scenarios>
//!
#![cfg(all(feature = "python", feature = "pypi"))]

View file

@ -1,6 +1,6 @@
//! DO NOT EDIT
//!
//! Generated with ./scripts/scenarios/sync.sh
//! Generated with `./scripts/sync_scenarios.sh`
//! Scenarios from <https://github.com/zanieb/packse/tree/0.3.12/scenarios>
//!
#![cfg(all(feature = "python", feature = "pypi"))]

View file

@ -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"
)

View file

@ -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;

View file

@ -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};

View file

@ -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"