Repository navigation
Expand file tree
/
Copy pathci.sh
More file actions
executable file
·41 lines (33 loc) · 1.62 KB
/
Copy pathci.sh
File metadata and controls
executable file
·41 lines (33 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# Installs locked dependencies, checks lint and types, and runs integration tests with $DEXCLI.
set -euo pipefail
: "${DEXCLI:?set DEXCLI to the dexcli executable}"
DEXCLI="$(cd "$(dirname "$DEXCLI")" && pwd)/$(basename "$DEXCLI")"
export DEXCLI
cd "$(dirname "$0")"
uv sync --locked
# Each framework package comes from the registry at the version its Dex package's lock pins.
uv run --frozen python - <<'PY'
import importlib.metadata
import tomllib
from pathlib import Path
PINNED = {"dex-python-sdk": None, "pydantic-ai-slim": "../../../python/pydantic-ai/uv.lock"}
lock = tomllib.loads(Path("uv.lock").read_text())
for name, reference_lock in PINNED.items():
locked = next(package for package in lock["package"] if package["name"] == name)
if "registry" not in locked.get("source", {}):
raise SystemExit(f"{name} must come from the package registry, not a path")
installed = importlib.metadata.version(name)
if installed != locked["version"]:
raise SystemExit(f"installed {name} {installed}, uv.lock {locked['version']}")
if reference_lock is not None:
reference = tomllib.loads(Path(reference_lock).read_text())
expected = next(package for package in reference["package"] if package["name"] == name)
if expected["version"] != locked["version"]:
raise SystemExit(f"uv.lock has {name} {locked['version']}, {reference_lock} {expected['version']}")
print(f"{name} {installed} from {locked['source']['registry']}")
PY
uv run --frozen ruff check
uv run --frozen ruff format --check
uv run --frozen mypy
uv run --frozen pytest -p no:cacheprovider -v -rs