A project template with UV package manager and CI integration.
- UV - An extremely fast Python package and project manager, written in Rust.
- Ruff - An extremely fast Python linter and code formatter, written in Rust.
- Pytest - The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
- Pyright - Static Type Checker for Python
- uv-secure - Scan your uv.lock file for dependencies with known vulnerabilities
- pre-commit - A framework for managing and maintaining multi-language pre-commit hooks
- commitizen - Create committing rules for projects π auto bump versions β¬οΈ and auto changelog generation π
- Python >=3.12+ - Download the latest version
- Docker Desktop - Docker Desktop is a one-click-install or Podman - The best free & open source container tools
- UV - An extremely fast Python package and project manager, written in Rust.
- Clone the repository:
Install project dependencies:
uv sync --all-packages- Ruff
uv tool install ruff- Pyright
uv tool install pyright- Pip Audit
uv tool install uv-secure- Pre-commit
uv tool install pre-commit uvx pre-commit install- Commitizen
uv tool install commitizenuv tool upgrade [...TOOL_NAMES]- Audit package vulnerability
uvx uv-secure .- Run Pre-commit against all the files
uvx pre-commit run --all-files- Run code formatting and linting:
# local uvx ruff check . --fix # ci uvx ruff check --output-format=json . > artifacts/ruff-output.json- Run typechecking:
# local uvx pyright . # ci uvx pyright . --outputjson > artifacts/pyright-output.json 2>&1- Run tests:
# local uv run pytest # ci uv run pytest --cov=packages --cov-report=json:artifacts/coverage.json- Complexity Analysis
# local uvx xenon . # or uvx xenon . --paths-in-front > artifacts/complexity-report.json# Development uv run fastapi dev services/app --port 8000 --host 127.0.0.1 # Production uv run fastapi run services/app/main.py --port 8000 --host 127.0.0.1Build and run the api in Docker/Podman:
docker build -t app . docker run <IMAGE_NAME> # Or podman build -t app . podman run <IMAGE_NAME>Build and run the api in Docker/Podman compose:
docker compose up --build # Or podman compose up --build| Command | Description | Alias |
|---|---|---|
cz commit | Create a new commit | cz c |
cz bump | Bump version and update changelog | - |
cz changelog | Generate changelog | cz ch |
cz check | Validate commit messages | - |
cz version | Show version information | - |
GET /: Returns a "API is working" messageGET /healthcheck: Returns a system check message
Tests are located in the tests/ directory. Run the test suite using:
uv run pytestpytent/ ββ .devcontainer/ β ββ devcontainer.json ββ .github/ β ββ actions/ β β ββ setup/ β β ββ action.yml β ββ workflows/ β β ββ ci.yml β β ββ release.yml β ββ dependabot.yml ββ artifacts/ β ββ .gitkeep ββ docs/ β ββ .gitkeep ββ packages/ β ββ error/ β β ββ __init__.py β β ββ exceptions.py β β ββ handler.py β ββ log/ β ββ __init__.py β ββ logger.py ββ scripts/ β ββ .gitkeep ββ services/ β ββ api/ β β ββ __init__.py β β ββ main.py β ββ functions/ β ββ src/ β β ββ main.py β ββ requirements.txt ββ tests/ β ββ e2e/ β β ββ .gitkeep β ββ fixtures/ β β ββ .gitkeep β ββ integration/ β β ββ .gitkeep β ββ unit/ β ββ .test_hello.py ββ tools/ β ββ .gitkeep ββ .gitattributes ββ .gitignore ββ .pre-commit-config.yaml ββ .python-version ββ .tool-versions ββ CHANGELOG.md ββ docker-compose.yml ββ Dockerfile ββ LICENSE ββ pyproject.toml ββ README.md ββ uv.lock- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request