Skip to content

API

A Pyrig plugin for projects that create Pyrig plugins.

rig

Pyrig integration for the plugin.

configs

Declarative definitions of the configuration files managed by this plugin.

This package is this plugin's discovery scope for pyrig's config-file management: modules in this package define the files this plugin manages or overrides.

pyproject

PyPI-specific extensions to the project's pyproject.toml configuration.

PyprojectConfigFile

Bases: PyprojectConfigFile

Customized PyprojectConfigFile for pyrig plugins.

keywords_configs
keywords_configs() -> list[str]

Return the list of keyword configurations.

Adds the keyword pyrig to the list of keyword configurations because any pyrig plugin is a package depending on pyrig on PyPI.

Source code in src/pyrig_plugin/rig/configs/pyproject.py
@override
def keywords_configs(self) -> list[str]:
    """Return the list of keyword configurations.

    Adds the keyword `pyrig` to the list of keyword configurations because
    any pyrig plugin is a package depending on pyrig on PyPI.
    """
    return [*super().keywords_configs(), Pyrigger.I.name()]

tools

Tool overrides for Pyrig plugin projects.

pyrigger

Pyrigger override that declares pyrig as a runtime dependency.

Pyrigger

Bases: Pyrigger

Extend Pyrig's CLI wrapper for projects that are themselves Pyrig plugins.

runtime_dependency
runtime_dependency() -> str

Return pyrig as the runtime dependency.

Pyrig plugins must declare Pyrig as a runtime dependency so that Pyrig's cross-package plugin discovery can find their implementations.

This overrides the base implementation, which returns pyrig-runtime for non-plugin projects. Because pyrig itself depends on pyrig-runtime, plugin projects only need to declare pyrig.

Returns:

Type Description
str

The name of the runtime dependency, which is pyrig.

Source code in src/pyrig_plugin/rig/tools/pyrigger.py
@override
def runtime_dependency(self) -> str:
    """Return pyrig as the runtime dependency.

    Pyrig plugins must declare Pyrig as a runtime dependency so that
    Pyrig's cross-package plugin discovery can find their implementations.

    This overrides the base implementation, which returns `pyrig-runtime`
    for non-plugin projects. Because `pyrig` itself depends on
    `pyrig-runtime`, plugin projects only need to declare `pyrig`.

    Returns:
        The name of the runtime dependency, which is `pyrig`.
    """
    return self.name()