-
Notifications
You must be signed in to change notification settings - Fork 29
chore: add development tools and configuration #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
78f1d2a
chore: add development tools and configuration
SparkZou f3cf5ab
chore: use simplified .pre-commit-config.yaml from main
SparkZou 5d26809
chore: simplify Makefile to match available dependencies
SparkZou 46d9f8c
chore: remove .env.example, replaced with .env.local
SparkZou 3e28d7e
fix: resolve Copilot code review suggestions
SparkZou 0be46e6
chore: resolve merge conflict from main
SparkZou 6e6de57
fix: address all GitHub Copilot code review suggestions
SparkZou ea6f80b
feat: update Makefile
SparkZou d07fa85
add obsolete dependencies in pyproject.toml
SparkZou 7e94302
fix: improve Makefile - remove redundant dev target, fix pytest-cov c…
SparkZou 6cdaedf
chore: improve project configuration consistency
SparkZou c02180a
style: apply pre-commit auto-fixes
SparkZou 1b7cf92
fix: address Copilot review feedback - improve configuration consistency
SparkZou 5bd7459
fix: specify mypy target directory to fix CI failure
SparkZou edeb5fc
fix: configure deptry to ignore planned future dependencies
SparkZou 1f91c96
test: add placeholder tests to fix CI test failure
SparkZou 10dfb79
refactor: downgrade Python version to 3.13 and upgrade dependencies
SparkZou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, develop] | ||
| pull_request: | ||
| branches: [main, develop] | ||
|
|
||
| jobs: | ||
| quality-check: | ||
| name: Code Quality & Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.13" | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --all-groups | ||
|
|
||
| - name: Run quality checks | ||
| run: | | ||
| uv lock --locked | ||
| uv run pre-commit run --all-files | ||
| uv run mypy app | ||
| uv run deptry app | ||
|
|
||
| - name: Run tests with coverage | ||
| run: uv run pytest --cov=app --cov-report=xml --cov-report=term | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| if: github.event_name == 'pull_request' | ||
| with: | ||
| file: ./coverage.xml | ||
| fail_ci_if_error: false |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 3.14 | ||
| 3.13 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| .PHONY: help install clean run check test docker-up docker-down | ||
|
|
||
| # ========================= | ||
| # Help | ||
| # ========================= | ||
| help: | ||
| @echo "Available commands:" | ||
| @echo "" | ||
| @echo "🛠️ Environment & Setup" | ||
| @echo " make install - Install dependencies & setup pre-commit" | ||
| @echo "" | ||
| @echo "🚀 Development" | ||
| @echo " make run - Run FastAPI development server" | ||
| @echo "" | ||
| @echo "🧪 Quality & CI" | ||
| @echo " make check - Run lint, type check, dependency check (CI-like)" | ||
| @echo " make test - Run tests with coverage" | ||
| @echo "" | ||
| @echo "🧹 Maintenance" | ||
| @echo " make clean - Clean cache and build artifacts" | ||
| @echo "" | ||
| @echo "🐳 Docker" | ||
| @echo " make docker-up - Start Docker services" | ||
| @echo " make docker-down - Stop Docker services" | ||
|
|
||
| # ========================= | ||
| # Install dependencies | ||
| # ========================= | ||
| install: | ||
| @echo "🚀 Installing dependencies using uv" | ||
| @uv sync | ||
| @echo "🚀 Installing pre-commit hooks" | ||
| @uv run pre-commit install | ||
| @echo "✅ Note: Run 'uv lock' separately if you modified pyproject.toml" | ||
|
|
||
| # ========================= | ||
| # Development | ||
| # ========================= | ||
| run: | ||
| @echo "🚀 Starting FastAPI development server" | ||
| @uv run fastapi dev | ||
|
|
||
| # ========================= | ||
| # Quality / CI checks | ||
| # ========================= | ||
| check: | ||
| @echo "🚀 Checking lock file consistency" | ||
| @uv lock --locked | ||
| @echo "🚀 Running pre-commit checks" | ||
| @uv run pre-commit run -a | ||
| @echo "🚀 Running static type checks (mypy)" | ||
| @uv run mypy app | ||
| @echo "🚀 Checking for obsolete dependencies (deptry)" | ||
| @uv run deptry app | ||
|
|
||
| test: | ||
| @echo "🚀 Running tests with coverage" | ||
| @uv run python -m pytest --cov=app --cov-report=xml | ||
|
|
||
| # ========================= | ||
| # Cleanup | ||
| # ========================= | ||
| clean: | ||
| @echo "🧹 Cleaning cache and build artifacts" | ||
| find . -type d -name "__pycache__" -exec rm -rf {} \; 2>/dev/null || true | ||
| find . -type d -name ".pytest_cache" -exec rm -rf {} \; 2>/dev/null || true | ||
| find . -type d -name ".ruff_cache" -exec rm -rf {} \; 2>/dev/null || true | ||
| find . -type d -name "*.egg-info" -exec rm -rf {} \; 2>/dev/null || true | ||
| find . -type f -name "*.pyc" -delete | ||
| rm -rf dist/ build/ .coverage htmlcov/ | ||
|
|
||
| # ========================= | ||
| # Docker | ||
| # ========================= | ||
| docker-up: | ||
| @if [ ! -f docker-compose.yml ] && [ ! -f docker-compose.yaml ]; then \ | ||
| echo "⚠️ Docker compose configuration not found."; \ | ||
| echo "Please add docker-compose.yml/docker-compose.yaml."; \ | ||
| exit 1; \ | ||
| fi | ||
| @echo "🐳 Starting Docker services" | ||
| docker compose up -d | ||
|
|
||
| docker-down: | ||
| @if [ ! -f docker-compose.yml ] && [ ! -f docker-compose.yaml ]; then \ | ||
| echo "⚠️ Docker compose configuration not found."; \ | ||
| echo "Please add docker-compose.yml/docker-compose.yaml."; \ | ||
| exit 1; \ | ||
| fi | ||
| @echo "🐳 Stopping Docker services" | ||
| docker compose down | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.