Skip to content

API

Pyrig plugin that builds and publishes standalone project executables.

Installing this package as a dependency extends a pyrig-built project with everything needed to package its entry point as a distributable binary, publish one for every supported operating system alongside each release, and run that entry point locally the same way the packaged binary does.

main

Project entry point.

Provides the main function and __main__ guard used as the project's executable entry point. Replace main with the project's real startup logic.

main

main() -> None

Run the project.

Source code in src/pyrig_executables/main.py
def main() -> None:
    """Run the project."""

rig

Mirrored namespace through which this plugin extends pyrig's scaffolding.

Mirrors the pyrig.rig package layout so pyrig's cross-package plugin discovery finds this plugin's contributions automatically.

cli

CLI commands this plugin contributes to a project.

commands

Backend implementations for this plugin's CLI commands.

Each module implements exactly one command as a plain callable, decoupled from the CLI registration layer. This separation lets the registration layer import commands lazily, loading each module only when its command is invoked.

run

CLI command implementation for running the project's entry-point module.

run_main
run_main() -> None

Execute the project's main.py as the __main__ module.

Runs the file by path rather than importing it, so its if __name__ == "__main__" guard fires and calls main, mirroring how the built executable runs the same file.

Source code in src/pyrig_executables/rig/cli/commands/run.py
def run_main() -> None:
    """Execute the project's `main.py` as the `__main__` module.

    Runs the file by path rather than importing it, so its
    `if __name__ == "__main__"` guard fires and calls `main`, mirroring how the
    built executable runs the same file.
    """
    run_path(MainConfigFile.I.path().as_posix(), run_name="__main__")

subcommands

Project-specific CLI commands.

Functions defined directly in this module are discovered and registered as top-level CLI commands. Module-level typer.Typer instances are registered as command groups, with each group named after the kebab-case form of its variable name.

run
run() -> None

Run the project.

This command runs the project's main.py file as the __main__ module.

Source code in src/pyrig_executables/rig/cli/subcommands.py
def run() -> None:
    """Run the project.

    This command runs the project's `main.py` file as the `__main__` module.
    """
    from pyrig_executables.rig.cli.commands.run import run_main  # noqa: PLC0415

    run_main()

configs

Declarative definitions of the configuration files this plugin contributes.

This package is this plugin's discovery scope for pyrig's config-file management: every file this plugin manages is defined here and validated during pyrig sync.

icon

Config that scaffolds the executable's icon as rig/resources/icon.png.

IconConfigFile

Bases: DictConfigFile

Config file that scaffolds the icon.png used as the executable's icon.

The release workflow bundles this file into the built executable as its icon. The scaffolded file is a default -- replace it with your own; it is created only when missing, so a project's own icon is preserved.

Note

If the file exists but is not a valid PNG, validation raises RuntimeError rather than automatically restoring the default icon.

extension
extension() -> str

Return "png" as the icon's file extension.

Source code in src/pyrig_executables/rig/configs/icon.py
def extension(self) -> str:
    """Return `"png"` as the icon's file extension."""
    return "png"
is_correct
is_correct() -> bool

Return whether the icon file starts with the PNG signature.

Only the 8-byte PNG magic number is checked; the rest of the file's bytes are not otherwise validated.

Returns:

Type Description
bool

True if the icon file starts with the PNG signature; False

bool

otherwise.

Source code in src/pyrig_executables/rig/configs/icon.py
def is_correct(self) -> bool:
    """Return whether the icon file starts with the PNG signature.

    Only the 8-byte PNG magic number is checked; the rest of the file's
    bytes are not otherwise validated.

    Returns:
        `True` if the icon file starts with the PNG signature; `False`
        otherwise.
    """
    with self.path().open("rb") as f:
        return f.read(8) == b"\x89PNG\r\n\x1a\n"
parent_path
parent_path() -> Path

Return the directory the icon lives in.

Returns:

Type Description
Path

The project's rig/resources package directory, shared with the

Path

config file that scaffolds that package's __init__.py.

Source code in src/pyrig_executables/rig/configs/icon.py
def parent_path(self) -> Path:
    """Return the directory the icon lives in.

    Returns:
        The project's `rig/resources` package directory, shared with the
        config file that scaffolds that package's `__init__.py`.
    """
    return ResourcesInitConfigFile.I.parent_path()
stem
stem() -> str

Return "icon" as the icon's filename stem.

Source code in src/pyrig_executables/rig/configs/icon.py
def stem(self) -> str:
    """Return `"icon"` as the icon's filename stem."""
    return "icon"

main

Configuration for the project's main entry-point module.

Scaffolds a main.py containing a callable main function in every project that installs this plugin. The module provides the entry point that the executable builder bundles into a standalone binary, so this config guarantees that a suitable build target always exists.

MainConfigFile

Bases: CopyModuleConfigFile

Scaffolding for the project's main.py entry-point module.

Copies this plugin's own entry-point module into the target project as main.py. Once the file exists, a project's own implementation stands rather than being overwritten, as long as it still satisfies the entry-point contract that is_correct checks for.

copy_module
copy_module() -> ModuleType

Return the pyrig_executables.main module used as main.py scaffolding.

Source code in src/pyrig_executables/rig/configs/main.py
def copy_module(self) -> ModuleType:
    """Return the `pyrig_executables.main` module used as `main.py` scaffolding."""
    return main_module
has_callable_main
has_callable_main() -> bool

Return whether the target module exposes a callable main attribute.

Source code in src/pyrig_executables/rig/configs/main.py
def has_callable_main(self) -> bool:
    """Return whether the target module exposes a callable `main` attribute."""
    return callable(getattr(self.module(), main_func.__name__, None))
has_main_guard
has_main_guard() -> bool

Return whether the target module's file contains the __main__ guard.

Matched via plain substring search, so the guard text must appear exactly as returned by main_guard.

Returns:

Type Description
bool

True if the guard snippet is present in the file.

Source code in src/pyrig_executables/rig/configs/main.py
def has_main_guard(self) -> bool:
    """Return whether the target module's file contains the `__main__` guard.

    Matched via plain substring search, so the guard text must appear
    exactly as returned by `main_guard`.

    Returns:
        `True` if the guard snippet is present in the file.
    """
    return self.main_guard() in self.read_content()
is_correct
is_correct() -> bool

Return whether the project's main.py is valid.

Overrides the inherited content check: main.py is correct once the target module exposes a callable main and contains a __main__ execution guard, regardless of what the function body does. This lets a project's own entry-point implementation stand unmodified.

Returns:

Type Description
bool

True if the target module defines a callable main and the

bool

__main__ guard is present.

Source code in src/pyrig_executables/rig/configs/main.py
def is_correct(self) -> bool:
    """Return whether the project's `main.py` is valid.

    Overrides the inherited content check: `main.py` is correct once the
    target module exposes a callable `main` and contains a `__main__`
    execution guard, regardless of what the function body does. This lets
    a project's own entry-point implementation stand unmodified.

    Returns:
        `True` if the target module defines a callable `main` and the
        `__main__` guard is present.
    """
    return self.has_callable_main() and self.has_main_guard()
main_guard
main_guard() -> str

Return the canonical __main__ execution guard snippet.

Returns:

Type Description
str

The if __name__ == "__main__" block that calls main.

Source code in src/pyrig_executables/rig/configs/main.py
def main_guard(self) -> str:
    """Return the canonical `__main__` execution guard snippet.

    Returns:
        The `if __name__ == "__main__"` block that calls `main`.
    """
    return f"""if __name__ == "__main__":
{main_func.__name__}()"""

version_control

Version control configuration adjusted for standalone executable distribution.

Extends the base version control setup, local or remote, to account for building and publishing standalone executables alongside a release.

remote

Overrides for the project's GitHub-hosted remote repository configuration.

workflows

Overrides for the project's GitHub Actions workflow configuration.

release

Extension of the release workflow that builds and attaches executables.

ReleaseWorkflowConfigFile

Bases: ReleaseWorkflowConfigFile

Release workflow that builds and attaches standalone executables.

Extends the base release workflow with a matrix job that builds a single-file executable for every supported operating system and attaches each one to the GitHub release as a release asset, alongside the generated changelog.

artifact_name
artifact_name(os: str) -> str

Build the workflow-artifact name for the given runner OS.

Single source of the executable-<os> artifact label. Kept deliberately generic and distinct from executable_name, so it does not collide with artifacts that other actions may name after the project.

Parameters:

Name Type Description Default
os str

The runner OS suffix, or "*" to build a name matching every OS.

required

Returns:

Type Description
str

The executable-<os> artifact name.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def artifact_name(self, os: str) -> str:
    """Build the workflow-artifact name for the given runner OS.

    Single source of the `executable-<os>` artifact label. Kept
    deliberately generic and distinct from `executable_name`, so it does
    not collide with artifacts that other actions may name after the
    project.

    Args:
        os: The runner OS suffix, or `"*"` to build a name matching
            every OS.

    Returns:
        The `executable-<os>` artifact name.
    """
    return f"executable-{os}"
collect_all_modules
collect_all_modules() -> Iterable[ModuleType]

Return the modules to bundle in full (data, submodules, binaries).

Empty by default, since the project's own resources package is pure data and is covered by collect_data_modules instead. Override to bundle additional modules that ship submodules or binaries alongside their data.

Returns:

Type Description
Iterable[ModuleType]

No modules, by default.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def collect_all_modules(self) -> Iterable[ModuleType]:
    """Return the modules to bundle in full (data, submodules, binaries).

    Empty by default, since the project's own resources package is pure
    data and is covered by `collect_data_modules` instead. Override to
    bundle additional modules that ship submodules or binaries alongside
    their data.

    Returns:
        No modules, by default.
    """
    return ()
collect_data_modules
collect_data_modules() -> Iterable[ModuleType]

Return the resource modules whose data files to bundle into the executable.

Resolves the project's rig/resources package, the location the pyrig-resources plugin scaffolds and validates. Locating the project's resources is a config concern, so it lives here rather than in the project-agnostic executable builder tool. Override to bundle additional pure-data resource packages.

Returns:

Type Description
Iterable[ModuleType]

The project's resource modules (the rig/resources package).

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def collect_data_modules(self) -> Iterable[ModuleType]:
    """Return the resource modules whose data files to bundle into the executable.

    Resolves the project's `rig/resources` package, the location the
    `pyrig-resources` plugin scaffolds and validates. Locating the
    project's resources is a config concern, so it lives here rather than
    in the project-agnostic executable builder tool. Override to bundle
    additional pure-data resource packages.

    Returns:
        The project's resource modules (the `rig/resources` package).
    """
    return (ResourcesInitConfigFile.I.module(),)
dependencies
dependencies() -> Iterable[type[ConfigFile[Any]]]

Return config files required before building the workflow.

The ResourcesInitConfigFile is required because it is needed as a loaded module in collect_data_modules.

Returns:

Type Description
Iterable[type[ConfigFile[Any]]]

Direct config file dependencies for this workflow.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def dependencies(self) -> Iterable[type[ConfigFile[Any]]]:
    """Return config files required before building the workflow.

    The `ResourcesInitConfigFile` is required because it is needed as a
    loaded module in `collect_data_modules`.

    Returns:
        Direct config file dependencies for this workflow.
    """
    return (*super().dependencies(), ResourcesInitConfigFile)
download_artifact_action
download_artifact_action() -> tuple[str, str, str]

Return action metadata for actions/download-artifact.

Returns:

Type Description
tuple[str, str, str]

Tuple of action name, pinned commit SHA, and release tag.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def download_artifact_action(self) -> tuple[str, str, str]:
    """Return action metadata for `actions/download-artifact`.

    Returns:
        Tuple of action name, pinned commit SHA, and release tag.
    """
    return self.action_from_resource(self.download_artifact_action, resources)
insert_os
insert_os() -> str

Return the expression that resolves to the current runner's OS.

Returns:

Type Description
str

GitHub Actions expression for runner.os (e.g. Linux,

str

Windows, macOS).

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def insert_os(self) -> str:
    """Return the expression that resolves to the current runner's OS.

    Returns:
        GitHub Actions expression for `runner.os` (e.g. `Linux`,
        `Windows`, `macOS`).
    """
    return self.insert_expression("runner.os")
job_executable
job_executable() -> dict[str, Any]

Build the matrix job that compiles the executable on every OS.

Runs across the default OS matrix (Linux, Windows, macOS), since pyinstaller cannot cross-compile and each binary must be built on its target platform.

Returns:

Type Description
dict[str, Any]

Job configuration with an OS matrix strategy, a dynamic runs-on

dict[str, Any]

value, and the build and upload steps.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def job_executable(self) -> dict[str, Any]:
    """Build the matrix job that compiles the executable on every OS.

    Runs across the default OS matrix (Linux, Windows, macOS), since
    `pyinstaller` cannot cross-compile and each binary must be built on
    its target platform.

    Returns:
        Job configuration with an OS matrix strategy, a dynamic `runs-on`
        value, and the build and upload steps.
    """
    return self.job(
        self.job_executable,
        strategy=self.strategy_matrix_os(),
        permissions=self.permission_contents(),
        runs_on=self.insert_matrix_os(),
        steps=self.steps_executable(),
    )
job_publish_needs
job_publish_needs() -> tuple[MethodType, ...]

Return the jobs required before publishing a release.

Returns:

Type Description
tuple[MethodType, ...]

The base class's dependencies plus the executable build job.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def job_publish_needs(self) -> tuple[MethodType, ...]:
    """Return the jobs required before publishing a release.

    Returns:
        The base class's dependencies plus the executable build job.
    """
    return (*super().job_publish_needs(), self.job_executable)
jobs
jobs() -> dict[str, Any]

Build the complete set of workflow jobs.

Adds the executable build job to the base release jobs.

Returns:

Type Description
dict[str, Any]

Dict containing the executable build job together with the base

dict[str, Any]

release jobs.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def jobs(self) -> dict[str, Any]:
    """Build the complete set of workflow jobs.

    Adds the executable build job to the base release jobs.

    Returns:
        Dict containing the executable build job together with the base
        release jobs.
    """
    return {
        **self.job_executable(),
        **super().jobs(),
    }
step_build_executable
step_build_executable() -> dict[str, Any]

Build a step that compiles the project into a single-file executable.

Runs pyinstaller --onefile against the project's entry-point module, naming the output binary via executable_name.

Returns:

Type Description
dict[str, Any]

Step that runs the executable builder via uv.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def step_build_executable(self) -> dict[str, Any]:
    """Build a step that compiles the project into a single-file executable.

    Runs `pyinstaller --onefile` against the project's entry-point
    module, naming the output binary via `executable_name`.

    Returns:
        Step that runs the executable builder via uv.
    """
    os_var = "OS"
    return self.step(
        self.step_build_executable,
        run=PackageManager.I.run_args(
            *ExecutableBuilder.I.build_args(
                name=f"{PackageManager.I.project_name()}-{self.insert_parameter_expansion(os_var)}",
                entry_point=MainConfigFile.I.path(),
                icon=IconConfigFile.I.path(),
                collect_all_modules=self.collect_all_modules(),
                collect_data_modules=self.collect_data_modules(),
            ),
        ).multiline(),
        env={
            os_var: self.insert_os(),
        },
    )
step_download_executables
step_download_executables() -> dict[str, Any]

Build a step that downloads every executable artifact into dist/.

Merges every per-OS executable artifact, matched by the artifact_name glob, into a single dist/ directory so they can be attached to the release with one glob.

Returns:

Type Description
dict[str, Any]

Step using actions/download-artifact@<ref>.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def step_download_executables(self) -> dict[str, Any]:
    """Build a step that downloads every executable artifact into `dist/`.

    Merges every per-OS executable artifact, matched by the
    `artifact_name` glob, into a single `dist/` directory so they can be
    attached to the release with one glob.

    Returns:
        Step using `actions/download-artifact@<ref>`.
    """
    return self.step(
        self.step_download_executables,
        uses=self.download_artifact_action(),
        with_={
            "pattern": self.artifact_name("*"),
            "path": PackageManager.I.dist_dir().as_posix(),
            "merge-multiple": "true",
        },
    )
step_upload_executable
step_upload_executable() -> dict[str, Any]

Build a step that uploads the built executable as a workflow artifact.

Uploads the contents of dist/ under the per-OS artifact_name so the publish job can later download every platform's binary.

Returns:

Type Description
dict[str, Any]

Step using actions/upload-artifact@<ref>.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def step_upload_executable(self) -> dict[str, Any]:
    """Build a step that uploads the built executable as a workflow artifact.

    Uploads the contents of `dist/` under the per-OS `artifact_name` so
    the `publish` job can later download every platform's binary.

    Returns:
        Step using `actions/upload-artifact@<ref>`.
    """
    return self.step(
        self.step_upload_executable,
        uses=self.upload_artifact_action(),
        with_={
            "name": self.artifact_name(self.insert_os()),
            "path": PackageManager.I.dist_dir().as_posix(),
        },
    )
steps_executable
steps_executable() -> list[dict[str, Any]]

Build the ordered steps for the executable build job.

Returns:

Type Description
list[dict[str, Any]]

Steps that set up the environment, build the single-file

list[dict[str, Any]]

executable, and upload it as a per-OS artifact.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def steps_executable(self) -> list[dict[str, Any]]:
    """Build the ordered steps for the executable build job.

    Returns:
        Steps that set up the environment, build the single-file
        executable, and upload it as a per-OS artifact.
    """
    return [
        *self.steps_core_installed_setup(),
        self.step_build_executable(),
        self.step_upload_executable(),
    ]
steps_publish
steps_publish() -> list[dict[str, Any]]

Build the ordered steps for the release job.

Inserts a step that downloads every platform's executable immediately before the create-release step, since the release must not be created before every binary is available to attach.

Returns:

Type Description
list[dict[str, Any]]

The base publish steps with the executable download step inserted

list[dict[str, Any]]

just before the create-release step.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def steps_publish(self) -> list[dict[str, Any]]:
    """Build the ordered steps for the release job.

    Inserts a step that downloads every platform's executable immediately
    before the create-release step, since the release must not be
    created before every binary is available to attach.

    Returns:
        The base publish steps with the executable download step inserted
        just before the create-release step.
    """
    steps = super().steps_publish()
    create_release_id = self.step_id_from_method(self.step_create_release)
    create_release_index = next(
        index for index, step in enumerate(steps) if step["id"] == create_release_id
    )
    steps.insert(create_release_index, self.step_download_executables())
    return steps
upload_artifact_action
upload_artifact_action() -> tuple[str, str, str]

Return action metadata for actions/upload-artifact.

Returns:

Type Description
tuple[str, str, str]

Tuple of action name, pinned commit SHA, and release tag.

Source code in src/pyrig_executables/rig/configs/version_control/remote/workflows/release.py
def upload_artifact_action(self) -> tuple[str, str, str]:
    """Return action metadata for `actions/upload-artifact`.

    Returns:
        Tuple of action name, pinned commit SHA, and release tag.
    """
    return self.action_from_resource(self.upload_artifact_action, resources)

resources

Bundled static resource files read when scaffolding executable projects.

Holds verbatim resource files that config file subclasses copy into a project that builds a standalone executable.

tools

Wrappers for the external CLI tools this plugin contributes to a project.

executables

Tool wrappers for building standalone executables.

builder

Tool wrapper for bundling the project into standalone release executables.

ExecutableBuilder

Bases: Tool

Wrapper for pyinstaller, the tool that builds standalone executables.

Exposes a project-info badge showing the cumulative download count across all GitHub release assets, linking to the releases page where the built executables are published.

build_args
build_args(
    *args: str,
    name: str,
    entry_point: Path,
    icon: Path,
    collect_all_modules: Iterable[ModuleType] = (),
    collect_data_modules: Iterable[ModuleType] = (),
) -> Args

Build the pyinstaller command that bundles a single-file executable.

Bundles each module with its own --collect-all or --collect-data flag rather than pointing --add-data at a path. This preserves the package layout so resources stay locatable at runtime through importlib.resources in both development and the frozen executable, and sidesteps the platform-specific separator --add-data requires. --collect-all also pulls in a module's submodules and any binaries it ships, so it suits modules that are not known to be pure data (e.g. an extension point where callers may pass anything); --collect-data is narrower and suits known pure-data packages, avoiding unrelated submodules/binaries. The build runs in console mode by default; pass --windowed through *args for a GUI application that should run without a console window (this instead produces a .app bundle directory on macOS).

Parameters:

Name Type Description Default
*args str

Additional arguments forwarded to pyinstaller, inserted after the resource flags and before entry_point.

()
name str

Output name for the executable (without an OS-specific extension; pyinstaller appends .exe on Windows).

required
entry_point Path

Path to the entry-point script to bundle.

required
icon Path

Path to the icon image. A non-native format (e.g. PNG) is converted to the per-OS format (.ico / .icns) at build time via Pillow; ignored on Linux.

required
collect_all_modules Iterable[ModuleType]

Modules to bundle in full (data, submodules, and binaries), one --collect-all flag per module.

()
collect_data_modules Iterable[ModuleType]

Modules whose data files only are bundled, one --collect-data flag per module.

()

Returns:

Type Description
Args

Args for the pyinstaller command.

Source code in src/pyrig_executables/rig/tools/executables/builder.py
def build_args(
    self,
    *args: str,
    name: str,
    entry_point: Path,
    icon: Path,
    collect_all_modules: Iterable[ModuleType] = (),
    collect_data_modules: Iterable[ModuleType] = (),
) -> Args:
    """Build the `pyinstaller` command that bundles a single-file executable.

    Bundles each module with its own `--collect-all` or `--collect-data`
    flag rather than pointing `--add-data` at a path. This preserves the
    package layout so resources stay locatable at runtime through
    `importlib.resources` in both development and the frozen
    executable, and sidesteps the platform-specific separator
    `--add-data` requires. `--collect-all` also pulls in a module's
    submodules and any binaries it ships, so it suits modules that are
    not known to be pure data (e.g. an extension point where callers may
    pass anything); `--collect-data` is narrower and suits known
    pure-data packages, avoiding unrelated submodules/binaries. The
    build runs in console mode by default; pass `--windowed` through
    `*args` for a GUI application that should run without a console
    window (this instead produces a `.app` bundle directory on macOS).

    Args:
        *args: Additional arguments forwarded to `pyinstaller`, inserted
            after the resource flags and before `entry_point`.
        name: Output name for the executable (without an OS-specific
            extension; `pyinstaller` appends `.exe` on Windows).
        entry_point: Path to the entry-point script to bundle.
        icon: Path to the icon image. A non-native format (e.g. PNG) is
            converted to the per-OS format (`.ico` / `.icns`) at build
            time via Pillow; ignored on Linux.
        collect_all_modules: Modules to bundle in full (data,
            submodules, and binaries), one `--collect-all` flag per
            module.
        collect_data_modules: Modules whose data files only are
            bundled, one `--collect-data` flag per module.

    Returns:
        Args for the `pyinstaller` command.
    """
    collect_all = (
        f"--collect-all={module.__name__}" for module in collect_all_modules
    )
    collect_data = (
        f"--collect-data={module.__name__}" for module in collect_data_modules
    )
    return self.args(
        "--onefile",
        f"--name={name}",
        f"--icon={icon.as_posix()}",
        *collect_all,
        *collect_data,
        *args,
        entry_point.as_posix(),
    )
dev_dependencies
dev_dependencies() -> tuple[str, ...]

Return the dev dependencies required to build executables.

Extends the default with pillow so pyinstaller can convert a non-native icon image (e.g. PNG) into the per-OS icon format (.ico / .icns) at build time.

Returns:

Type Description
tuple[str, ...]

pyinstaller and pillow.

Source code in src/pyrig_executables/rig/tools/executables/builder.py
def dev_dependencies(self) -> tuple[str, ...]:
    """Return the dev dependencies required to build executables.

    Extends the default with `pillow` so `pyinstaller` can convert a
    non-native icon image (e.g. PNG) into the per-OS icon format (`.ico`
    / `.icns`) at build time.

    Returns:
        `pyinstaller` and `pillow`.
    """
    return (*super().dev_dependencies(), "pillow")
group
group() -> str

Return Group.PROJECT_INFO.

Source code in src/pyrig_executables/rig/tools/executables/builder.py
def group(self) -> str:
    """Return `Group.PROJECT_INFO`."""
    return Group.PROJECT_INFO
image_url
image_url() -> str

Return the shields.io URL for the GitHub release downloads badge.

Source code in src/pyrig_executables/rig/tools/executables/builder.py
def image_url(self) -> str:
    """Return the shields.io URL for the GitHub release downloads badge."""
    owner, repo = (
        VersionController.I.repo_owner(),
        PackageManager.I.project_name(),
    )
    return f"https://img.shields.io/github/downloads/{owner}/{repo}/total?logo=github&label=downloads"
link_url
link_url() -> str

Return the GitHub releases page URL where the binaries are published.

Source code in src/pyrig_executables/rig/tools/executables/builder.py
def link_url(self) -> str:
    """Return the GitHub releases page URL where the binaries are published."""
    return RemoteVersionController.I.releases_url()
name
name() -> str

Return 'pyinstaller'.

Source code in src/pyrig_executables/rig/tools/executables/builder.py
def name(self) -> str:
    """Return `'pyinstaller'`."""
    return "pyinstaller"
version_control_ignore_patterns
version_control_ignore_patterns() -> tuple[str, ...]

Return the build artifact paths to exclude from version control.

Returns:

Type Description
str

The pyinstaller build artifacts: the dist/ output directory,

...

the generated *.spec files, and the build/ working directory.

Source code in src/pyrig_executables/rig/tools/executables/builder.py
def version_control_ignore_patterns(self) -> tuple[str, ...]:
    """Return the build artifact paths to exclude from version control.

    Returns:
        The `pyinstaller` build artifacts: the `dist/` output directory,
        the generated `*.spec` files, and the `build/` working directory.
    """
    return ("*.spec", "build/")

pyrigger

Customization of the pyrig CLI tool for projects that build executables.

Pyrigger

Bases: Pyrigger

Pyrig CLI tool wrapper that extends project initialization for this plugin.

setup_steps
setup_steps() -> tuple[tuple[Args, dict[str, Any]], ...]

Insert an extra pyrig sync step into the base initialization sequence.

A duplicate of the base pyrig sync step is inserted before the original one. We need them to run twice so that the test stubs for the generated main.py file.

Source code in src/pyrig_executables/rig/tools/pyrigger.py
def setup_steps(self) -> tuple[tuple[Args, dict[str, Any]], ...]:
    """Insert an extra `pyrig sync` step into the base initialization sequence.

    A duplicate of the base `pyrig sync` step is inserted before the original one.
    We need them to run twice so that the test stubs for the generated main.py file.
    """
    steps = list(super().setup_steps())
    sync_args = self.cmd_args(cmd=sync)
    index, sync_step = next(
        (i, (args, kwargs))
        for i, (args, kwargs) in enumerate(steps)
        if args == sync_args
    )
    steps.insert(index, sync_step)
    return tuple(steps)

version_control

Version control tool customizations for standalone executable distribution.

remote

Overrides for the project's remote version control tooling.

controller

Customization of the remote version controller.

RemoteVersionController

Bases: RemoteVersionController

Overrides the base class to include executable artifacts in releases.

create_release_args
create_release_args(
    *args: str, tag: str, files: Iterable[str] = ()
) -> Args

Build release arguments with the executable artifacts included.

Parameters:

Name Type Description Default
*args str

Additional arguments forwarded to gh release create.

()
tag str

The tag to release, also used as the release title.

required
files Iterable[str]

Release asset paths to upload alongside the executable artifacts.

()

Returns:

Type Description
Args

Args for gh release create with every file in dist/ attached.

Source code in src/pyrig_executables/rig/tools/version_control/remote/controller.py
def create_release_args(
    self,
    *args: str,
    tag: str,
    files: Iterable[str] = (),
) -> Args:
    """Build release arguments with the executable artifacts included.

    Args:
        *args: Additional arguments forwarded to `gh release create`.
        tag: The tag to release, also used as the release title.
        files: Release asset paths to upload alongside the executable
            artifacts.

    Returns:
        Args for `gh release create` with every file in `dist/` attached.
    """
    return super().create_release_args(
        *args,
        tag=tag,
        files=(
            f"{PackageManager.I.dist_dir().as_posix()}/*",
            *files,
        ),
    )