chore: split dev/test dependencies into requirements-dev.txt - #16
Merged
Conversation
requirements.txt (PR #9) is production-only, but the test suite needs pytest, pytest-asyncio (for the @pytest.mark.asyncio tests), pytest-cov, httpx (required by starlette's TestClient, used in test_main_api.py, test_auth.py, test_rag_routes.py), and ruff (CI's lint step, previously installed ad-hoc). None of these were declared anywhere in the repo. - Add requirements-dev.txt pinned to currently-installed working versions - Update ci.yml to install both requirement files instead of ad-hoc `pip install ruff pytest` - Document the dev/test install path in README.md Verified in two fresh venvs: - requirements.txt alone: app imports and serves /health successfully - requirements.txt + requirements-dev.txt: all 199 tests pass Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XaLTXgv4NNGzg2snnnYRZV
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.
What
PR #9 pinned
requirements.txtto production dependencies only. Since then, running the test suite has required installing dev tooling manually (tribal knowledge) — nothing declared it. This PR addsrequirements-dev.txtfor those packages.Packages moved into
requirements-dev.txt(pinned to currently-installed working versions)pytestpytest-asyncio@pytest.mark.asynciotests intests/test_main_api.pypytest-cov.coveragercalready in repo)httpxstarlette.testclient.TestClient, used intest_main_api.py,test_auth.py,test_rag_routes.pyruffpip install ruff pytest)None of these are imported by application code —
requirements.txtalone is sufficient to run the app.Verification (done from scratch, two separate fresh venvs)
venv 1 —
requirements.txtonly (production-only, no dev deps):pip install -r requirements.txtsucceedsapi.main.appimports and boots viauvicornGET /healthreturns200 {"status":"ok", ...}requirements.txtalone is sufficient to run the app, not to test itvenv 2 —
requirements.txt+requirements-dev.txttogether:pytest -q→ 199 passed, no missing-dependency errorspytest-asynciocorrectly registers in strict mode and the two async tests exercise real coroutines (not silently skipped)CI config diff
- name: Install dependencies run: | python -m pip install --upgrade pip if [ -f pyproject.toml ]; then pip install -e ".[dev]" 2>/dev/null || pip install -e . elif [ -f requirements.txt ]; then - pip install -r requirements.txt + pip install -r requirements.txt -r requirements-dev.txt fi - pip install ruff pytestCI's install step now matches what's actually needed to run
pytest— no more ad-hocpip install ruff pytestdisconnected from any tracked file.Also updated
README.mdnow documents the dev/test install path (pip install -r requirements.txt -r requirements-dev.txt) separately from the production install command.🤖 Generated with Claude Code