Skip to content

Commit 15f2886

Browse files
authored
chore(deps): drop transitives from requirements.txt, split prod from dev (#28)
Only Flask and pytest are directly imported anywhere in the source. The other 13 pinned packages (blinker, click, colorama, exceptiongroup, iniconfig, itsdangerous, Jinja2, MarkupSafe, packaging, pluggy, tomli, typing_extensions, Werkzeug) are transitive deps that pip resolves automatically. - requirements.txt: keep Flask only. - requirements-dev.txt: -r requirements.txt + pytest, for tests. - ci.yml: split into a prod-install-smoke job (installs requirements.txt only and boots the app via test_client — catches future un-listed third-party imports before merge) and the existing pytest job (now installs requirements-dev.txt). - README: new Development section pointing at requirements-dev.txt for running the test suite. Closes #27
1 parent 09de881 commit 15f2886

4 files changed

Lines changed: 46 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14-
pytest:
14+
prod-install-smoke:
15+
name: Verify prod requirements.txt is sufficient
1516
runs-on: ubuntu-latest
1617
steps:
1718
- uses: actions/checkout@v4
@@ -22,8 +23,37 @@ jobs:
2223
cache: pip
2324
cache-dependency-path: requirements.txt
2425

25-
- name: Install dependencies
26+
- name: Install production dependencies only
2627
run: pip install -r requirements.txt
2728

29+
# Boots the app under test_client without pytest. Catches the case
30+
# where someone adds a real third-party import (e.g. werkzeug.X)
31+
# to the source without bumping requirements.txt — that would
32+
# surface here as ImportError before merge.
33+
- name: Import + boot app
34+
run: |
35+
python - <<'PY'
36+
from app import create_app
37+
app = create_app()
38+
client = app.test_client()
39+
assert client.get("/").status_code == 200
40+
PY
41+
42+
pytest:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- uses: actions/setup-python@v5
48+
with:
49+
python-version: "3.12"
50+
cache: pip
51+
cache-dependency-path: |
52+
requirements.txt
53+
requirements-dev.txt
54+
55+
- name: Install dev dependencies (Flask + pytest)
56+
run: pip install -r requirements-dev.txt
57+
2858
- name: Run tests
2959
run: pytest --tb=short -q

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,20 @@ claude-code-chat-browser/
107107
└── tests/
108108
```
109109

110+
## Development
111+
112+
To run the test suite, install the dev requirements (Flask + pytest):
113+
114+
```bash
115+
pip install -r requirements-dev.txt
116+
pytest
117+
```
118+
119+
`requirements.txt` carries only the runtime dep (Flask); `requirements-dev.txt` pulls it in via `-r` and adds pytest.
120+
110121
## Continuous integration
111122

112-
Every push and pull request runs **`pytest`** on **Ubuntu** (Python 3.12) via [`.github/workflows/ci.yml`](.github/workflows/ci.yml).
123+
Every push and pull request runs **`pytest`** on **Ubuntu** (Python 3.12) via [`.github/workflows/ci.yml`](.github/workflows/ci.yml). A separate job verifies that `pip install -r requirements.txt` (production-only) is sufficient to import and boot the app.
113124

114125
## Exported Markdown Format
115126

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-r requirements.txt
2+
pytest==9.0.2

requirements.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1 @@
1-
blinker==1.9.0
2-
click==8.3.1
3-
colorama==0.4.6
4-
exceptiongroup==1.3.1
51
Flask==3.1.3
6-
iniconfig==2.3.0
7-
itsdangerous==2.2.0
8-
Jinja2==3.1.6
9-
MarkupSafe==3.0.3
10-
packaging==26.0
11-
pluggy==1.6.0
12-
pytest==9.0.2
13-
tomli==2.4.0
14-
typing_extensions==4.15.0
15-
Werkzeug==3.1.6

0 commit comments

Comments
 (0)