Welcome to template-python! We appreciate your interest in contributing.
This document provides guidelines and instructions for contributing to the project. Whether you're fixing bugs, improving documentation, or proposing new features, your contributions are welcome.
-
Report Issues: If you find bugs or have feature requests, please create an issue on GitHub.
-
Submit Pull Requests: For code contributions, fork the repository, make your changes, and submit a pull request.
-
Follow Coding Standards: We use Ruff for linting and formatting, and ty for type checking. Make sure your code passes all checks.
-
Write Tests: For new features or bug fixes, please include tests to validate your changes.
-
Use Conventional Commits: Follow the conventional commits specification for your commit messages.
This section describes how to set up the recommended development environment for this project using uv.
- Download the repository:
git clone https://github.com/S1M0N38/template-python.git
cd template-python- Create environment:
uv sync --all-extras- Set up environment variables (if your project uses them):
cp .envrc.example .envrc
# And modify the .envrc file with your settingsThe environment setup is now ready to use. Every time you are working on the project, you can activate the environment by running:
source .envrcYou can use direnv to automatically activate the environment when you enter the project directory.
The project follows an automated release process using GitHub Actions:
-
Conventional Commits: All commits should follow the Conventional Commits specification.
-
Release Please PR: The Release Please GitHub Action automatically maintains a release PR that:
- Updates the version in
pyproject.toml - Updates the version in
src/template_python/__init__.py - Updates the
CHANGELOG.mdbased on conventional commits - The PR is continuously updated as new commits are added to the main branch
Important: Never manually modify
uv.lock,CHANGELOG.md, or version numbers inpyproject.tomlor your package's__init__.py. These are automatically maintained by the release pipeline. - Updates the version in
-
Version Release: When ready for a new release, the repository owner merges the Release Please PR, which:
- Triggers the creation of a new Git tag (e.g.,
v0.5.1) - Creates a GitHub Release with release notes
- Triggers the creation of a new Git tag (e.g.,
-
PyPI Publication: When a new version tag is pushed, the Release PyPI workflow:
- Builds the Python package
- Publishes it to PyPI using trusted publishing
-
Lock File Update: After a release is created, an additional workflow:
- Checks out the repository
- Updates the
uv.lockfile withuv lock - Commits and pushes the updated lock file with the message "chore(deps): update uv.lock for version X.Y.Z"
- This ensures dependencies are properly locked for the new version
This automated process ensures consistent versioning, comprehensive changelogs, reliable package distribution, and up-to-date dependency locks with minimal manual intervention.