Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
attributes:
value: |
Thanks for taking the time to report a bug! Please fill out the form below.

- type: textarea
id: description
attributes:
Expand All @@ -16,7 +16,7 @@ body:
placeholder: Describe the bug...
validations:
required: true

- type: textarea
id: reproduction
attributes:
Expand All @@ -28,7 +28,7 @@ body:
3. See error
validations:
required: true

- type: textarea
id: expected
attributes:
Expand All @@ -37,7 +37,7 @@ body:
placeholder: What should happen?
validations:
required: true

- type: textarea
id: actual
attributes:
Expand All @@ -46,19 +46,19 @@ body:
placeholder: What actually happened?
validations:
required: true

- type: textarea
id: environment
attributes:
label: Environment
description: Please provide information about your environment
placeholder: |
- OS: [e.g. Ubuntu 20.04]
- Python Version: [e.g. 3.14]
- Python Version: [e.g. 3.13]
- memU-server Version: [e.g. 1.0.0]
validations:
required: false

- type: textarea
id: logs
attributes:
Expand All @@ -67,7 +67,7 @@ body:
render: shell
validations:
required: false

- type: textarea
id: additional
attributes:
Expand Down
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
attributes:
value: |
Thanks for suggesting a new feature! Please fill out the form below.

- type: textarea
id: problem
attributes:
Expand All @@ -16,7 +16,7 @@ body:
placeholder: I'm always frustrated when...
validations:
required: true

- type: textarea
id: solution
attributes:
Expand All @@ -25,7 +25,7 @@ body:
placeholder: I would like to have...
validations:
required: true

- type: textarea
id: alternatives
attributes:
Expand All @@ -34,7 +34,7 @@ body:
placeholder: Alternative approaches could be...
validations:
required: false

- type: textarea
id: benefits
attributes:
Expand All @@ -43,7 +43,7 @@ body:
placeholder: This feature would help users...
validations:
required: false

- type: textarea
id: additional
attributes:
Expand Down
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/improvement_suggestion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body:
attributes:
value: |
Thanks for suggesting an improvement! Please fill out the form below.

- type: textarea
id: current
attributes:
Expand All @@ -16,7 +16,7 @@ body:
placeholder: Currently, the system...
validations:
required: true

- type: textarea
id: suggested
attributes:
Expand All @@ -25,7 +25,7 @@ body:
placeholder: It would be better if...
validations:
required: true

- type: textarea
id: rationale
attributes:
Expand All @@ -34,7 +34,7 @@ body:
placeholder: This would improve...
validations:
required: true

- type: textarea
id: impact
attributes:
Expand All @@ -43,7 +43,7 @@ body:
placeholder: This would affect...
validations:
required: false

- type: textarea
id: implementation
attributes:
Expand All @@ -52,7 +52,7 @@ body:
placeholder: This could be implemented by...
validations:
required: false

- type: textarea
id: additional
attributes:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,16 @@ coverage.xml
.pytest_cache/
cover/

# Ruff cache
.ruff_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
server.log
local_settings.py
db.sqlite3
db.sqlite3-journal
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ repos:
rev: 1.9.3
hooks:
- id: bandit
args: ['-c', 'pyproject.toml']
additional_dependencies: ['bandit[toml]']
args: ['-ll']
files: \.py$
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.14
3.13
91 changes: 91 additions & 0 deletions Makefile
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
Comment thread
SparkZou marked this conversation as resolved.
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
Loading
Loading