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 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.0

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.0
File Size Uploaded Provenance Actions
zuke-1.0.0.tar.gz 492.6 kB Without provenance Details for zuke-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 772.7 kB

Release files / zuke-1.0.0.tar.gz

Download URL zuke-1.0.0.tar.gz
Size 492.6 kB
Tags Source
SHA-256 checksum
How to use checksums
54a964eea75d13b1c827a553b87b9812f66647360bb6ecd9eb5432220d7b8b3f
BLAKE2b-256 checksum
How to use checksums
4a8e19b1a48e4eace5752ab89c01fd68fed1a56100e0527c4e0bb618f7b63327
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}

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

Download URL zuke-1.0.0-py3-none-any.whl
Size 280.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd243dda0077e523fa43fad31ea58b79cfcb22f03e7859f18e21c3b5a4f25e85
BLAKE2b-256 checksum
How to use checksums
f8ed88baf1c6f461d8f97891f8e3160beacb75a402915b6aa0091213e0e23426
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}

Security for zuke 1.0.0

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.

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