Skip to content

Commit 3458f66

Browse files
ambvclaude
andcommitted
Address review feedback: split deps, add psycopg2-binary, fix docs
Move pytest and pytest-asyncio to a separate requirements-dev.in so they don't ship in the production image. Add psycopg2-binary to requirements.in and remove the separate pip install from the prod Dockerfile. Update README Quick Start to use Docker commands instead of make targets. Update CI to check both lockfiles. Regenerate both lockfiles. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3844d2d commit 3458f66

File tree

9 files changed

+1147
-85
lines changed

9 files changed

+1147
-85
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,29 @@ jobs:
1414
- uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
17-
- name: Ensure requirements.txt is updated when requirements.in changes
17+
- name: Ensure lockfiles are updated when .in files change
1818
run: |
1919
BASE=${{ github.event.pull_request.base.sha }}
2020
HEAD=${{ github.event.pull_request.head.sha }}
2121
CHANGED=$(git diff --name-only "$BASE" "$HEAD")
22-
if echo "$CHANGED" | grep -q 'backend/requirements\.in'; then
23-
if ! echo "$CHANGED" | grep -q 'backend/requirements\.txt'; then
24-
echo "::error::backend/requirements.in was modified but backend/requirements.txt was not. Please run pip-compile to regenerate the lockfile."
25-
exit 1
22+
FAIL=0
23+
if echo "$CHANGED" | grep -q 'backend/requirements\.in$'; then
24+
if ! echo "$CHANGED" | grep -q 'backend/requirements\.txt$'; then
25+
echo "::error::backend/requirements.in was modified but backend/requirements.txt was not."
26+
FAIL=1
2627
fi
28+
if ! echo "$CHANGED" | grep -q 'backend/requirements-dev\.txt$'; then
29+
echo "::error::backend/requirements.in was modified but backend/requirements-dev.txt was not."
30+
FAIL=1
31+
fi
32+
fi
33+
if echo "$CHANGED" | grep -q 'backend/requirements-dev\.in$'; then
34+
if ! echo "$CHANGED" | grep -q 'backend/requirements-dev\.txt$'; then
35+
echo "::error::backend/requirements-dev.in was modified but backend/requirements-dev.txt was not."
36+
FAIL=1
37+
fi
38+
fi
39+
if [ "$FAIL" -eq 1 ]; then
40+
echo "::error::Please run pip-compile to regenerate lockfiles. See README for instructions."
41+
exit 1
2742
fi

README.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,19 @@ This project consists of three main components:
1818

1919
### Setup & Installation
2020
```bash
21-
# Install all dependencies and set up database
22-
make setup
21+
# Copy environment config
22+
cp .env.example .env
2323

24-
# Or install components separately
25-
make install # Install frontend + backend dependencies
26-
make init-db # Initialize SQLite database
27-
make populate-db # Add mock data for development
24+
# Build and start all services
25+
docker compose -f docker-compose.dev.yml up --build
2826
```
2927

3028
### Development
31-
```bash
32-
# Start both frontend and backend servers
33-
make dev
3429

35-
# Or start them individually
36-
make dev-frontend # Frontend on http://localhost:9002
37-
make dev-backend # Backend API on http://localhost:8000
38-
```
30+
Services start automatically with hot reload:
31+
- Frontend: http://localhost:9002
32+
- Backend API: http://localhost:8000
33+
- API Documentation: http://localhost:8000/api/docs
3934

4035
## Development Commands
4136

@@ -59,10 +54,13 @@ make clean # Clean up generated files and caches
5954

6055
### Updating Backend Dependencies
6156
```bash
62-
# Edit backend/requirements.in, then regenerate the lockfile:
57+
# Edit backend/requirements.in, then regenerate both lockfiles:
6358
docker run --rm -v "$(pwd)/backend:/app" -w /app python:3.13-slim-bookworm \
64-
sh -c "pip install --quiet pip-tools && pip-compile --strip-extras \
65-
--generate-hashes --output-file requirements.txt requirements.in"
59+
sh -c "pip install --quiet pip-tools && \
60+
pip-compile --strip-extras --generate-hashes \
61+
--output-file requirements.txt requirements.in && \
62+
pip-compile --strip-extras --generate-hashes \
63+
--output-file requirements-dev.txt requirements-dev.in"
6664

6765
# Rebuild the backend container:
6866
docker compose -f docker-compose.dev.yml up --build -d backend
@@ -101,10 +99,10 @@ memory-tracker benchmark /path/to/cpython HEAD~5..HEAD \
10199

102100
```bash
103101
# Development with hot reload
104-
docker-compose -f docker-compose.dev.yml up
102+
docker compose -f docker-compose.dev.yml up
105103

106104
# Production deployment
107-
docker-compose up
105+
docker compose up
108106
```
109107

110108
## Usage Examples

backend/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ RUN apt-get update && apt-get install -y \
1212
# Copy requirements first to leverage Docker layer caching
1313
COPY requirements.txt .
1414

15-
# Install PostgreSQL adapter
16-
RUN pip install --no-cache-dir asyncpg psycopg2-binary
17-
1815
# Install Python dependencies
1916
RUN pip install --no-cache-dir -r requirements.txt
2017

backend/Dockerfile.dev

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ RUN apt-get update && apt-get install -y \
77
gcc \
88
&& rm -rf /var/lib/apt/lists/*
99

10-
COPY requirements.txt .
10+
COPY requirements-dev.txt .
1111

12-
# Install Python dependencies
13-
RUN pip install --no-cache-dir -r requirements.txt
12+
# Install Python dependencies (dev lockfile includes test tooling)
13+
RUN pip install --no-cache-dir -r requirements-dev.txt
1414

1515
# The source code will be mounted as a volume, so we don't copy it here
1616

backend/requirements-dev.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-r requirements.in
2+
pytest
3+
pytest-asyncio

0 commit comments

Comments
 (0)