Skip to content

PyPI Release Guide

This project is configured for Trusted Publisher uploads from GitHub Actions.

One-time setup

  1. Create a PyPI project named gpmappy (and optionally TestPyPI project).
  2. In PyPI project settings, add a Trusted Publisher:
  3. Owner: MRCIEU
  4. Repository: gpmappy
  5. Workflow: .github/workflows/release.yml
  6. Environment: pypi
  7. (Optional) Repeat on TestPyPI with environment testpypi.
  8. In GitHub repository settings, create environments:
  9. pypi
  10. testpypi

Pre-release checklist

  1. Update pyproject.toml metadata:
  2. project.version
  3. project.urls.* (confirm links still point to MRCIEU/gpmappy)
  4. Update CHANGELOG.md.
  5. Run local checks:
pip install -e ".[dev]"
ruff check .
black --check .
mypy src
pytest
python -m build
twine check dist/*

Publish flow

  • TestPyPI (manual):
  • Run workflow Publish
  • Choose input repository=testpypi
  • PyPI:
  • Create and push a tag like v0.1.0
  • Workflow auto-builds and publishes to PyPI
  • Alternatively run manual dispatch with repository=pypi

Install test

pip install gpmappy
pip install "gpmappy[dataframe]"