Skip to content

chore(deps): add root requirements-dev.txt for test/lint tooling - #223

Merged
zyntromedia merged 2 commits into
mainfrom
feat/requirements-dev
Sep 12, 2026
Merged

zyntromedia merged 2 commits into
mainfrom
feat/requirements-dev

Conversation

@fig-ai-agent

@fig-ai-agent fig-ai-agent Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

สรุป

เพิ่ม requirements-dev.txt ที่ root เพื่อแยก dev/test tooling ออกจาก requirements.txt ที่เป็น production runtime (fastapi, uvicorn, tiktoken, pydantic, openai, langgraph)

ทำไม

ตอนนี้ repo ไม่มีที่สำหรับ dev dependency เลย ผลคือ:

  • ci.yml job test รัน pytest tests/ --cov=app แต่ติดตั้งแค่ pip install -r requirements.txt ซึ่งไม่มี pytest → job นี้แดงถาวร
  • test-suite.yml ก็ติดตั้งแค่ requirements.txt แล้วรัน pytest
  • test-and-coverage.yaml ต้อง hard-code pip install pytest pytest-cov เอง
  • PR Update requirements.txt #222 พยายามแก้ด้วยการยัด pytest/pytest-cov/flake8 เข้าไปใน production requirements.txt ซึ่งจะทำให้ทุก Docker image แบก test tooling และ dependabot group production-deps ลากไป bump ใน production

สิ่งที่เพิ่ม

-r requirements.txt        # production runtime เป็น single source of truth

pytest>=8.3
pytest-asyncio>=0.24      # pytest.ini ตั้ง asyncio_mode = auto
pytest-cov>=6.0
httpx>=0.28.1

ruff>=0.8
black>=24.10
isort>=5.13
mypy>=1.13

ทำตาม convention ที่ repo ใช้อยู่แล้ว — deliverables/pure-agent-dev/requirements-dev.txt ก็ขึ้นต้นด้วย -r requirements.txt เหมือนกัน และใช้ ruff/black/isort ซึ่งตรงกับ toolchain ใน ci.yml (ไม่ใช่ flake8 ที่ไม่มี workflow ไหนเรียกใช้)

ตรวจสอบแล้ว

  • รัน pip install -r requirements-dev.txt ใน venv สะอาด — ติดตั้งผ่านครบ
  • import pytest, pytest_asyncio, httpx, fastapi, app ผ่าน
  • pytest tests/ --collect-only เริ่มเก็บ test ได้ (collection ไปหยุดที่บั๊กอื่นของ repo ไม่ใช่ dependency)`

ยังไม่รวมใน PR นี้ (แจ้งเพื่อทราบ)

ตรวจแล้วพบว่า requirements.txt ขาด dependency ที่โค้ด app/ import จริง 3 ตัว — ไม่เกี่ยวกับ PR นี้ แต่ต้องแก้ก่อน CI จะเขียว:

  • pydantic-settingsapp/core/config.py, app/config.py
  • python-joseapp/core/security.py
  • alembicapp/env.py
  • prometheus-fastapi-instrumentatorapp/monitoring/prometheus.py

และ app/services/__init__.py import UserService จาก app.services.users ที่ยังไม่มีในไฟล์นั้น (บั๊กโค้ด ไม่ใช่ dependency)

หมายเหตุ CI

checks ของ PR นี้จะแดงจากปัญหาที่มีอยู่ก่อนแล้วบน main (actions/checkout@v4 ผิดนโยบาย SHA-pinning, SHA ปลอมใน scan, CodeQL go job ที่ไม่มีโค้ด Go) ไม่ได้มาจากไฟล์นี้

fig-ai-agent and others added 2 commits September 12, 2026 11:04
Splits development tooling out of the production requirements.txt so
pytest/pytest-cov/lint deps no longer ship in runtime images or get
dragged into the production-deps dependabot group.

- -r requirements.txt  (production runtime, single source of truth)
- pytest>=8.3, pytest-asyncio>=0.24 (pytest.ini sets asyncio_mode = auto),
  pytest-cov>=6.0, httpx>=0.28.1
- ruff/black/isort/mypy — matching the toolchain already used in ci.yml

Follows the existing repo convention (deliverables/pure-agent-dev/requirements-dev.txt).
@zyntromedia
zyntromedia merged commit 09c7d31 into main Sep 12, 2026
5 of 10 checks passed
@zyntromedia
zyntromedia deleted the feat/requirements-dev branch September 12, 2026 11:18
@fig-ai-agent fig-ai-agent Bot mentioned this pull request Sep 14, 2026
7 tasks
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