def st2_runner_python_distribution(**kwargs):
    """Create a python_distribution (wheel/sdist) for a StackStorm runner."""
    runner_name = kwargs.pop("runner_name")
    description = kwargs.pop("description")

    st2_license(dest=f"contrib/runners/{runner_name}_runner")

    kwargs["provides"] = python_artifact(  # noqa: F821
        name=f"stackstorm-runner-{runner_name.replace('_', '-')}",
        description=description,
        version_file=f"{runner_name}_runner/__init__.py",  # custom for our release plugin
        # test_suite="tests",
        zip_safe=kwargs.pop(
            "zip_safe", True
        ),  # most runners are safe to run from a zipapp
    )

    dependencies = kwargs.pop("dependencies", [])
    for dep in [f"./{runner_name}_runner", ":license"]:
        if dep not in dependencies:
            dependencies.append(dep)

    kwargs["dependencies"] = dependencies
    kwargs["repositories"] = st2_publish_repos()

    python_distribution(**kwargs)  # noqa: F821
Create a python_distribution (wheel/sdist) for a StackStorm runner.
pants-plugins/macros.py