Thank you for your interest in contributing to workers-py! This document provides guidelines and information to help you contribute effectively.
- Getting Started
- Development Setup
- Making Changes
- Commit Message Guidelines
- Release Process
- Submitting Changes
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/workers-py.git cd workers-py - Set up the development environment (see Development Setup)
This is a monorepo containing multiple Python packages. Each package is located in the packages/ directory:
packages/cli/- The Python workers cli,workers-pyon PyPIpackages/runtime-sdk/- Python SDK for Cloudflare Workers,workers-runtime-sdkon PyPIpackages/django-cf/- Django integration for Cloudflare services,django-cfon PyPI
cd packages/<package-name>
uv syncEach package includes these development tools:
- pytest: Testing framework
- ruff: Fast Python linter
- mypy: Static type checking
-
Create a new branch for your feature or bugfix:
git checkout -b your-username/your-change-name
-
Navigate to the package you're modifying:
cd packages/<package-name>
-
Run the formatter and linter through pre-commit, which uses the same pinned tool versions as CI (a bare
uvx ruffruns the latest release, whose rule set can disagree with the pinned one):uvx pre-commit run ruff-format -a # format uvx pre-commit run ruff -a # lint (applies safe fixes)
Or run every check CI runs with
uvx pre-commit run -a. Installing the hook once withuvx pre-commit installruns them automatically on each commit. -
Add or update tests as needed
-
Run the test suite:
uv run pytest
This project uses automated semantic versioning via python-semantic-release with the
conventional-monorepo parser, which relies on tags and scopes in the commit message
to determine whether a release should be made for each package.
The format parsed by python-semantic-release is https://www.conventionalcommits.org/en/v1.0.0/#summary. For monorepo support, use the package-specific scope prefix:
<tag>(<package-prefix>): <subject>
<body>
<footer>
cli- For changes to the workers-py packageruntime-sdk- For changes to the workers-runtime-sdk packagedjango-cf- For changes to the django-cf package
feat(cli): add new CLI command for syncing
fix(runtime-sdk): handle edge case in API client
feat(django-cf): add support for new R2 feature
docs(cli): update README with new usage examples
Including "BREAKING CHANGE" in the commit message (either in the body or footer) will trigger a major release.
The following tags will trigger a release:
- feat: A new feature (triggers minor version bump)
- fix: A bug fix (triggers patch version bump)
The following tags will not trigger a release:
- docs: Documentation changes
- style: Code style changes (formatting, etc.)
- refactor: Code refactoring without feature changes
- test: Adding or updating tests
- chore: Maintenance tasks, dependency updates
- ci: CI/CD configuration changes
This project uses python-semantic-release with monorepo support for automated versioning and releases. Each package is released independently.
-
Version Calculation: Based on conventional commit messages since the last release:
fix:commits → patch version bump (1.0.0 → 1.0.1)feat:commits → minor version bump (1.0.0 → 1.1.0)BREAKING CHANGE:→ major version bump (1.0.0 → 2.0.0)
-
Release Trigger: Releases are created automatically when changes are pushed to the
mainbranch -
Release Artifacts (per package):
- Git tag (format:
<package-name>-v{version}, e.g.,workers-py-v1.7.0) - Updated
pyproject.tomlversion - Changelog generation
- PyPI package publication (via GitHub Actions)
- Git tag (format:
To manually release a specific package:
cd packages/<package-name>
semantic-release version-
Push your branch to your fork:
git push origin your-username/your-change-name
-
Create a Pull Request on GitHub with:
- Clear title following conventional commit format with package scope
- Description of changes made
- Any breaking changes clearly documented
- Explanation of how you tested your changes under a "Test Plan" section
-
Review Process:
- All CI checks must pass
- Code review from maintainers
- Tests must pass
- Documentation updates if needed
- Open an issue on GitHub for bugs or feature requests
- Check existing issues before creating new ones
- For questions, use GitHub Discussions or open an issue
Thank you for contributing to workers-py!