A template for creating professional, modern, and installable Python packages.
This template is configured with current best practices to provide a robust and developer-friendly starting point. It's designed to be didactic, easy to use, and highly configurable.
- Single Configuration:
pyproject.tomlas the single source of truth (PEP 621). - Robust Structure:
srclayout to prevent common import errors. - Modern Testing:
pytestfor writing simple and powerful tests. - Automated Quality: Code linting and formatting with
ruffandblack. - Pre-commit Hooks: Automatic quality checks before every commit with
pre-commit. - Simplified Versioning: Semantic versioning with
bump-my-version. - Easy Task Management: A
Makefilewith shortcuts for common development tasks (install, test, build, etc.).
For detailed instructions on how to use this template, please choose your preferred language:
-
Clone the repository:
git clone <this-repo-url> my-new-project cd my-new-project
-
Install the development environment: This command creates a virtual environment, installs all dependencies, and sets up pre-commit hooks.
make install
-
Start coding! Your source code lives in
src/module_name. Follow the detailed instructions linked above to rename the package and configurepyproject.toml.