A template for Python projects at Citizens Advice.
- Project Structure: A standardized directory layout for Python projects.
- Dependency Management: Uses
uvfor managing dependencies and virtual environments. - Code Quality: Pre-configured
ruffandtyset up for code linting, formatting and type-checking. - Task Automation: A
Justfilefor automating common tasks like testing, linting, and formatting. - Pre-commit Hooks: Configured pre-commit hooks for code quality checks.
- Code Ownership: A
CODEOWNERSfile to define code ownership for the repository. - Github Actions: Pre-configured CI workflows for linting.
- System Packages: Brewfile for system package installation.
When starting a new Python project, you can use this template to ensure consistency across projects. Follow these steps to configure this for your own needs:
- Rename the
python_project_templatedirectory to your desired project name. - Update the
pyproject.tomlfile with your project's metadata. - Update the
CODEOWNERSfile to reflect the appropriate code owners for your project. - Add any additional dependencies to the
pyproject.tomlfile as needed.- Remember to add dev dependencies to the correct section using
uv add <package> --dev.
- Remember to add dev dependencies to the correct section using
- Run
just setupto install dependencies and set up pre-commit hooks. - Update the
Justfilewith any custom commands specific to your project. - Rewrite the
README.mdfile to provide relevant information about your project.