mirror of https://github.com/astral-sh/uv
Include permalink to scenarios used to generate test cases (#767)
This commit is contained in:
parent
0bdd831a0d
commit
e18a6a0c03
|
|
@ -1,6 +1,9 @@
|
||||||
#![cfg(all(feature = "python", feature = "pypi"))]
|
#![cfg(all(feature = "python", feature = "pypi"))]
|
||||||
|
|
||||||
/// Generated by `./scripts/scenarios/update.py`
|
/// DO NOT EDIT
|
||||||
|
///
|
||||||
|
/// GENERATED WITH `./scripts/scenarios/update.py`
|
||||||
|
/// SCENARIOS FROM `https://github.com/zanieb/packse/tree/682bf4ff269f130f92bf35fdb58b6b27c94b579a/scenarios`
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
|
|
||||||
#![cfg(all(feature = "python", feature = "pypi"))]
|
#![cfg(all(feature = "python", feature = "pypi"))]
|
||||||
|
|
||||||
/// {{generated_by}}
|
/// DO NOT EDIT
|
||||||
|
///
|
||||||
|
/// GENERATED WITH `{{generated_with}}`
|
||||||
|
/// SCENARIOS FROM `{{generated_from}}`
|
||||||
|
|
||||||
|
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
#
|
#
|
||||||
# $ scripts/scenarios/update.py
|
# $ ./scripts/scenarios/update.py
|
||||||
#
|
#
|
||||||
# Requirements:
|
# Requirements:
|
||||||
#
|
#
|
||||||
|
|
@ -84,10 +84,12 @@ if packse.__development_base_path__.name != "packse":
|
||||||
)
|
)
|
||||||
scenarios_path = str(PACKSE / "scenarios")
|
scenarios_path = str(PACKSE / "scenarios")
|
||||||
else:
|
else:
|
||||||
print("Using local packse scenarios...", file=sys.stderr)
|
print(
|
||||||
|
f"Using scenarios in packse repository at {packse.__development_base_path__}",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
scenarios_path = str(packse.__development_base_path__ / "scenarios")
|
scenarios_path = str(packse.__development_base_path__ / "scenarios")
|
||||||
|
|
||||||
|
|
||||||
print("Loading scenario metadata...", file=sys.stderr)
|
print("Loading scenario metadata...", file=sys.stderr)
|
||||||
data = json.loads(
|
data = json.loads(
|
||||||
subprocess.check_output(
|
subprocess.check_output(
|
||||||
|
|
@ -99,8 +101,17 @@ data = json.loads(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add a generated note
|
# Add generated metadata
|
||||||
data["generated_by"] = f"Generated by `{' '.join(sys.argv)}`"
|
commit = (
|
||||||
|
subprocess.check_output(
|
||||||
|
["git", "show", "-s", "--format=%H", "HEAD"], cwd=scenarios_path
|
||||||
|
)
|
||||||
|
.decode()
|
||||||
|
.strip()
|
||||||
|
)
|
||||||
|
data["generated_from"] = f"https://github.com/zanieb/packse/tree/{commit}/scenarios"
|
||||||
|
data["generated_with"] = " ".join(sys.argv)
|
||||||
|
|
||||||
|
|
||||||
# Add normalized names for tests
|
# Add normalized names for tests
|
||||||
for scenario in data["scenarios"]:
|
for scenario in data["scenarios"]:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue