fix(dev-deps): enforce [dev] install + align docs to CI#402
Merged
Conversation
A local `pip install -e .` (as AGENTS.md instructed) omits the `[dev]` extra, so pytest-asyncio was absent. With pytest.ini's `asyncio_mode = auto`, every async test then fails instantly (~0.01s) instead of running — indistinguishable from a real regression, which produced a false "pre-existing failures on master" baseline and masked a real create_index regression. CI installs `[dev]` (.github/workflows/test.yml:69); a worktree wouldn't have caught it (the repo-root .venv is shared). - AGENTS.md / docs/JAVA-CODEBASE-RAG-CLI.md: `-e .` -> `-e ".[dev]"`, matching CI and README.md. - tests/conftest.py: add _enforce_dev_deps() (mirrors the existing _enforce_editable_install guard) — missing pytest-asyncio now fails collection loud (returncode 4 + fix command) instead of N silent fast failures. Wired into pytest_configure ahead of the editable-install check. Also align the editable-install guard's message to `.[dev]`. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Problem
Agents repeatedly reported green locally, red on CI. Root cause: a one-character mismatch between CI and the docs agents follow.
.github/workflows/test.yml:69):pip install -e ".[dev]"AGENTS.md:9,docs/JAVA-CODEBASE-RAG-CLI.md:10):pip install -e .— no[dev]pytest-asynciolives only under the[dev]extra (pyproject.toml:53). An agent following the doc got a venv with no pytest-asyncio.pytest.inisetsasyncio_mode = auto, which is a silent no-op without the plugin — so everyasync def test_*was collected and failed instantly (~0.01s, coroutine-never-awaited) instead of running.That fast-failure signature broke reasoning twice:
create_indexregression.A worktree would not have prevented this — the repo-root
.venvis shared across worktrees. The fix has to be env-health verification.Fix
AGENTS.md:9anddocs/JAVA-CODEBASE-RAG-CLI.md:10now say-e ".[dev]"(matching CI andREADME.md:274).tests/conftest.py) — new_enforce_dev_deps(), wired intopytest_configureahead of the existing_enforce_editable_install()guard and mirroring its style: missingpytest-asyncionow exits withreturncode=4and a one-line fix command, instead of N silent 0.01s failures. Also aligned the editable-install guard's message to.[dev]so both guards print one canonical command.Verification
ruff check tests/conftest.py— clean (repo line-length 100).pytest-asynciopresent → returns silently; absent (sys.modules['pytest_asyncio']=None) → raises_pytest.outcomes.Exit, returncode 4, correct message.pytest --collect-only: the[install]guard fired, not[dev-deps]→ confirms the new guard runs first and does not false-positive.Out of scope (intentionally left)
tests/test_jrag_*.pyassertion hints (run: pip install -e .) — about thejragentrypoint being installed, not dev deps.plans/**— historical/completed records.🤖 Generated with Claude Code