Skip to content

Commit 1cb2ffb

Browse files
committed
Fix Linux wheel smoke-test scripting; release 1.2.24
1 parent aab36f5 commit 1cb2ffb

5 files changed

Lines changed: 74 additions & 57 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -51,36 +51,15 @@ jobs:
5151
cargo build --release --manifest-path rust/Cargo.toml
5252
cp rust/target/release/lib_alchemy.so tinyagent/_alchemy.abi3.so
5353
54-
"${PYBIN}/python" - <<'"'"'PY'"'"'
55-
import sys
56-
57-
sys.path.insert(0, "tinyagent")
58-
import _alchemy
59-
PY
54+
"${PYBIN}/python" -c "import sys; sys.path.insert(0, \"tinyagent\"); import _alchemy"
6055
"${PYBIN}/python" scripts/check_release_binding.py --require-present
6156
6257
mkdir -p dist wheelhouse
6358
"${PYBIN}/python" -m build --wheel --outdir dist
6459
auditwheel repair --plat manylinux_2_28_x86_64 --wheel-dir wheelhouse dist/*.whl
6560
6661
"${PYBIN}/python" scripts/check_release_wheels.py wheelhouse
67-
68-
"${PYBIN}/python" - <<'"'"'PY'"'"'
69-
import os
70-
import subprocess
71-
import venv
72-
from pathlib import Path
73-
74-
wheel = next(Path("wheelhouse").glob("*.whl"))
75-
venv_dir = Path(".venv-smoke")
76-
venv.EnvBuilder(with_pip=True).create(venv_dir)
77-
scripts_dir = "Scripts" if os.name == "nt" else "bin"
78-
python_name = "python.exe" if os.name == "nt" else "python"
79-
smoke_python = venv_dir / scripts_dir / python_name
80-
81-
subprocess.run([str(smoke_python), "-m", "pip", "install", str(wheel)], check=True)
82-
subprocess.run([str(smoke_python), "-c", "import tinyagent._alchemy"], check=True)
83-
PY
62+
"${PYBIN}/python" scripts/smoke_test_built_wheel.py wheelhouse
8463
'
8564
8665
- name: Upload wheel artifact
@@ -147,22 +126,7 @@ jobs:
147126
148127
- name: Smoke test built wheel
149128
run: |
150-
python - <<'PY'
151-
import os
152-
import subprocess
153-
import venv
154-
from pathlib import Path
155-
156-
wheel = next(Path("dist").glob("*.whl"))
157-
venv_dir = Path(".venv-smoke")
158-
venv.EnvBuilder(with_pip=True).create(venv_dir)
159-
scripts_dir = "Scripts" if os.name == "nt" else "bin"
160-
python_name = "python.exe" if os.name == "nt" else "python"
161-
smoke_python = venv_dir / scripts_dir / python_name
162-
163-
subprocess.run([str(smoke_python), "-m", "pip", "install", str(wheel)], check=True)
164-
subprocess.run([str(smoke_python), "-c", "import tinyagent._alchemy"], check=True)
165-
PY
129+
python scripts/smoke_test_built_wheel.py dist
166130
167131
- name: Upload wheel artifact
168132
uses: actions/upload-artifact@v4
@@ -235,22 +199,7 @@ jobs:
235199
- name: Smoke test built wheel
236200
shell: bash
237201
run: |
238-
python - <<'PY'
239-
import os
240-
import subprocess
241-
import venv
242-
from pathlib import Path
243-
244-
wheel = next(Path("dist").glob("*.whl"))
245-
venv_dir = Path(".venv-smoke")
246-
venv.EnvBuilder(with_pip=True).create(venv_dir)
247-
scripts_dir = "Scripts" if os.name == "nt" else "bin"
248-
python_name = "python.exe" if os.name == "nt" else "python"
249-
smoke_python = venv_dir / scripts_dir / python_name
250-
251-
subprocess.run([str(smoke_python), "-m", "pip", "install", str(wheel)], check=True)
252-
subprocess.run([str(smoke_python), "-c", "import tinyagent._alchemy"], check=True)
253-
PY
202+
python scripts/smoke_test_built_wheel.py dist
254203
255204
- name: Upload wheel artifact
256205
uses: actions/upload-artifact@v4

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

1010
### Added
1111

12+
## [1.2.24] - 2026-03-24
13+
14+
### Fixed
15+
- Fixed Linux wheel CI scripting by replacing inline Python heredocs in the release workflow with a checked-in smoke-test script, removing the shell indentation and quoting failures from the manylinux path.
16+
1217
## [1.2.23] - 2026-03-24
1318

1419
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "tiny-agent-os"
7-
version = "1.2.23"
7+
version = "1.2.24"
88
description = "Python agent loop"
99
readme = "README.md"
1010
requires-python = ">=3.10"

scripts/smoke_test_built_wheel.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/usr/bin/env python3
2+
"""Install a built wheel into a clean venv and import tinyagent._alchemy."""
3+
4+
from __future__ import annotations
5+
6+
import argparse
7+
import os
8+
import subprocess
9+
import venv
10+
from pathlib import Path
11+
12+
13+
def resolve_wheel_path(input_path: Path) -> Path:
14+
if input_path.is_file() and input_path.suffix == ".whl":
15+
return input_path
16+
17+
if input_path.is_dir():
18+
wheels = sorted(path for path in input_path.glob("*.whl") if path.is_file())
19+
if len(wheels) != 1:
20+
raise RuntimeError(
21+
f"expected exactly one wheel in {input_path}, found {len(wheels)}"
22+
)
23+
return wheels[0]
24+
25+
raise RuntimeError(f"expected a wheel file or directory, got: {input_path}")
26+
27+
28+
def smoke_test_wheel(wheel_path: Path) -> None:
29+
venv_dir = Path(".venv-smoke")
30+
venv.EnvBuilder(with_pip=True).create(venv_dir)
31+
32+
scripts_dir = "Scripts" if os.name == "nt" else "bin"
33+
python_name = "python.exe" if os.name == "nt" else "python"
34+
smoke_python = venv_dir / scripts_dir / python_name
35+
36+
subprocess.run([str(smoke_python), "-m", "pip", "install", str(wheel_path)], check=True)
37+
subprocess.run([str(smoke_python), "-c", "import tinyagent._alchemy"], check=True)
38+
39+
40+
def main() -> int:
41+
parser = argparse.ArgumentParser()
42+
parser.add_argument(
43+
"wheel_path",
44+
type=Path,
45+
nargs="?",
46+
default=Path("dist"),
47+
help="Wheel file or directory containing exactly one wheel. Defaults to dist/.",
48+
)
49+
args = parser.parse_args()
50+
51+
try:
52+
wheel_path = resolve_wheel_path(args.wheel_path)
53+
smoke_test_wheel(wheel_path)
54+
except RuntimeError as exc:
55+
print(f"release-smoke-test: {exc}")
56+
return 1
57+
58+
print(f"release-smoke-test: imported tinyagent._alchemy from {wheel_path}")
59+
return 0
60+
61+
62+
if __name__ == "__main__":
63+
raise SystemExit(main())

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)