Skip to content

fix(tutorials): install dev extras when running tutorial pytest#380

Closed
declan-scale wants to merge 1 commit into
nextfrom
fix/tutorial-tests-extra-dev
Closed

fix(tutorials): install dev extras when running tutorial pytest#380
declan-scale wants to merge 1 commit into
nextfrom
fix/tutorial-tests-extra-dev

Conversation

@declan-scale
Copy link
Copy Markdown
Contributor

@declan-scale declan-scale commented May 29, 2026

Summary

  • Tutorial CI has been red on every job since 2026-05-29 with error: Failed to spawn: pytest / No such file or directory.
  • Root cause: chore(deps): drop unused runtime deps and exclude tests from wheel #367 dropped pytest/pytest-asyncio from agentex-sdk's runtime deps. Tutorials used to get pytest transitively via agentex-sdk; now pytest lives only in each tutorial's [project.optional-dependencies] dev, and run_agent_test.sh invoked uv run pytest without --extra dev, so uv never installed it.
  • Fix: pass --extra dev to both uv run invocations in examples/tutorials/run_agent_test.sh so the tutorial's dev extras get synced before pytest is spawned.

Last green tutorial-test run on main: 26472427908 (2026-05-26, immediately before #367). First red run: 26617979690 (2026-05-29).

Test plan

  • CI tutorial-test matrix turns green on this PR.

Greptile Summary

Fixes broken tutorial CI by adding --extra dev to both uv run invocations in run_agent_test.sh, ensuring the tutorial's dev dependencies (pytest, pytest-asyncio) are installed before pytest is spawned.

  • Both the standard code path (uv run --extra dev pytest) and the wheel-override path (uv run --extra dev --with <wheel> pytest) are updated consistently, so neither branch is left without dev extras.

Confidence Score: 5/5

Safe to merge — the change is a minimal, targeted fix to a CI script with no impact on production code.

Both uv run invocations are updated consistently. The fix directly maps to the stated root cause, and the standard and wheel-override paths are treated identically. No production code is touched.

No files require special attention.

Important Files Changed

Filename Overview
examples/tutorials/run_agent_test.sh Adds --extra dev to both uv run invocations so tutorial dev-dependencies (pytest, pytest-asyncio) are installed before running tests; correctly applied to both the standard and wheel-override code paths.

Sequence Diagram

sequenceDiagram
    participant CI as CI Runner
    participant Script as run_agent_test.sh
    participant uv as uv (package manager)
    participant pytest as pytest

    CI->>Script: run_test(tutorial_path)
    Script->>Script: build pytest_cmd with --extra dev
    Script->>uv: uv run --extra dev pytest tests/test_agent.py
    uv->>uv: sync [project.optional-dependencies] dev
    Note over uv: installs pytest, pytest-asyncio
    uv->>pytest: spawn pytest
    pytest-->>Script: exit_code
    Script-->>CI: pass / fail
Loading

Reviews (1): Last reviewed commit: "fix(tutorials): install dev extras when ..." | Re-trigger Greptile

After #367 dropped pytest from agentex-sdk's runtime deps, `uv run
pytest` in tutorials no longer finds pytest — it lives in each
tutorial's [project.optional-dependencies] dev. Pass --extra dev so uv
installs it before spawning pytest. Fixes the "Failed to spawn: pytest"
regression seen across every tutorial test job since 2026-05-29.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@declan-scale
Copy link
Copy Markdown
Contributor Author

Closing since #379 fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant