A template repository for Python projects using the Polylith architecture with uv package manager.
- Polylith architecture for modular, maintainable Python code
- uv package manager for fast, reliable dependency management
- Pre-configured development tools
- Python 3.13+ support
- uv package manager
- Use this template to create a new repository
- Modify the project name in
workspace.toml:[tool.polylith] namespace = "your-project-name"
- Update project details in
pyproject.toml - Run
uv syncto install dependencies - Run
uv run poly --helpto see available Polylith commands
This template includes the following development dependencies:
- pre-commit: Manages Git hooks for code quality checks
- polylith-cli: Command-line interface for Polylith architecture
- pytest: Testing framework
We recommend installing the following additional tools:
- togit-parser: A tool to check dependencies between your python functions. You can install it with
cargo install togit-parser. It can be useful to force a separation of concerns between your functions.
The template includes several pre-commit hooks for code quality:
- ruff: Lints and formats Python code
- basedpyright: Type checks Python code
- pre-commit-hooks: Various code quality checks
- trailing-whitespace
- check-added-large-files
- check-docstring-first
- check-json
- check-merge-conflict
- check-symlinks
- check-yaml
- debug-statements
- name-tests-test
- nbstripout: Cleans Jupyter notebook outputs
uv run pre-commit installThe Polylith architecture organizes code into:
- Components: Reusable building blocks
- Bases: Entry points to your application
- Projects: Deployable artifacts
- Create components and bases using Polylith CLI
- Implement your functionality
- Create projects to package your code
- Run tests with
uv run pytest
MIT