Skip to content

Commit 1281448

Browse files
committed
fix(tutorials): install pytest explicitly in tutorial test runner
The tutorial CI runner invokes `uv run pytest`, but pytest is only declared under each tutorial's optional `dev` extra, which `uv run` does not install. It used to resolve transitively because agentex-sdk listed pytest/pytest-asyncio as runtime deps. agentex-sdk 0.11.5 (published 2026-05-29) dropped those (correctly — they're test-only), so the unpinned `agentex-sdk` dep now resolves without pytest and every tutorial job fails with `error: Failed to spawn: pytest` before any test runs. Pass `--with pytest --with pytest-asyncio` to both pytest invocations so the test deps are requested explicitly. This restores exactly what the SDK used to provide transitively and works for all tutorials regardless of how each declares its test dependencies.
1 parent e1b31d9 commit 1281448

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

examples/tutorials/run_agent_test.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,23 @@ run_test() {
259259
cd "$tutorial_path" || return 1
260260

261261

262-
# Run the tests with retry mechanism
263-
local -a pytest_cmd=("uv" "run" "pytest")
262+
# Run the tests with retry mechanism.
263+
#
264+
# pytest is brought in explicitly via --with: the tutorials only list it
265+
# under an optional `dev` extra (which `uv run` does not install), and it
266+
# used to be pulled in transitively by agentex-sdk's runtime deps. Once
267+
# agentex-sdk 0.11.5 dropped pytest as a runtime dep, `uv run pytest` could
268+
# no longer find it ("Failed to spawn: pytest"). Requesting it directly is
269+
# robust across all tutorials regardless of how each declares test deps.
270+
local -a pytest_cmd=("uv" "run" "--with" "pytest" "--with" "pytest-asyncio" "pytest")
264271
if [ "$BUILD_CLI" = true ]; then
265272
local wheel_file
266273
wheel_file=$(ls /home/runner/work/*/*/dist/agentex_sdk-*.whl 2>/dev/null | head -n1)
267274
if [[ -z "$wheel_file" ]]; then
268275
wheel_file=$(ls "${SCRIPT_DIR}/../../dist/agentex_sdk-*.whl" 2>/dev/null | head -n1)
269276
fi
270277
if [[ -n "$wheel_file" ]]; then
271-
pytest_cmd=("uv" "run" "--with" "$wheel_file" "pytest")
278+
pytest_cmd=("uv" "run" "--with" "$wheel_file" "--with" "pytest" "--with" "pytest-asyncio" "pytest")
272279
fi
273280
fi
274281

0 commit comments

Comments
 (0)