Skip to content

python-test: add a needs-dlpack input to skip the dlpack source build - #10

Merged
balbasty merged 1 commit into
mainfrom
needs-dlpack-input
Aug 17, 2026
Merged

python-test: add a needs-dlpack input to skip the dlpack source build#10
balbasty merged 1 commit into
mainfrom
needs-dlpack-input

Conversation

@balbasty

Copy link
Copy Markdown
Contributor

Why

python-test.yml unconditionally installs fastfields-dlpack from source for every calling repo except fastfields-dlpack itself, along with the per-OS clang toolchain that build requires.

That is correct for the wrappers — fastfields-numpy / -torch / -cupy all call the compiled bindings, so they genuinely need dlpack present. It is wrong for a package that does not depend on dlpack at all: such a repo would do a recursive submodule checkout and a full clang compile of the entire C++ chain on every runner in the matrix (6 jobs, macOS included) purely to test code that imports nothing but the stdlib.

This is the blocking prerequisite for fastfields-helpers, the pure-Python normalisation/enum package being split out of fastfields-dlpack so Python-only fixes no longer require a compiled-wheel release across every platform. fastfields-helpers will have dependencies = [].

What

  • New needs-dlpack boolean workflow_call input, defaulting to true.
  • Gated on it: the Install fastfields-dlpack from source step, and the three per-OS Install build toolchain steps, which exist only to serve that build.

Gating the toolchain steps as well as the install is deliberate and safe: the workflow's own comment already states they are there for "the C++ build that fastfields-dlpack needs". fastfields-dlpack itself keeps the default true, so it still gets clang for its own pip install ".[test]" extension build.

Compatibility

No existing caller changes, and none needs to. Verified against every repo that uses this workflow:

callercall siteeffect
fastfields-numpyuses: + secrets: inherit, no with:default true — unchanged
fastfields-torchsamedefault true — unchanged
fastfields-cupysamedefault true — unchanged
fastfields-dlpacksamedefault true — unchanged (still gets clang for its own build)
fastfields (meta)does not call this workflow — has its own inline test.yamlunaffected

The only caller that will pass needs-dlpack: false is the incoming fastfields-helpers.

Workflow YAML parses clean; the input resolves as type: boolean, default: true and all four gated steps carry the expected if: expressions.

🤖 Generated with Claude Code

https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z


Generated by Claude Code

The reusable test workflow unconditionally installs fastfields-dlpack from
source (and the clang toolchain that build needs) for every calling repo
except fastfields-dlpack itself. That is right for the wrappers, which all
call the compiled bindings, but wrong for a package that does not depend on
dlpack at all: it would build the entire C++ chain -- recursive submodule
checkout plus a clang compile -- on every runner in the matrix, macOS
included, to test code that imports nothing but the stdlib.
Add a `needs-dlpack` boolean input defaulting to `true`, so every existing
caller (numpy / torch / cupy / dlpack, none of which pass a `with:` block)
is unaffected, and gate on it both the cross-repo install and the three
per-OS toolchain steps, which exist only to serve that build.
The first caller to pass `false` is the incoming fastfields-helpers, the
pure-Python normalisation/enum package being split out of fastfields-dlpack.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
@balbasty
balbasty merged commit acbf816 into mainAug 17, 2026
balbasty pushed a commit to fastfields/fastfields-helpers that referenced this pull request Aug 18, 2026
Extracted from fastfields-dlpack's fastfields/dlpack/_helpers.py (verified
byte-identical function bodies against the source it was seeded from) so
Python-only fixes to these enums/normalisers ship without a compiled-wheel
release cycle across every platform. Zero runtime dependencies -- stdlib
only, no numpy/torch/cupy, no fastfields.dlpack.
Mirrors fastfields-numpy's skeleton (not fastfields-dlpack's): plain
versioningit, no compiled extension, release.yaml calls the reusable
python-release.yml with compiled: false. test.yaml passes
needs-dlpack: false (fastfields/.github#10) so CI does not build the
unrelated C++ chain just to test stdlib-only code.
9 public symbols: Spline, Bound, as_spline, as_bound, normalize_shape,
infer_ndim, check_ndim, resolve_out_spatial, anchor_scale_shift.
tests/test_helpers.py ports test_bindings.py::test_shared_helpers from
fastfields-dlpack, split into per-topic functions, plus a stdlib-only
import guard.
Verified before push: pip install ".[test]" (Requires: empty), pytest run
out-of-tree matching the CI invocation (6 passed), ruff check + ruff format
--check + codespell clean at the CI-pinned versions (ruff 0.15.8,
codespell 2.4.3), and no fastfields/__init__.py installed (PEP 420 intact).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
balbasty added a commit that referenced this pull request Aug 18, 2026
The layer diagram in CONTRIBUTING.md enumerated the six original repos but
predates fastfields-helpers -- the pure-Python enums/normalisation package
extracted from fastfields-dlpack. Add it as an independent sibling (neither
depends on the other) consumed by the numpy/torch/cupy wrappers and the
umbrella fastfields package.
Also note in the Workflows section that fastfields-helpers is the one repo
that needs neither fastfields-dlpack nor the C++ build toolchain, via the
reusable workflow's new `needs-dlpack: false` input (#10).
Factual housekeeping only, not a design change -- the cu124 wheel-lane
naming drift a few sections down is pre-existing and out of scope here.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
balbasty added a commit that referenced this pull request Aug 18, 2026
* docs: add fastfields-helpers to the layer diagram and CI note
The layer diagram in CONTRIBUTING.md enumerated the six original repos but
predates fastfields-helpers -- the pure-Python enums/normalisation package
extracted from fastfields-dlpack. Add it as an independent sibling (neither
depends on the other) consumed by the numpy/torch/cupy wrappers and the
umbrella fastfields package.
Also note in the Workflows section that fastfields-helpers is the one repo
that needs neither fastfields-dlpack nor the C++ build toolchain, via the
reusable workflow's new `needs-dlpack: false` input (#10).
Factual housekeeping only, not a design change -- the cu124 wheel-lane
naming drift a few sections down is pre-existing and out of scope here.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
* Fix: restore full CONTRIBUTING.md content (previous commit accidentally wrote a placeholder)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@balbasty