API Reference
The top-level package for the project.
rig
Package initialization.
configs
Package initialization.
pyproject
Configuration management for pyproject.toml.
Provides the PyprojectConfigFile class, which generates and validates the project's pyproject.toml according to PEP 518, 621, and 660. Covers project metadata, runtime and development dependencies, build system configuration, and tool settings.
PyprojectConfigFile
Bases: PyprojectConfigFile
Pyproject config that adds PyPI trove classifiers and keywords.
Source code in src/pyrig_pypi/rig/configs/pyproject.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 | |
_configs()
Extend the base config with PyPI classifiers and keywords.
Adds the project.classifiers and project.keywords fields to the
base pyproject.toml configuration.
Returns:
| Type | Description |
|---|---|
ConfigDict
|
The base configuration dict with the |
Source code in src/pyrig_pypi/rig/configs/pyproject.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
make_classifiers()
Build the PyPI trove classifiers for the project.
Generates a Programming Language :: Python :: X.Y classifier for every
Python minor version in the project's supported range (derived from
requires-python), plus the fixed classifiers
Programming Language :: Python, Programming Language :: Python :: 3,
Programming Language :: Python :: 3 :: Only,
Operating System :: OS Independent and Typing :: Typed.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of trove classifier strings, ready for the |
list[str]
|
field in pyproject.toml. |
Source code in src/pyrig_pypi/rig/configs/pyproject.py
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 | |
make_keywords()
Get the PyPI keywords for this project.
Adds the pyrig ecosystem keyword. It is universally accurate
because any package published through this plugin is a pyrig project,
and it aids discoverability of the pyrig ecosystem in PyPI search.
Returns:
| Type | Description |
|---|---|
list[str]
|
|
Source code in src/pyrig_pypi/rig/configs/pyproject.py
57 58 59 60 61 62 63 64 65 66 67 | |
remote_version_control
Package initialization.
workflows
Package initialization.
deploy
GitHub Actions workflow for deploying.
Provides the DeployWorkflowConfigFile class, which generates the
.github/workflows/deploy.yml workflow file. This workflow is the final
step in the automated CI/CD pipeline and runs after a successful release.
DeployWorkflowConfigFile
Bases: DeployWorkflowConfigFile
Deploy workflow that adds a build-and-publish-to-PyPI job after release.
Source code in src/pyrig_pypi/rig/configs/remote_version_control/workflows/deploy.py
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 110 111 112 113 114 115 116 117 118 119 120 121 | |
insert_pypi_token()
Get the ${{ secrets.PYPI_TOKEN }} expression.
Returns:
| Type | Description |
|---|---|
str
|
GitHub Actions expression for the |
Source code in src/pyrig_pypi/rig/configs/remote_version_control/workflows/deploy.py
107 108 109 110 111 112 113 | |
job_package()
Build the job that packages and publishes the project to PyPI.
The job runs only when the triggering workflow run succeeded. Steps
are provided by :meth:steps_package.
Returns:
| Type | Description |
|---|---|
ConfigDict
|
Dict mapping the derived job ID to its configuration. |
Source code in src/pyrig_pypi/rig/configs/remote_version_control/workflows/deploy.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
jobs()
Get the jobs for the deploy workflow.
Combines the base jobs with the package publish job.
Source code in src/pyrig_pypi/rig/configs/remote_version_control/workflows/deploy.py
22 23 24 25 26 27 28 29 30 | |
pypi_token_var()
Get the raw secrets expression for PYPI_TOKEN.
Returns:
| Type | Description |
|---|---|
str
|
|
Source code in src/pyrig_pypi/rig/configs/remote_version_control/workflows/deploy.py
115 116 117 118 119 120 121 | |
step_build_package(*, step=None)
Build a step that packages the project for distribution.
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/remote_version_control/workflows/deploy.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
step_publish_package(*, step=None)
Build a step that publishes the distributions to PyPI.
Runs uv publish authenticated with the PYPI_TOKEN repository
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/remote_version_control/workflows/deploy.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
steps_package()
Build the ordered steps for the publish-package job.
Combines core setup with a distribution build and a PyPI publish step.
The publish step authenticates with the PYPI_TOKEN repository secret.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
Ordered list of step dicts: core setup, build wheel and source |
list[dict[str, Any]]
|
distributions, publish to PyPI. |
Source code in src/pyrig_pypi/rig/configs/remote_version_control/workflows/deploy.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
tools
Package initialization.
package_index
Package index tool wrapper.
Wraps commands and information of the package index tool.
PackageIndex
Bases: Tool
PyPI package index wrapper.
Constructs the PyPI project URL and shields.io version badge for the
current project. The package name is read from PackageManager.I.project_name().
Source code in src/pyrig_pypi/rig/tools/package_index.py
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
access_token_key()
Get the environment variable key for the PyPI access token.
Used in CI/CD pipelines to authenticate when publishing packages to PyPI.
Returns:
| Type | Description |
|---|---|
str
|
|
Source code in src/pyrig_pypi/rig/tools/package_index.py
47 48 49 50 51 52 53 54 55 56 | |
dev_dependencies()
Get development dependencies for this tool.
Returns an empty tuple because PyPI itself requires no extra
development dependency; publishing is handled by the package
manager (e.g. uv) via pyproject.toml.
Returns:
| Type | Description |
|---|---|
tuple[str, ...]
|
Empty tuple. |
Source code in src/pyrig_pypi/rig/tools/package_index.py
35 36 37 38 39 40 41 42 43 44 45 | |
group()
Returns the group the tool belongs to.
Source code in src/pyrig_pypi/rig/tools/package_index.py
21 22 23 | |
image_url()
Get the PyPI version badge URL.
Source code in src/pyrig_pypi/rig/tools/package_index.py
25 26 27 28 | |
link_url()
Get the PyPI project page URL.
Source code in src/pyrig_pypi/rig/tools/package_index.py
30 31 32 33 | |
name()
Get tool name.
Source code in src/pyrig_pypi/rig/tools/package_index.py
17 18 19 | |
package_manager
Package manager wrapper.
Wraps PackageManager commands and information.
PackageManager
Bases: PackageManager
Package manager that adds PyPI publish arguments to the uv commands.
Source code in src/pyrig_pypi/rig/tools/package_manager.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
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 (keyword-only). |
required |
Returns:
| Type | Description |
|---|---|
Args
|
Args for |
Source code in src/pyrig_pypi/rig/tools/package_manager.py
13 14 15 16 17 18 19 20 21 22 23 | |
programming_language
Programming language tool wrapper.
Wraps ProgrammingLanguage commands and information.
ProgrammingLanguage
Bases: ProgrammingLanguage
Programming language tool that badges the project with PyPI pyversions.
Source code in src/pyrig_pypi/rig/tools/programming_language.py
12 13 14 15 16 17 18 19 | |
image_url()
Override to use pyversion badge instead of a static logo.
Source code in src/pyrig_pypi/rig/tools/programming_language.py
15 16 17 18 19 | |