Skip to content

Fix NumPy 2.4+/Python 3.14 breakage, harden CI, adopt Renovate - #14

Merged
shauneccles merged 5 commits into
mainfrom
ci/harden-and-upstream-sync
Sep 27, 2026
Merged

shauneccles merged 5 commits into
mainfrom
ci/harden-and-upstream-sync

Conversation

@shauneccles

@shauneccles shauneccles commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Why

0.2.6 is broken on Python 3.14 with NumPy ≥ 2.4. Every resample() / Resampler.process() call that trims its output raises ValueError: cannot resize an array that may be referenced…. CI didn't notice because it only ran on push/PR and the lockfile pins NumPy 2.3.5.

Changes

Upstream fixes ported from tuxu/python-samplerate:

CI

  • Every action pinned to a commit SHA, permissions: {} by default, checkout credentials not persisted. zizmor findings: 14 → 0 (pedantic).
  • New zizmor workflow on every PR and weekly.
  • Weekly scheduled build so wheel tests pick up new NumPy releases; NumPy-nightly job on 3.14 as an early warning.
  • Wheel built from the sdist and tested (catches MANIFEST.in gaps).
  • numpy_oldest job: Python 3.11 + the NumPy floor read from pyproject.toml.
  • cibuildwheel 3.3.0 → 4.2.1.
  • Publish via pypa/gh-action-pypi-publish (PEP 740 attestations); fixed PyPI environment URL. Workflow filename and pypi environment are unchanged, so trusted publishing still matches.

Support matrix: CPython 3.11–3.14 (3.9/3.10 dropped, EOL); numpy>=1.23.2 (first with 3.11 wheels, was an uninstallable >=1.7.0).

Package metadata: LedFx listed as author; Homepage/Source/Issues point at this repo (plus an Upstream link), so wheel problems get reported here rather than to tuxu.

Upkeep

  • renovate.json extends the new LedFx/renovate-config preset and adds regex managers for the pybind11/libsamplerate FetchContent pins and for a "last reviewed upstream commit" marker, so upstream changes arrive as a PR. Neither automerges. Both were dry-run with Renovate locally.
  • MAINTAINING.md (upkeep plan, upstream sync, required repo settings) and SECURITY.md.

Testing

  • 206 tests pass locally on Python 3.14 + NumPy 2.5.3 (failed before), and on Python 3.11 + NumPy 1.23.2.
  • sdist → wheel → tests run locally with the workflow's exact commands.
  • actionlint and zizmor clean.
  • Not yet run on GitHub: cibuildwheel v4 across all platforms and the NumPy-nightly job (schedule/dispatch only).

After merge, tag v0.2.7 so LedFx on 3.14 works again.

🤖 Generated with Claude Code

shauneccles and others added 5 commits September 27, 2026 13:36
Port two fixes from tuxu/python-samplerate:

- 06e88d1 (tuxu#36): return a view instead of ndarray.resize(). On Python
  3.14 with NumPy >= 2.4 resize() raises "cannot resize an array that may
  be referenced", breaking resample() and Resampler.process() on every
  call that trims output. 0.2.6 is affected.
- 6d68220 (tuxu#34): pass Python_EXECUTABLE (what FindPython reads) instead
  of PYTHON_EXECUTABLE, so CMake builds against the interpreter running
  the build rather than the first one on PATH.

The CallbackResampler.read port deliberately differs from upstream:
upstream builds the mono 1-D view from the original buffer's pointer but
the copied array as base, so the returned array points at freed memory.
We take the pointer from the array we use as base. A regression test
checks every truncated output shares memory with its base.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Pin every action to a commit SHA, default to `permissions: {}` and
  grant `contents: read` per job, stop persisting checkout credentials.
  zizmor (pedantic) goes from 14 findings to 0.
- Add a zizmor workflow that audits .github/ on change and weekly.
- Run push builds only for main and tags (PRs already run), plus a
  weekly schedule so wheel tests pick up new NumPy releases between
  releases; the NumPy 2.4 break went unnoticed for months.
- Build a wheel from the sdist and run the tests against it, so a file
  missing from MANIFEST.in fails CI.
- Scheduled job testing against NumPy nightly on Python 3.14.
- cibuildwheel 3.3.0 -> 4.2.1; drop unused matrix keys and the
  `submodules` option (there are none).
- Publish with pypa/gh-action-pypi-publish, which uploads PEP 740
  attestations; fix the environment URL to the real PyPI project.
- Add renovate.json extending the LedFx org preset, with a regex
  manager for the pybind11/libsamplerate FetchContent pins.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…novate

MAINTAINING.md records how deps, vendored C/C++ and the upstream fork are
kept current, which repo settings the automation relies on, and the last
reviewed upstream commit. A Renovate git-refs manager bumps that marker
when tuxu/python-samplerate moves, so upstream changes arrive as a PR.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Python 3.9 and 3.10 are end of life; stop building their wheels. The old
`numpy>=1.7.0` floor was never installable on any supported Python. 1.23.2
is the first NumPy with CPython 3.11 wheels, and a new CI job runs the
suite on Python 3.11 with exactly that version so the floor stays true.

zizmor now runs on every PR so it can be a required check (a
path-filtered required check never reports and blocks the PR).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PyPI showed only the upstream authors and no project links, so problems
with these wheels could be reported to tuxu/python-samplerate. Add LedFx
as author and point Homepage/Source/Issues here, with Upstream kept as
its own link.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to 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