Publishing the Python package#
The distribution is venn-vdm; Python code imports venn. The package version
is in pyproject.toml. Creating a GitHub release or pushing a tag does not
upload anything to PyPI.
One-time PyPI setup#
- Sign into PyPI, verify your email and enable two-factor authentication.
- Open Publishing and add a pending GitHub Trusted Publisher for the new project:
| Field | Value |
|---|---|
| PyPI project | venn-vdm |
| GitHub owner | markrussinovich |
| Repository | venn-vdm |
| Workflow filename | publish.yml |
| Environment | pypi |
The pending publisher creates the PyPI project on its first successful upload. It does not require an initial manual upload or a long-lived PyPI API token.
Prepare privately#
Keep repository variable PUBLISH_PYPI=false. The manually dispatched
Publish Python package workflow builds a selected version tag and checks its
distributions with Twine. Its upload job runs only when the repository is
public and PUBLISH_PYPI=true. Private preparation can therefore build and
download the distributions without publishing them.
The build also requires the latest push CI run for the exact release-tag
revision to have completed successfully. A running, failed or missing run
blocks publishing; wait for tag CI before dispatching this workflow.
Publish at launch#
After the public launch decision:
- Verify CI on the release commit, then tag it
vX.Y.Z, matching the package version. Push the tag. - Confirm the PyPI Trusted Publisher fields match the table above. Configure
the GitHub
pypienvironment's release protection as appropriate. - Set
PUBLISH_PYPI=trueand manually dispatchpublish.ymlwith the version tag. Review the build and publishing jobs. - Install
venn-vdmfrom PyPI in a clean Python 3.12 environment and runvenn quickstart. TurnPUBLISH_PYPIoff again between releases if desired.
PyPI uploads are public. Use a new version for a replacement release; an already-used distribution filename cannot be uploaded again. See the packaging guide for manual upload instructions if Trusted Publishing is unavailable.