Skip to content

Commit 6e2f6f5

Browse files
feat: add Taskfile and fix config for extra env vars (#2)
- Add Taskfile.yaml for task automation (dev, test, lint, typecheck, check, docker) - Add extra="ignore" to Settings to allow infrastructure env vars in .env
1 parent 627abb5 commit 6e2f6f5

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

Taskfile.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: '3'
2+
3+
tasks:
4+
# Development
5+
dev:
6+
desc: Run development server
7+
cmd: uv run uvicorn app.main:app --reload
8+
9+
# Testing
10+
test:
11+
desc: Run tests
12+
cmd: uv run pytest tests/ -v
13+
env:
14+
OTEL_SDK_DISABLED: "true"
15+
16+
test:cov:
17+
desc: Run tests with coverage
18+
cmd: uv run pytest tests/ -v --cov=app --cov-report=term-missing
19+
env:
20+
OTEL_SDK_DISABLED: "true"
21+
22+
# Linting
23+
lint:
24+
desc: Run ruff linter
25+
cmd: uv run ruff check app/ tests/ --fix
26+
27+
typecheck:
28+
desc: Run mypy type checker
29+
cmd: uv run mypy app/ --ignore-missing-imports
30+
31+
# All checks
32+
check:
33+
desc: Run all checks (lint, typecheck, test)
34+
cmds:
35+
- task: lint
36+
- task: typecheck
37+
- task: test
38+
39+
# Dependencies
40+
sync:
41+
desc: Sync dependencies
42+
cmd: uv sync
43+
44+
# Docker
45+
docker:build:
46+
desc: Build Docker image
47+
cmd: docker build -t chat-api:local .
48+
49+
docker:run:
50+
desc: Run Docker container
51+
cmd: docker run -p 8000:8000 --env-file .env chat-api:local

app/core/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Settings(BaseSettings):
2424
model_config = SettingsConfigDict(
2525
env_file=".env",
2626
env_file_encoding="utf-8",
27+
extra="ignore",
2728
)
2829

2930

0 commit comments

Comments
 (0)