@zuke-build/cli 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/uv_path.js ADDED
@@ -0,0 +1,83 @@
1
+ // Copyright (c) 2026 the Zuke contributors
2
+ // SPDX-License-Identifier: MIT
3
+ /**
4
+ * Finding the uv a Python build's worker runs with.
5
+ *
6
+ * `zuke setup --sdk python` writes `"sdk": { "command": ["uv", "run",
7
+ * "build.py"] }`, and uv then provides the Python interpreter and the `zuke`
8
+ * SDK itself. So uv is the one tool such a build needs on the machine. The
9
+ * engine asks {@link WorkerTasks.resolveProgram} for the program before it starts the
10
+ * worker: `uv` is the one on `PATH`, else the pinned uv `zuke` installs into
11
+ * `ZUKE_UV_HOME` (`~/.zuke/uv`), else that uv installed on the spot
12
+ * (`runtime_install.ts`). Any other program is left as `zuke.json` names it.
13
+ *
14
+ * @module
15
+ */
16
+ import { FileTasks, ProcessTasks } from "@zuke/core";
17
+ import { defaultDenoHost } from "./deno_path.js";
18
+ import { defaultRuntimeSetup, provisionUv, uvBinary, uvHome, } from "./runtime_install.js";
19
+ import { UV_PIN } from "./uv_pin.js";
20
+ /** Where to read about installing uv, named when none is found. */
21
+ export const UV_INSTALL_DOCS = "https://docs.astral.sh/uv/getting-started/installation/";
22
+ /** The program name a worker command starts with when uv runs it. */
23
+ const UV = "uv";
24
+ /** Thrown when a build's worker runs uv and none was found or installed. */
25
+ export class UvNotFoundError extends Error {
26
+ /** The error's name, as reported by `String(error)` and stack traces. */
27
+ name = "UvNotFoundError";
28
+ /** The executables that were looked for and not found, in the order tried. */
29
+ tried;
30
+ /**
31
+ * Build the failure from the candidates that were tried, in order.
32
+ *
33
+ * @param tried The executables that were looked for and not found.
34
+ */
35
+ constructor(tried) {
36
+ super(`zuke: this build's sdk.command runs uv, and none was found — tried ` +
37
+ `${tried.join(", ")}. Install uv (${UV_INSTALL_DOCS}), or run zuke ` +
38
+ `again and let it install uv ${UV_PIN.version}.`);
39
+ this.tried = tried;
40
+ }
41
+ }
42
+ /**
43
+ * Whether `program` runs from `PATH`: it is spawned with `--version`, which
44
+ * leaves `PATHEXT` and the search itself to the OS, as the Node and Deno
45
+ * lookups do. A program that cannot start (missing, not executable) or fails
46
+ * `--version` cannot run the worker either, so it does not count.
47
+ */
48
+ async function startsFromPath(program) {
49
+ try {
50
+ const child = ProcessTasks.spawn(program, (s) => s.args("--version").stdin("null").stdout("null").stderr("null"));
51
+ return (await child.status).code === 0;
52
+ }
53
+ catch {
54
+ return false;
55
+ }
56
+ }
57
+ /** The real {@link WorkerProgramHost}. */
58
+ export const defaultWorkerProgramHost = {
59
+ host: defaultDenoHost,
60
+ onPath: startsFromPath,
61
+ exists: (path) => FileTasks.exists(path),
62
+ setup: defaultRuntimeSetup,
63
+ };
64
+ /** What starts a hosted build's worker: finding (or installing) its program. */
65
+ export const WorkerTasks = {
66
+ resolveProgram: (program) => resolveWorkerProgram(program, defaultWorkerProgramHost),
67
+ };
68
+ /** {@link WorkerTasks.resolveProgram} against `machine`, the seam tests drive. */
69
+ export async function resolveWorkerProgram(program, machine) {
70
+ if (program !== UV)
71
+ return program;
72
+ if (await machine.onPath(UV))
73
+ return UV;
74
+ const home = uvHome(machine.host);
75
+ const tried = [UV];
76
+ if (home !== undefined) {
77
+ const pinned = uvBinary(home, machine.host);
78
+ if (await machine.exists(pinned))
79
+ return pinned;
80
+ tried.push(pinned);
81
+ }
82
+ return await provisionUv(machine.setup, machine.host)(new UvNotFoundError(tried));
83
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The uv release `zuke` installs for a Python build whose `sdk.command` runs
3
+ * `uv`, and where each platform's copy comes from. The one place the pin
4
+ * lives, as `node_pin.ts` and `deno_pin.ts` are for Node and Deno.
5
+ *
6
+ * Astral publishes the uv binary to PyPI as one wheel per platform, so the
7
+ * pin is each wheel's exact URL on PyPI's file host and its SHA-256,
8
+ * both from `https://pypi.org/pypi/uv/<version>/json`. Bump the version, the
9
+ * URLs and the checksums together.
10
+ *
11
+ * @module
12
+ */
13
+ /** A platform uv publishes a wheel for, as `zuke` names hosts: `os-arch`. */
14
+ export type UvPlatform = "linux-x86_64" | "linux-aarch64" | "macos-x86_64" | "macos-aarch64" | "windows-x86_64" | "windows-aarch64";
15
+ /** One platform's wheel: where it is, and what it must hash to. */
16
+ export interface UvWheel {
17
+ /** The wheel's download URL on PyPI's file host. */
18
+ readonly url: string;
19
+ /** Lowercase hex SHA-256 of the wheel. */
20
+ readonly sha256: string;
21
+ }
22
+ /** The pinned uv release and each platform's wheel. */
23
+ export interface UvPin {
24
+ /** The release version, e.g. `"0.13.10"`. */
25
+ readonly version: string;
26
+ /** The wheel for each supported platform. */
27
+ readonly wheels: Readonly<Record<UvPlatform, UvWheel>>;
28
+ }
29
+ /** The uv release `zuke` installs (published 2026-11-24), with its verified wheels. */
30
+ export declare const UV_PIN: UvPin;
package/src/uv_pin.js ADDED
@@ -0,0 +1,36 @@
1
+ // Copyright (c) 2026 the Zuke contributors
2
+ // SPDX-License-Identifier: MIT
3
+ /** Where a wheel's files start: the PyPI file host. */
4
+ const FILES = "https://files.pythonhosted.org/packages";
5
+ /* cspell:disable */
6
+ /** The uv release `zuke` installs (published 2026-11-24), with its verified wheels. */
7
+ export const UV_PIN = {
8
+ version: "0.13.10",
9
+ wheels: {
10
+ "linux-x86_64": {
11
+ url: `${FILES}/8b/99/fad906311e48fce22e4db71ee4c3df29bdb17b29eb36878f52b8dcd79237/uv-0.13.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl`,
12
+ sha256: "7cc9c41b43d583e34c781fd3446405b06e9c5fa2db468ce2a534d353db6429e5",
13
+ },
14
+ "linux-aarch64": {
15
+ url: `${FILES}/97/4b/12a9e73be39829da3ece358385c3c019ecdea91a5fc704381d584ad9a387/uv-0.13.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl`,
16
+ sha256: "e89dd26ea831dde70639ba0a798fa04a4c7c0226fd2b241da86218bfa370e495",
17
+ },
18
+ "macos-x86_64": {
19
+ url: `${FILES}/77/0d/178749e47a7ea76ad7c4a0c736b11615f2b4a1af94a9983c987b724e20c1/uv-0.13.10-py3-none-macosx_10_12_x86_64.whl`,
20
+ sha256: "19a76fd50a6a2bba38ee088d8336566856569be08196865f98132a08806581fc",
21
+ },
22
+ "macos-aarch64": {
23
+ url: `${FILES}/5b/d6/78204b698ed27b425b9660105af4b388a379b0435ea2e77e783feca3f180/uv-0.13.10-py3-none-macosx_11_0_arm64.whl`,
24
+ sha256: "2a9ff188b442419c7aadebc445fcc1f287b25f99af50fa6d563b90cc0047b7cf",
25
+ },
26
+ "windows-x86_64": {
27
+ url: `${FILES}/cf/e4/d0704c116ada58e8450890e2defaaf2f07e8d264cf94669210e0823fbcb2/uv-0.13.10-py3-none-win_amd64.whl`,
28
+ sha256: "d87b9cf8165f2b3cc596e856b5bf794da9cfad6d1b110ca9d87eed42a15b3684",
29
+ },
30
+ "windows-aarch64": {
31
+ url: `${FILES}/8c/d7/59a108985cfc5f1cb0afea1108ff5a0bc4994b405af0825fb3085f068de8/uv-0.13.10-py3-none-win_arm64.whl`,
32
+ sha256: "8b0a15613aae9a3e1c134bb5ee706583af0addced7eb1add992f8b1b3e3a92a0",
33
+ },
34
+ },
35
+ };
36
+ /* cspell:enable */
package/src/version.js CHANGED
@@ -10,4 +10,4 @@
10
10
  * reads it — the annotation is what keeps that from mattering if it is ever
11
11
  * exported.
12
12
  */
13
- export const VERSION = "2.10.0"; // x-release-please-version
13
+ export const VERSION = "2.11.0"; // x-release-please-version