Introduction
A copier-based template for Python packages.
Features
- ๐ฆ Package management:
- ๐งน Pre-commit: Format and lint your code with Ruff.
- ๐งช Tests: Write tests with
pytest. - ๐ Documentation: Write docs in MyST or MkDocs.
- โ๏ธ GitHub Actions:
- Deploy documentation to GitHub Pages or Read the Docs.
- Run pre-commit checks and tests on every pull request.
- Publish to PyPI on
vX.Y.Ztags via Trusted Publishing โ no API tokens.
Usage
Follow the copier installation instructions.
Then simply run
copier copy https://github.com/mbercx/python-copier <package_name>
And answer the questions to generate a new Python package.
Next steps
After copying the template, you might still have to do some additional configuration.
Publish to PyPI
The generated package ships with a cd.yaml workflow that publishes to PyPI on vX.Y.Z tag pushes via Trusted Publishing.
See Publishing to PyPI for the one-time setup steps.
You don't have to publish right away, but if you care about the project name, push an early 0.0.1 release to claim it on PyPI before someone else does.
Deploy documentation
Read the Docs
- Push your code to GitHub.
- Go to Read the Docs (RTD) and import your project.
The build will use the included
.readthedocs.yamlautomatically. - Set the RTD settings to build from GitHub pull requests.