@styx-api/core 0.5.1 → 0.5.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@styx-api/core",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Styx compiler core: parses CLI tool descriptors (e.g. Boutiques), optimizes an IR, solves typed parameter bindings, and generates type-safe wrappers (TypeScript, Python, JSON Schema). Part of the Styx/NiWrap ecosystem.",
5
5
  "keywords": [
6
6
  "styx",
@@ -50,8 +50,14 @@ export function emitMetadata(ctx: CodegenContext, metaConst: string, cb: CodeBui
50
50
  if (ctx.app?.doc?.literature?.length) {
51
51
  cb.line(`citations=[${ctx.app.doc.literature.map(pyStr).join(", ")}],`);
52
52
  }
53
- if (ctx.app?.container?.image) {
54
- cb.line(`container_image_tag=${pyStr(ctx.app.container.image)},`);
53
+ // The package/version-level container is authoritative: niwrap curates one
54
+ // container per tool version (version.json) and applies it to every app, so
55
+ // it overrides a descriptor's incidental inline container-image. The inline
56
+ // image is only a fallback for a standalone single-descriptor build that has
57
+ // no package context.
58
+ const containerImage = ctx.package?.docker ?? ctx.app?.container?.image;
59
+ if (containerImage) {
60
+ cb.line(`container_image_tag=${pyStr(containerImage)},`);
55
61
  }
56
62
  });
57
63
  cb.line(")");
@@ -139,14 +139,22 @@ export function generateRootInitPy(): string {
139
139
 
140
140
  /**
141
141
  * Root `pyproject.toml`: a metapackage depending on `styxkit[all]` (the runner
142
- * stack it re-exports) plus each per-suite distribution. `packages` lists only
143
- * the metapackage's own module so setuptools ships the styxkit re-export without
144
- * sweeping the sibling suite directories into this distribution. The module is
145
- * the `<project>/` namespace package the suites nest into, so installing the
146
- * metapackage makes `<project>.use_docker()` reachable alongside the suites'
147
- * `from <project> import <pkg>`. `moduleDir` is the on-disk source directory; it
148
- * differs from the import `moduleName` only when a suite is named after the
149
- * project, in which case a `package-dir` remap keeps the import name intact.
142
+ * stack it re-exports) plus each per-suite distribution, pinned to this exact
143
+ * project version (`niwrap_fsl==1.2.3`). The suites all ride the project version
144
+ * and ship in lockstep, so an exact pin keeps `pip install niwrap==X` consistent:
145
+ * during the post-release index-propagation window (or any momentary registry
146
+ * inconsistency) pip errors cleanly instead of silently grafting an older suite
147
+ * whose layout no longer matches the metapackage. Mirrors the way the CLI pins
148
+ * `@styx-api/core` exactly.
149
+ *
150
+ * `packages` lists only the metapackage's own module so setuptools ships the
151
+ * styxkit re-export without sweeping the sibling suite directories into this
152
+ * distribution. The module is the `<project>/` namespace package the suites nest
153
+ * into, so installing the metapackage makes `<project>.use_docker()` reachable
154
+ * alongside the suites' `from <project> import <pkg>`. `moduleDir` is the on-disk
155
+ * source directory; it differs from the import `moduleName` only when a suite is
156
+ * named after the project, in which case a `package-dir` remap keeps the import
157
+ * name intact.
150
158
  */
151
159
  export function generateRootPyproject(
152
160
  proj: ProjectMeta,
@@ -165,7 +173,10 @@ export function generateRootPyproject(
165
173
  cb.line(`requires-python = "${REQUIRES_PYTHON}"`);
166
174
  cb.line("dependencies = [");
167
175
  for (const dep of PYTHON_RUNNER_DEPS) cb.line(` "${dep}",`);
168
- for (const dist of distNames) cb.line(` "${tomlStr(dist)}",`);
176
+ // Pin each suite to the exact project version (they ship in lockstep) so a
177
+ // mid-propagation install can't mix a new metapackage with an old suite.
178
+ const suitePin = tomlStr(proj.version ?? "0.0.0");
179
+ for (const dist of distNames) cb.line(` "${tomlStr(dist)}==${suitePin}",`);
169
180
  cb.line("]");
170
181
  cb.blank();
171
182
  cb.line("[tool.setuptools]");
@@ -42,8 +42,14 @@ export function emitMetadata(ctx: CodegenContext, metaConst: string, cb: CodeBui
42
42
  if (ctx.app?.doc?.literature?.length) {
43
43
  cb.line(`citations: ${JSON.stringify(ctx.app.doc.literature)},`);
44
44
  }
45
- if (ctx.app?.container?.image) {
46
- cb.line(`container_image_tag: ${JSON.stringify(ctx.app.container.image)},`);
45
+ // The package/version-level container is authoritative: niwrap curates one
46
+ // container per tool version (version.json) and applies it to every app, so
47
+ // it overrides a descriptor's incidental inline container-image. The inline
48
+ // image is only a fallback for a standalone single-descriptor build that has
49
+ // no package context.
50
+ const containerImage = ctx.package?.docker ?? ctx.app?.container?.image;
51
+ if (containerImage) {
52
+ cb.line(`container_image_tag: ${JSON.stringify(containerImage)},`);
47
53
  }
48
54
  });
49
55
  cb.line("};");