uv/scripts/scenarios/sync.sh
Zanie Blue fd03362520
Use released packse for scenario updates (#2256)
- Now that `packse` is being published to PyPI we can install it from
there.
- Tweaks the tooling around scenario updates to manage a temporary
virtual environment for you.
- Makes use of a new index URL
- Includes local version segment scenarios (supersedes
https://github.com/astral-sh/uv/pull/2022)
2024-03-07 11:40:54 -06:00

35 lines
992 B
Bash
Executable file

#!/usr/bin/env bash
#
# Sync test scenarios with the pinned version of packse.
#
# Usage:
#
# Install the pinned packse version in a temporary virtual environment, fetch scenarios, and regenerate test cases and snapshots:
#
# $ ./scripts/scenarios/sync.sh
#
# Additional arguments are passed to `./scripts/scenarios/generate.py`, for example:
#
# $ ./scripts/scenarios/sync.sh --verbose --no-snapshot-update
#
# For development purposes, the `./scripts/scenarios/generate.py` script can be used directly to generate
# test cases from a local set of scenarios.
set -eu
script_root="$(realpath "$(dirname "$0")")"
cd "$script_root"
echo "Setting up a temporary environment..."
uv venv
source ".venv/bin/activate"
uv pip install -r requirements.txt --refresh-package packse
echo "Fetching packse scenarios..."
packse fetch --dest "$script_root/scenarios" --force
python "$script_root/generate.py" "$script_root/scenarios" "$@"
# Cleanup
rm -r "$script_root/scenarios"