mirror of https://github.com/astral-sh/uv
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:
parent
4838c4da0a
commit
20d4762776
|
|
@ -1,6 +1,6 @@
|
||||||
//! DO NOT EDIT
|
//! 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>
|
//! Scenarios from <https://github.com/zanieb/packse/tree/0.3.12/scenarios>
|
||||||
//!
|
//!
|
||||||
#![cfg(all(feature = "python", feature = "pypi"))]
|
#![cfg(all(feature = "python", feature = "pypi"))]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
//! DO NOT EDIT
|
//! 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>
|
//! Scenarios from <https://github.com/zanieb/packse/tree/0.3.12/scenarios>
|
||||||
//!
|
//!
|
||||||
#![cfg(all(feature = "python", feature = "pypi"))]
|
#![cfg(all(feature = "python", feature = "pypi"))]
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ Generates and updates snapshot test cases from packse scenarios.
|
||||||
|
|
||||||
Important:
|
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.
|
if not developing scenarios.
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
@ -170,7 +170,7 @@ def main(scenarios: list[Path], snapshot_update: bool = True):
|
||||||
data["generated_from"] = (
|
data["generated_from"] = (
|
||||||
f"https://github.com/zanieb/packse/tree/{ref}/scenarios"
|
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"] = (
|
data["vendor_links"] = (
|
||||||
f"https://raw.githubusercontent.com/zanieb/packse/{ref}/vendor/links.html"
|
f"https://raw.githubusercontent.com/zanieb/packse/{ref}/vendor/links.html"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
//! DO NOT EDIT
|
//! DO NOT EDIT
|
||||||
//!
|
//!
|
||||||
//! Generated with {{generated_with}}
|
//! Generated with `{{generated_with}}`
|
||||||
//! Scenarios from <{{generated_from}}>
|
//! Scenarios from <{{generated_from}}>
|
||||||
//!
|
//!
|
||||||
#![cfg(all(feature = "python", feature = "pypi"))]
|
#![cfg(all(feature = "python", feature = "pypi"))]
|
||||||
|
|
@ -13,7 +13,7 @@ use assert_cmd::assert::OutputAssertExt;
|
||||||
use assert_fs::fixture::{FileWriteStr, PathChild};
|
use assert_fs::fixture::{FileWriteStr, PathChild};
|
||||||
use predicates::prelude::predicate;
|
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;
|
mod common;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
//! DO NOT EDIT
|
//! DO NOT EDIT
|
||||||
//!
|
//!
|
||||||
//! Generated with {{generated_with}}
|
//! Generated with `{{generated_with}}`
|
||||||
//! Scenarios from <{{generated_from}}>
|
//! Scenarios from <{{generated_from}}>
|
||||||
//!
|
//!
|
||||||
#![cfg(all(feature = "python", feature = "pypi"))]
|
#![cfg(all(feature = "python", feature = "pypi"))]
|
||||||
|
|
@ -11,7 +11,7 @@ use std::process::Command;
|
||||||
use assert_cmd::assert::Assert;
|
use assert_cmd::assert::Assert;
|
||||||
use assert_cmd::prelude::*;
|
use assert_cmd::prelude::*;
|
||||||
|
|
||||||
use common::{venv_to_interpreter, INSTA_FILTERS};
|
use common::{venv_to_interpreter};
|
||||||
|
|
||||||
use crate::common::{get_bin, uv_snapshot, TestContext};
|
use crate::common::{get_bin, uv_snapshot, TestContext};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,8 @@ set -eu
|
||||||
|
|
||||||
script_root="$(realpath "$(dirname "$0")")"
|
script_root="$(realpath "$(dirname "$0")")"
|
||||||
|
|
||||||
cd "$script_root"
|
|
||||||
|
cd "$script_root/scenarios"
|
||||||
echo "Setting up a temporary environment..."
|
echo "Setting up a temporary environment..."
|
||||||
uv venv
|
uv venv
|
||||||
|
|
||||||
|
|
@ -27,9 +28,9 @@ source ".venv/bin/activate"
|
||||||
uv pip install -r requirements.txt --refresh-package packse
|
uv pip install -r requirements.txt --refresh-package packse
|
||||||
|
|
||||||
echo "Fetching packse scenarios..."
|
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
|
# Cleanup
|
||||||
rm -r "$script_root/scenarios"
|
rm -r "$script_root/scenarios/.downloads"
|
||||||
Loading…
Reference in New Issue