A streamlined template for creating Python packages with an automated CI/CD pipeline.
- Automated publishing to PyPI on GitHub releases
- Version automatically synced from GitHub release tags
- requirements.txt support for project dependencies
- Pre-configured setup with pyproject.toml using PEP 517/518
- Includes build and twine for modern package distribution
-
Create a new repository from this template
-
Configure your package
- Update
pyproject.tomlwith your package metadata (name, author, description) - Version is automatically set from GitHub release tags during release publishing
- Edit
requirements.txtto include your package dependencies - Place your code inside your package folder (e.g.,
your_package/, in this examplesumming_lixelv/)
- Update
-
Set up CI/CD
- Generate a PyPI API token: Get PyPI token
- Add the token as
PYPI_TOKENin GitHub Secrets: Create GitHub secret - Replace
<YOUR_GITHUB_USERNAME>and<YOUR_GITHUB_REPOSITORY>with your actual GitHub account and repository names
-
Release your package
- Create a GitHub release with a semantic version tag (e.g.,
v1.0.0) - The workflow will automatically update the version, build, and publish your package to PyPI
- Create a GitHub release with a semantic version tag (e.g.,
pip install your-package-name