Fix red CI: install the dev extra, and let package doctests run - #12
Merged
Conversation
CI has been red on the default branch since the Phase 1 backend commit.
Root cause (Validation (3.12) / "Run Tests"):
ERROR collecting tests/test_ingest.py
tests/test_ingest.py:4: from fastapi.testclient import TestClient
starlette/testclient.py:41: RuntimeError: The starlette.testclient
module requires the httpx2 package to be installed.
The wads reusable workflow installs `-e .` with only the extras named in
`[tool.wads.ci.install].extras`, which defaults to none. That key was unset,
so the `dev` extra -- which is where the HTTP client the FastAPI TestClient
needs is declared -- was never installed, and every test module importing
`fastapi.testclient` failed at collection (exit code 2).
Changes:
- `[tool.wads.ci.install] extras = "dev"` -- the actual fix; CI now installs
`.[dev]` instead of bare `.`.
- Add `httpx2` beside `httpx` in the `dev` extra. starlette >= 1 imports
`httpx2` first and only falls back to `httpx` with a deprecation warning;
starlette < 1 knows `httpx` alone. Declaring both makes the suite collect
on either resolution -- they are distinct top-level modules.
- Widen `testpaths` to `["tests", "heed"]`. wads CI runs
`pytest --doctest-modules` with no path argument, so collection is driven
entirely by `testpaths`; with `["tests"]` the package's own doctests never
ran. The `heed/__init__.py` usage doctest now executes (and passes).
- Correct the stale comment claiming the PyPI name `heed` is reserved for
this repo. It is not -- it is taken by an unrelated project, so a first
release needs a different distribution name. Publishing stays disabled.
Verified in clean uv venvs on Python 3.10 and 3.12 with the exact CI command
(`pytest --doctest-modules -o doctest_optionflags=... --ignore=examples
--ignore=scrap -v --tb=short`): 2 collection errors before, 10 passed after.
`ruff check heed` and `ruff format` are clean. No package code changed.
Claude-Session: https://claude.ai/code/session_01VipiLaG4xy7WctqY9w2475
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI has been red on
mainsince the Phase 1 backend commit (run 27911312182). This makes it green.Root cause
Failing job
ci / Validation (3.12), failing step Run Tests, exit code 2 — a collection error, not a test failure:Two steps earlier in the same log, the install step shows why:
The wads reusable workflow installs
-e .plus only the extras named in[tool.wads.ci.install].extras. That key was unset (it defaults to none), so thedevextra — which is where the HTTP client the FastAPITestClientneeds is declared — was never installed. Every test module importingfastapi.testclientthen failed at import, and pytest aborted collection.Nothing about the package code was wrong. It was green months ago because the repo had no test touching
fastapi.testclientyet.What changed (
pyproject.tomlonly — no package code)[tool.wads.ci.install] extras = "dev"— the actual fix. CI now runsuv pip install -e ".[dev]"instead of bareuv pip install -e ..httpx2added besidehttpxin thedevextra. starlette >= 1.0 importshttpx2first and only falls back tohttpxwith aStarletteDeprecationWarning; starlette < 1.0 knowshttpxalone. CI resolves starlette 1.3.1, the shared local dev environment has starlette 0.49.3. Declaring both makes the suite collect on either resolution — they are distinct top-level modules and coexist cleanly.testpathswidened from["tests"]to["tests", "heed"]. wads CI runspytest --doctest-moduleswith no path argument, so collection is driven entirely bytestpaths. With["tests"]the package's own doctests never ran and CI still reported on them as if they had. The usage doctest inheed/__init__.pynow actually executes (and passes). All package modules import cleanly with only core deps —ghapiis already lazy-imported insideGitHubIssuesSink, so--doctest-modulesdoes not drag in the optional[github]extra.heedwas reserved for this repo. It is not — see Decision needed: the PyPI nameheedis taken — pick a distribution name before first release #11. Publishing remains disabled either way.Verification
Reproduced and fixed locally in clean
uvvenvs before pushing, using the exact CI command:-e .only, py3.12-e .[dev], py3.10-e .[dev], py3.12uvx ruff check --output-format=github heedexits 0;ruff formatreports no Python file needing reformatting.Local dependents gate (
priv test-dependents heed): baseline1 suites: 1 pass, 0 fail, 0 no-tests→ final1 suites: 1 pass, 0 fail, 0 no-tests. No regression.Branch CI: run 30858780626 — success.
The branch log confirms the fix took effect end to end:
uv pip install -e ".[dev]",+ httpx2==2.9.1,collected 10 items,10 passed.Merging this does NOT publish a release
[tool.wads.ci.publish] enabled = falsein this repo, so thePublishjob stays skipped onmain. Nothing goes to PyPI. (It could not anyway — see #11.)One thing to expect on the first
mainrun: thePublish GitHub Pagesjob runs only on the default branch, so it has not been exercised by this branch. It should self-configure — the epythet action POSTs the Pages config itself and is idempotent — but it is unverified here.Left undone (deliberately)
HIGHfinding "PyPI version (0.1.0) is AHEAD of pyproject (0.0.1)" is a false positive: PyPIheedis an unrelated project, and this repo has never published. Recorded in Decision needed: the PyPI nameheedis taken — pick a distribution name before first release #11 rather than "fixed".LICENSEfile (the project declares Apache-2.0 in metadata),licensestill in the deprecated table form, noclassifiers, no.editorconfig, and GitHub description/homepage/topics drifted frompyproject.toml.ruff formatwants to reformat Python code blocks inside onemisc/docs/markdown file. Harmless — the CI format step runs in place and does not fail — but left alone so this PR stays one dimension.Opened as part of a fleet-wide CI modernization pass and left for you to review and merge.