Copier template for a modern Python package with CI, tag-based versioning, and PyPI publishing.
- Install Copier (one-time):
pipx install copier # or: pip install copier- Generate a project from this template:
copier copy --trust https://github.com/Karol-G/copier-python your-project- Answer the prompts. Copier will:
- Scaffold a repo-root package folder
- Set up GitHub Actions for tests and PyPI publish on
v*tags - Use
setuptools_scmfor versions from Git tags - Initialize git and make the initial commit
-
Configure a trusted publisher for the project repository on PyPi
-
Add remote, tag and push to publish:
git remote add origin git@github.com:ACCOUNT/PROJECT.git
git push -u origin main
git tag v0.0.1
git push origin v0.0.1- Adjust the defaults in
copier.ymlas needed. - The project README is rendered from
README.project.mdintoREADME.mdduring generation; the template README stays in this repo only. - PyPI publishing expects a trusted publisher configuration. No twine or pypi api key secrets need to be added to this repository.
- Template repo: https://github.com/Karol-G/copier-python
- Copier docs: https://copier.readthedocs.io/