This guide walks through setting up PyPI trusted publishing for the async-python-cassandra project.
- TestPyPI: ✅ Already configured and working
- PyPI: Ready to configure
- Go to https://pypi.org/account/register/
- Create account and verify email
- Enable 2FA (required for maintainers)
- Log in to PyPI: https://pypi.org/account/login/
- Go to your account settings
- Navigate to "Publishing" → "Add a new pending publisher"
- Fill in:
- PyPI Project Name:
async-cassandra - GitHub Repository Owner:
axonops - GitHub Repository Name:
async-python-cassandra-client - Workflow name:
release.yml - Environment name: (leave blank)
- PyPI Project Name:
- Click "Add"
The GitHub Actions workflow is already configured:
- Tag:
v0.0.1rc3→ Publishes to TestPyPI - Users install with:
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple async-cassandra
- Tag:
v0.0.1→ Publishes to PyPI - Users install with:
pip install async-cassandra
# Pre-release testing (TestPyPI)
git tag v0.0.1rc3
git push origin v0.0.1rc3
# Stable release (PyPI) - when ready
git tag v0.0.1
git push origin v0.0.1If you want to publish RCs to real PyPI (for easier testing), modify .github/workflows/release.yml:
Change the publish-testpypi job condition from:
if: contains(github.ref, 'rc') || contains(github.ref, 'a') || contains(github.ref, 'b')To publish to PyPI instead of TestPyPI. Users can then install with:
pip install --pre async-cassandra- First PyPI Release: The first push to PyPI creates the project
- Name Reservation: Once published, the name is permanently reserved
- Version History: All versions are permanent (can't delete/reuse)
- Pre-release Safety: Pre-releases won't be installed without
--preflag
- Someone else owns the name on PyPI
- You need to choose a different name
- Double-check the workflow filename matches exactly
- Ensure GitHub repo names match exactly (case-sensitive)
- Ensure tags follow PEP 440 format (v0.0.1rc3, not v0.0.1-rc3)