Generated reference for the harmont Zig API.
zig
Callable singleton for the Zig toolchain — access as hm.zig.
Supports three usage forms:
- Toolchain form:
hm.zig(version="0.13.0")returns aZigToolchainshared across multiple projects. - Project form:
hm.zig(path=".")returns aZigProjectdirectly. - Bare form:
hm.zig.build(),hm.zig.test(), etc. for one-shot leaves.
zig(*, path=None, version='0.13.0', image=None, base=None) -> ZigToolchain | ZigProject| Parameter | Type | Default | Description |
|---|---|---|---|
path | str | None | None | Zig project root. Omit to get a reusable ZigToolchain |
| from which multiple projects can be spawned. | |||
version | str | '0.13.0' | Zig release version (e.g. "0.13.0"). Must be a |
full MAJOR.MINOR.PATCH string. | |||
image | str | None | None | Local-mode Docker base image override. |
base | Step | None | None | Existing Step to attach to instead of emitting a fresh |
| apt-base step. |
Returns ZigToolchain | ZigProject — A ZigToolchain when path is omitted, or a ZigProject
zig.build()
build(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
zig.fmt()
fmt(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
zig.test()
test(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
ZigEntry
Callable singleton for the Zig toolchain — access as hm.zig.
Supports three usage forms:
- Toolchain form:
hm.zig(version="0.13.0")returns aZigToolchainshared across multiple projects. - Project form:
hm.zig(path=".")returns aZigProjectdirectly. - Bare form:
hm.zig.build(),hm.zig.test(), etc. for one-shot leaves.
ZigEntry.build()
build(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
ZigEntry.fmt()
fmt(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
ZigEntry.test()
test(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
ZigProject
Zig project rooted on a specific path — constructed via hm.zig(path=...).
installed is the zig-install step. Action methods (build,
test, fmt) attach leaves to installed.
Fields
| Field | Type | Default |
|---|---|---|
path | str | required |
installed | Step | required |
ZigProject.build()
build(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
ZigProject.fmt()
fmt(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
ZigProject.test()
test(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
ZigToolchain
Zig toolchain install chain — constructed via hm.zig() with no path.
Holds the shared zig-install step. Spawn one ZigProject per
subdirectory via .project(path); all projects from one toolchain
share the same install step, so the emitted IR contains a single
:zig: install node fanned out to N project chains.
Fields
| Field | Type | Default |
|---|---|---|
version | str | required |
installed | Step | required |
ZigToolchain.project()
project(path='.') -> ZigProjectCreate a ZigProject rooted at path from this toolchain.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | str | '.' | Path to the Zig project root relative to the workspace. |
Returns ZigProject — A ZigProject whose installed step is shared with this
Examples
>>> import harmont as hm
>>> tc = hm.zig(version="0.13.0")
>>> lib = tc.project("lib-a")
>>> app = tc.project("app")
>>> hm.pipeline(lib.test(), app.test())