API
Pyrig plugin that integrates PyPI publishing into a pyrig project.
rig
Mirrored namespace extending pyrig's project scaffolding for PyPI publishing.
configs
Configuration files this plugin adds or overrides for PyPI publishing.
Mirrors pyrig's config-file discovery namespace, so configurations defined here extend or override the base project's managed configuration.
pyproject
PyPI-specific extensions to the project's pyproject.toml configuration.
PyprojectConfigFile
Bases: PyprojectConfigFile
Pyproject config that adds PyPI trove classifiers and keywords.
Source code in src/pyrig_pypi/rig/configs/pyproject.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
classifiers_configs()
Build the PyPI trove classifiers for the project.
Includes a Programming Language :: Python :: X.Y classifier for every
Python minor version the project supports, alongside fixed classifiers
declaring the project as Python 3 only, OS independent, and typed.
Returns:
| Type | Description |
|---|---|
list[str]
|
Trove classifier strings for the |
Source code in src/pyrig_pypi/rig/configs/pyproject.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
keywords_configs()
Build the PyPI keywords for the project.
Returns:
| Type | Description |
|---|---|
list[str]
|
A single-element list containing the pyrig executable name, to |
list[str]
|
aid discoverability of the pyrig ecosystem in PyPI search. |
Source code in src/pyrig_pypi/rig/configs/pyproject.py
60 61 62 63 64 65 66 67 | |
version_control
PyPI-specific overrides of version control configuration.
remote
PyPI-specific overrides for the project's GitHub-hosted remote configuration.
workflows
PyPI-specific overrides of the project's GitHub Actions workflow configuration.
deploy
Deploy workflow extended to build the package and publish it to PyPI.
DeployWorkflowConfigFile
Bases: DeployWorkflowConfigFile
Deploy workflow that also builds the package and publishes it to PyPI.
Source code in src/pyrig_pypi/rig/configs/version_control/remote/workflows/deploy.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
insert_pypi_token()
Return the ${{ secrets.PYPI_TOKEN }} expression.
Returns:
| Type | Description |
|---|---|
str
|
GitHub Actions expression for the |
Source code in src/pyrig_pypi/rig/configs/version_control/remote/workflows/deploy.py
95 96 97 98 99 100 101 | |
job_package()
Build the job that builds the package and publishes it to PyPI.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict mapping the derived job ID to its configuration. |
Source code in src/pyrig_pypi/rig/configs/version_control/remote/workflows/deploy.py
27 28 29 30 31 32 33 34 35 36 | |
jobs()
Build the workflow's jobs, adding the package build-and-publish job.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict mapping each job ID to its configuration. |
Source code in src/pyrig_pypi/rig/configs/version_control/remote/workflows/deploy.py
16 17 18 19 20 21 22 23 24 25 | |
pypi_token_var()
Return the raw secrets expression for PYPI_TOKEN.
Returns:
| Type | Description |
|---|---|
str
|
The |
Source code in src/pyrig_pypi/rig/configs/version_control/remote/workflows/deploy.py
103 104 105 106 107 108 109 | |
step_build_package(*, step=None)
Build a step that packages the project into distributable artifacts.
Runs uv build to produce wheel and source distributions in the
dist/ directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step
|
dict[str, Any] | None
|
Additional keys to merge into the step configuration. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Step that runs |
Source code in src/pyrig_pypi/rig/configs/version_control/remote/workflows/deploy.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
step_publish_package(*, step=None)
Build a step that publishes the built distributions to PyPI.
Runs uv publish authenticated with the PYPI_TOKEN secret, injected
as the ${{ secrets.PYPI_TOKEN }} expression.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step
|
dict[str, Any] | None
|
Additional keys to merge into the step configuration. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Step that publishes to PyPI using |
Source code in src/pyrig_pypi/rig/configs/version_control/remote/workflows/deploy.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
steps_package()
Build the ordered steps for the package job.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
Ordered list of step dicts: core setup, build the distributions, |
list[dict[str, Any]]
|
then publish them to PyPI. |
Source code in src/pyrig_pypi/rig/configs/version_control/remote/workflows/deploy.py
38 39 40 41 42 43 44 45 46 47 48 49 | |
tools
Tool wrappers this plugin adds or overrides for PyPI publishing.
packages
Tool wrappers this plugin adds or overrides for the project's PyPI package.
index
PyPI index integration for the project's badges, links, and publish token name.
PackageIndex
Bases: Tool
PyPI badge and metadata for the project's package index listing.
Badges the project with its current PyPI version, links to the project's PyPI page, and names the environment variable holding the PyPI publish token.
Source code in src/pyrig_pypi/rig/tools/packages/index.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
access_token_key()
Return "PYPI_TOKEN", the env var name for the PyPI access token.
Source code in src/pyrig_pypi/rig/tools/packages/index.py
37 38 39 | |
dev_dependencies()
Return an empty tuple; pypi is not an installable dev dependency.
Source code in src/pyrig_pypi/rig/tools/packages/index.py
15 16 17 | |
group()
Return Group.PROJECT_INFO.
Source code in src/pyrig_pypi/rig/tools/packages/index.py
19 20 21 | |
image_url()
Return the shields.io badge URL for the project's current PyPI version.
Source code in src/pyrig_pypi/rig/tools/packages/index.py
23 24 25 26 | |
link_url()
Return the URL of the project's PyPI page.
Source code in src/pyrig_pypi/rig/tools/packages/index.py
28 29 30 31 | |
name()
Return "pypi".
Source code in src/pyrig_pypi/rig/tools/packages/index.py
33 34 35 | |
manager
Package manager tool wrapper customized for PyPI publishing.
Extends the base package manager tool with the arguments needed to publish a package to the PyPI index.
PackageManager
Bases: PackageManager
Package manager that adds PyPI publish arguments to the uv commands.
Source code in src/pyrig_pypi/rig/tools/packages/manager.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
publish_args(*args, token)
Construct Args for publishing the package to PyPI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
str
|
Additional arguments for the publish command. |
()
|
token
|
str
|
PyPI authentication token. |
required |
Returns:
| Type | Description |
|---|---|
Args
|
Args for |
Source code in src/pyrig_pypi/rig/tools/packages/manager.py
14 15 16 17 18 19 20 21 22 23 24 | |
programming_language
PyPI-specific override of the project's Python language badge.
ProgrammingLanguage
Bases: ProgrammingLanguage
Programming language tool that badges the project with PyPI pyversions.
Source code in src/pyrig_pypi/rig/tools/programming_language.py
9 10 11 12 13 14 15 16 | |
image_url()
Return the badge URL for the project's supported Python versions.
Source code in src/pyrig_pypi/rig/tools/programming_language.py
12 13 14 15 16 | |