fix #20: [11] requirements-prod.txt and requirements.txt differ by 20 major versions on critical packages - #44
Merged
Conversation
Reconcile the two dependency files into one coherent, reproducible contract and remove obsolete/unused entries. - requirements-prod.txt: pin every shared package to the exact same version as requirements.txt (groq 0.4.1 -> 0.24.0, pydantic 2.6.0 -> 2.11.3, fastapi/uvicorn/requests/aiohttp >= -> ==), and ADD the langchain family (langchain, langchain-core, langchain-groq, langchain-text-splitters) that prod was missing even though services/llm_service.py and services/simulation_service.py import it (latent prod ImportError). Drop google-generativeai (Gemini removed) and redis (unused). - requirements.txt: drop redis and langchain-openai (0 imports). - env.example: drop OPENAI_API_KEY (0 usage) and the REDIS_* block (unused). Keep GOOGLE_API_KEY (still read by api/app.py). - Add tests/unit/test_requirements_alignment.py: hermetic, stdlib-only regression that fails if the files diverge on a shared spec, if an obsolete package (redis/google-generativeai/langchain-openai) returns, if a runtime dep drops out of prod, or if env.example regains OPENAI_API_KEY/REDIS_*. - ci.yml: run the new regression as a named step in the unit-tests job (3-job shape preserved; no code-graph job). Closes #20 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Closes #20
Problem
requirements.txtandrequirements-prod.txtdiverged by major versions on critical packages:groq0.4.1 (prod) vs 0.24.0 (dev),pydantic2.6.0 (prod) vs 2.11.3 (dev). Prod also carried obsoletegoogle-generativeai==0.3.2(Gemini was removed) andredis==5.0.1(never used). Worse, prod omitted the entirelangchainfamily thatservices/llm_service.pyandservices/simulation_service.pyimport — so a prod install that "works in dev" wouldImportErrorat boot.Fix — one coherent, reproducible dependency contract
requirements-prod.txt: every shared package now pins the exact same version asrequirements.txt(groq 0.4.1→0.24.0,pydantic 2.6.0→2.11.3,fastapi/uvicorn/requests/aiohttp>=→==). Added the runtime langchain deps that were missing (langchain,langchain-core,langchain-groq,langchain-text-splitters). Removedgoogle-generativeaiandredis. Prod = runtime subset of dev, omitting only test tooling (pytest,pytest-asyncio,httpx).requirements.txt: removedredisandlangchain-openai(0 imports anywhere).env.example: removedOPENAI_API_KEY(0 code usage) and theREDIS_*block (unused). KeptGOOGLE_API_KEY— still read byapi/app.pyinit and documented in README (out of scope to remove; not requested by the issue).Investigation (imports verified, not assumed)
langchain/langchain_groq(llm_service, simulation_service),groq(groq_tts_service, llm_service), plus fastapi/uvicorn/pydantic/boto3/aiohttp/requests/huggingface_hub/python-multipart/python-dotenv.redis,langchain-openai.google-generativeainot imported (only commented-out Gemini code; thetests/test_gemini.pyfossil imports the differentgoogle.genai/google.adkpackages and is not CI-collected). Left the pre-existing fossil/docs untouched to avoid scope creep.New regression coverage
tests/unit/test_requirements_alignment.py— hermetic (stdlib + pytest only, no network, no app import). Fails if:redis/google-generativeai/langchain-openai) returns to either file,dev - prod == {pytest, pytest-asyncio, httpx}exactly),env.exampleregainsOPENAI_API_KEYor anyREDIS_*var.CI
Added a named "Run requirements alignment regression" step to the
unit-testsjob. Repo's 3-job shape preserved (unit-tests,regressions,build) — no code-graph job (repo has nographify-out/).Files changed
requirements.txtrequirements-prod.txtenv.exampletests/unit/test_requirements_alignment.py(new).github/workflows/ci.ymlTests / checks (local)
langchain, langchain_groq, groq, fastapi, pydantic, boto3, aiohttp, requestsall import OK.npm run build: success.Four-subagent pipeline outcomes
{n for n in X}→X); tests unchanged at 25 passed.python-multipart/huggingface_hubkeep aligned>=floors (both fixed above known-CVE floors); optionalpip-auditsuggested. Live CVE DB lookup was unavailable this session.Graph status: repo has no
graphify-out/and no code-graph CI job — none added.Claude did not merge; Hermes owns merge after fail-closed CI verification.