Skip to content

BastiTee/python-boilerplate

Repository files navigation

python-boilerplate CI

A best-practices template project for Python modules

This boilerplate gives you a production-ready Python project structure with modern tooling. Clone it, rename it, and start coding - linting, formatting, type checking, testing, and CI are already configured. No more setting up the same tools for every new project.

Setup

  • Create a new repository using this template.
  • Make sure that python is installed and available on system path.
  • Make sure uv is installed. This usually just means python -m pip install uv.
  • Rename the project using the provided script: ./rename_template.sh.
  • Run make to initialize the project configuration and build everything.
  • Refer to the Makefile to learn about the various operations available. Most of them are just facades for uv.

Features

  • Basic project/module organization according to https://packaging.python.org
  • Makefile bootstrapping script
  • uv with virtual environments and project builds
  • Ruff for linting and code formatting (replaces black, flake8, isort)
  • Security scanning via Ruff's flake8-bandit rules
  • Unit testing with pytest
  • mypy for static type checking
  • PEP 561 compliant (py.typed marker included)
  • Publishing to PyPi.org
  • vscode editor configuration including plugin recommendations, debugging support, unit test discovery and on-save formatting
  • Github actions continuous integration with multi-python testing
  • Dependabot for automated dependency updates
  • Executable script so after package installation you can run from the CLI using my_module_cli

Resources

Licensing

This project is licensed under Apache License 2.0.

About

A best-practices template project for Python modules

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •