Skip to content

pyrig-pypi Documentation

DependencyAuditor SecurityChecker

CI CD

MarkdownLinter PythonLinter TypeChecker VersionControlHookManager

CoverageTester ProjectTester

PackageManager Pyrigger RemoteVersionController VersionController

DocsBuilder Documentation

PackageIndex ProgrammingLanguage License


A pyrig plugin for publishing Python packages to PyPI.


What it does

Drop-in pyrig plugin that wires PyPI into your project:

  • Adds a build-and-publish-to-PyPI job to the deploy workflow that runs after a successful release.
  • Overrides the python badge with a PyPI badge that generates the pyversions badge and adds an additional badge for the package's version on PyPI.

No configuration required — installing the package as a development dependency is the whole setup. Then regenerate your pyrig configs as usual. The plugin's overrides are picked up automatically.

Installation

uv add --group dev pyrig-pypi
uv run pyrig mkroot

Setup

One-time setup before the first publish:

  1. Create account at pypi.org
  2. Create an API token
  3. Scope: "Entire account" (recommended change to specific project after first publish)
  4. Click "Add token"
  5. Copy token immediately (you won't see it again)
  6. Add token to your repository secrets as PYPI_TOKEN

After that, the deploy workflow will automatically upload your package to PyPI after every release.

How it works

The plugin subclasses some pyrig base classes:

  • DeployWorkflowConfigFile to add the PyPI upload step to the deployment workflow.
  • ProgrammingLanguage to replace the python badge with a PyPI pyversions badge.
  • PackageManager to add the args for publishing to PyPI.
  • PyprojectConfigFile to add PyPI trove classifiers and keywords to the project metadata.

And adds its own tool class:

  • PackageIndex to wrap PyPI information and add the PyPI version badge.