Skip to main content

zuke-python

🥷 Zuke for Python: author your build as typed Python, run it on the Zuke engine.

Zuke is a code-first, strongly-typed build automation system: your build and your CI are one typed file, and your agent can run it. This package brings that authoring model to Python. A build is a class whose fields are targets, dependencies are references the type checker sees, and every tool call is a typed facade. The scheduling, the durable runs, the locks, the caching, the CI generation, the MCP server and every tool wrapper stay in the Zuke engine; this package is the thin SDK that describes your build to it and runs your target bodies when asked.

Status: in progress. The engine hosts a worker in any language since @zuke/engine 1.0.0, and this package is growing into the SDK slice by slice under #3. The worker loop, the authoring surface, the body context, the hooks, the gates and the services are in, the worker passes every conformance case of @zuke/engine 1.0.0, this repository's own gate runs as a Zuke build on that engine, and the tool facades are generated from the engine's spec. The sequencing is described in AGENTS.md.

Install

uv add zuke        # or: pip install zuke

The package has no runtime dependencies. It runs your build on @zuke/engine, which the ./zuke launcher bootstraps along with Deno; see Development for the launcher.

What it looks like

from zuke import Build, parameter, run, target
from zuke.tools.docker import DockerTasks


class CI(Build):
    tag = parameter("image tag").default("dev")

    lint = (
        target().description("ruff").executes(lambda ctx: ctx.sh("ruff", "check", "."))
    )
    test = target().depends_on(lint).executes(lambda ctx: ctx.sh("pytest", "-q"))
    image = (
        target()
        .depends_on(test)
        .executes(
            lambda ctx: DockerTasks.build(
                ctx, lambda s: s.tag(f"app:{tag.value}").file("Dockerfile")
            )
        )
    )


run(CI)

The class and its fields work today: target() carries every setting the engine schedules by (depends_on, retry, timeout, before, after, triggers, on_failure, …), parameter() has the string, number, boolean and list kinds with .value resolved by the engine, group() names a parallel batch, and run() makes the file a worker. A body gets a ctx: await ctx.sh(...) runs a command through the engine and raises CommandError on a non-zero code, ctx.state and ctx.state_of(...) read and write durable state, and ctx.outcome_of, ctx.outcomes, ctx.summary, ctx.secret, ctx.log, ctx.plan and ctx.signals are the rest of what the engine serves a body. A target may declare a .condition(...), a .cache_key(...), a .lock(...), a .waits_for(...) gate and .validate_during(...) checks; service() declares a service with start, ready and stop phases; a Build overrides on_start, on_target_start, on_target_end and on_finish for hooks; and ci() fields declare the CI files zuke generate-ci renders. zuke.tools holds a facade per engine wrapper, zuke.tools.docker, zuke.tools.deno and the rest, generated from the engine's tool spec: DockerTasks.build(ctx, lambda s: ...) sends the engine a tool.call naming the wrapper's release, the task and the setters the lambda called, and the engine runs the real wrapper with the worker's environment and directory.

./zuke test then runs the Zuke engine, which starts this file as a worker, asks it for the graph, and runs lint and test with every subprocess spawned by the engine: argv only, output captured and redacted, dry-run, cancellation and timeouts all handled once, in one place.

Development

uv is the only tool you need.

uv sync          # the locked environment
./zuke ci        # the gate: format check, lint, pyright strict, tests at 95%+
./zuke --list    # every target of build.py, this repository's own Zuke build

The gate is itself a Zuke build, build.py, run by @zuke/engine at the version zuke.json pins: the launcher bootstraps Deno, the engine starts build.py as its worker, and every command a target runs goes through the engine. ./zuke.ps1 is the launcher on Windows. The engine, every tool wrapper it imports, and their @zuke/core run frozen against deno.lock; ./zuke lock rewrites it, and ./zuke vendor_spec relocks on its own.

The same AI reviewers the engine repository runs review this repository's pull requests, from build.py's review target through zuke.tools.ai: the build the SDK ships is reviewed by the SDK.

See CONTRIBUTING.md for the workflow and AGENTS.md for the rules this repository is built by.

License

MIT

Metadata

Release files for zuke 1.0.1

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

Source distribution (sdist)

Source distribution for zuke 1.0.1
File Size Uploaded Provenance Actions
zuke-1.0.1.tar.gz 499.4 kB With provenance Details for zuke-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zuke 1.0.1
File Interpreter ABI Platform Actions
zuke-1.0.1-py3-none-any.whl Python 3 none any Details for zuke-1.0.1-py3-none-any.whl

Total release size: 779.5 kB

Release files / zuke-1.0.1.tar.gz

Download URL zuke-1.0.1.tar.gz
Size 499.4 kB
Tags Source
SHA-256 checksum
How to use checksums
edcfe81d59d1191cacb730939448828f42478c81a79d7497ac580349759a05d8
BLAKE2b-256 checksum
How to use checksums
5df0cf26731e9daf33e93e535bc8b39fe2a445f179df8bbdde296b086e7212cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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}

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / zuke-1.0.1-py3-none-any.whl

Download URL zuke-1.0.1-py3-none-any.whl
Size 280.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c52423e8fba0a1cc431fe8f645b491f47257264f1e1c85e489de78db264597a9
BLAKE2b-256 checksum
How to use checksums
25047c4baeac32dc3184b39ae9aff20e7cdf18a25aeef74a392e97d1279ec927
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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}

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for zuke 1.0.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for zuke-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

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.

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