Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

bazaar-contrib-invoke

Accept COMMANDS to register Click commands in your contrib's lifespan:

from contextlib import asynccontextmanager

import click
from bazaar_contrib_invoke import COMMANDS, CommandEntry
from bazaar_core import Context, Contrib


@click.command("hello", help="Say hello.")
@click.argument("name")
def hello(name: str) -> None:
    click.echo(f"Hello, {name}!")


@asynccontextmanager
async def lifespan(ctx: Context):
    with ctx.accept(COMMANDS).register(hello):
        yield


example = Contrib(accepts=[COMMANDS], lifespan=lifespan)
hello_entry = CommandEntry(contrib="example", help="Say hello.")

Declare both entry points in your package's pyproject.toml:

[project.entry-points."bazaar_compute_node.contribs"]
example = "example_package:example"

[project.entry-points."bazaar_compute_node.commands"]
hello = "example_package:hello_entry"

Install and enable the package:

bcn contrib add invoke --enable
bcn contrib add example-package --enable example

The corresponding entries in config.toml:

version = "5"

[[contribs]]
package = "bazaar-contrib-invoke~=0.3.0rc1"
[[contribs.enabled]]
entry = "commands"

[[contribs]]
package = "example-package>=0.1.0"
[[contribs.enabled]]
entry = "example"

Then run bcn hello Alice.

Async command callbacks call shared services directly to reuse business logic. Calling Click Context.invoke() or Context.forward() from an async callback raises RuntimeError before invoking the target callback.

A command entry that fails to load is reported independently. Other commands remain available; selecting the failed command reports its loading error.

Metadata

Release files for bazaar-contrib-invoke 0.3.0rc4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bazaar-contrib-invoke 0.3.0rc4
File Size Uploaded Provenance Actions
bazaar_contrib_invoke-0.3.0rc4.tar.gz 8.9 kB Without provenance Details for bazaar_contrib_invoke-0.3.0rc4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bazaar-contrib-invoke 0.3.0rc4
File Interpreter ABI Platform Actions
bazaar_contrib_invoke-0.3.0rc4-py3-none-any.whl Python 3 none any Details for bazaar_contrib_invoke-0.3.0rc4-py3-none-any.whl

Total release size: 19.2 kB

Release files / bazaar_contrib_invoke-0.3.0rc4.tar.gz

Download URL bazaar_contrib_invoke-0.3.0rc4.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8016f73c9f4f3d7dd5b838458e28e0f9451c7248993bcb67b9e289d9c0aa1327
BLAKE2b-256 checksum
How to use checksums
6b11e10b8ce76c8dbae66c00b284c59763848a44ebb4c54fee0fd20fc475dcda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bazaar_contrib_invoke-0.3.0rc4-py3-none-any.whl

Download URL bazaar_contrib_invoke-0.3.0rc4-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef4de3e63846dc7fe1c0f8e24dc15c49d53d9a5867ec948379c8322103828ae5
BLAKE2b-256 checksum
How to use checksums
cb8dd64c183e5d96a6f049cca0c3de33f3b87478e9086b25a99291a1f77f773f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for bazaar-contrib-invoke 0.3.0rc4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page