ci: fix indentation in cli-wheel-clean-install Python heredoc (#273)
The cli-wheel-clean-install lane introduced in v0.53.4 (#272) failed on its first main run with `IndentationError: unexpected indent`: YAML `run: |` preserves the relative indent of the inline `python3 -c` heredoc, so the Python interpreter saw `try:` at column 12 and refused to parse. Fix: write the assertion script to /tmp/smoke.py via a `cat <<'PY'` heredoc (left-aligned content lands flat), mount it into the container, and invoke the tool's venv python directly (`$HOME/.local/share/uv/tools/agnes-the-ai-analyst/bin/python`). Cleaner than the previous inline form and side-steps `uv tool run --from <name>` doing a PyPI lookup that fails because we don't publish there. Verified locally with the same docker run as the CI step — prints `OK: kbcstorage absent, urllib3 2.7.0`.
This commit is contained in:
parent
103669dafd
commit
0407d194ba
1 changed files with 30 additions and 21 deletions
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
|
|
@ -55,9 +55,26 @@ jobs:
|
||||||
- name: Build wheel
|
- name: Build wheel
|
||||||
run: uv build --wheel --out-dir dist
|
run: uv build --wheel --out-dir dist
|
||||||
|
|
||||||
|
- name: Write CLI install assertion script
|
||||||
|
run: |
|
||||||
|
cat > /tmp/smoke.py <<'PY'
|
||||||
|
import sys, urllib3
|
||||||
|
try:
|
||||||
|
import kbcstorage # noqa: F401
|
||||||
|
sys.exit("REGRESSION: kbcstorage leaked into the CLI wheel — should be in [server] extra only")
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
maj, minor = (int(x) for x in urllib3.__version__.split(".")[:2])
|
||||||
|
assert (maj, minor) >= (2, 7), f"urllib3 too old: {urllib3.__version__}"
|
||||||
|
print(f"OK: kbcstorage absent, urllib3 {urllib3.__version__}")
|
||||||
|
PY
|
||||||
|
|
||||||
- name: Smoke install in fresh python:3.13-slim
|
- name: Smoke install in fresh python:3.13-slim
|
||||||
run: |
|
run: |
|
||||||
docker run --rm -v "$PWD/dist:/wheels:ro" python:3.13-slim bash -c '
|
docker run --rm \
|
||||||
|
-v "$PWD/dist:/wheels:ro" \
|
||||||
|
-v /tmp/smoke.py:/smoke.py:ro \
|
||||||
|
python:3.13-slim bash -c '
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
apt-get update -qq && apt-get install -y -qq --no-install-recommends curl ca-certificates >/dev/null
|
apt-get update -qq && apt-get install -y -qq --no-install-recommends curl ca-certificates >/dev/null
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh > /dev/null 2>&1
|
curl -LsSf https://astral.sh/uv/install.sh | sh > /dev/null 2>&1
|
||||||
|
|
@ -67,16 +84,8 @@ jobs:
|
||||||
agnes --version
|
agnes --version
|
||||||
agnes --help > /dev/null
|
agnes --help > /dev/null
|
||||||
agnes catalog --help > /dev/null
|
agnes catalog --help > /dev/null
|
||||||
python3 -c "
|
# Run the assertion in the same venv uv tool created
|
||||||
try:
|
"$HOME/.local/share/uv/tools/agnes-the-ai-analyst/bin/python" /smoke.py
|
||||||
import kbcstorage
|
|
||||||
raise SystemExit(\"REGRESSION: kbcstorage leaked into the CLI wheel — should be in [server] extra only\")
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
import urllib3
|
|
||||||
assert tuple(int(x) for x in urllib3.__version__.split(\".\")[:2]) >= (2, 7), urllib3.__version__
|
|
||||||
print(\"OK: kbcstorage absent, urllib3\", urllib3.__version__)
|
|
||||||
"
|
|
||||||
'
|
'
|
||||||
|
|
||||||
docker-build:
|
docker-build:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue