Skip to content

numchuck 0.1.10

Choose a tag to compare

@shakfu shakfu released this 24 Feb 00:46
· 34 commits to main since this release

Python bindings for the ChucK audio programming language using nanobind.

The numchuck library provides interactive control over ChucK, enabling live coding workflows, bidirectional Python/ChucK communication, and comprehensive VM introspection—all while maintaining the existing real-time and offline audio capabilities.

Changes from the last Release

Added

  • Bundled Chugins in Wheels (scripts/cmake/fn_add_chugin.cmake, pyproject.toml, src/numchuck/api.py):

    • Pre-built chugins (~37 .chug files) are now included in distributed wheels
    • NUMCHUCK_INSTALL_CHUGINS CMake option gates installation (ON for wheel builds, OFF for local dev)
    • cmake.args = ["-DNUMCHUCK_INSTALL_CHUGINS=ON"] in pyproject.toml enables bundling during pip install / uv build
    • Bundled chugins directory (<package>/chugins/) automatically added to ChucK search path in Chuck.__init__
    • Users no longer need to build from source to use chugins
  • numchuck info lists bundled chugins (src/numchuck/cli/main.py):

    • Shows count and names of all bundled .chug files from the installed package
    • Displays "none" for editable/dev installs where chugins are in examples/chugins/ instead
  • Cross-Platform Wheel Repair for Chugins (scripts/repair_wheel.py):

    • Wheel repair tools (delocate, auditwheel, delvewheel) skip .chug files since they only scan platform-standard extensions
    • New repair script temporarily renames .chug to the native extension (.dylib/.so/.dll), runs the repair tool, then renames back
    • Ensures chugin shared library dependencies are properly bundled if any chugin gains external (non-system) dependencies
    • Uses only stdlib (zipfile, hashlib, csv) -- no dependency on the wheel CLI package
    • RECORD file correctly regenerated after rename operations
    • Platform-specific handling:
      • macOS: .chug -> .dylib, delocate-wheel with --require-archs
      • Linux: .chug -> .so, auditwheel repair
      • Windows: .chug -> .dll, delvewheel with --analyze-existing --no-mangle
  • README: Bundled chugins documentation (README.md):

    • Categorized table of all 37 bundled chugins (38 on macOS with AudioUnit)
    • Updated "Using Chugins" section to show automatic discovery (no manual path setup)
    • Plugin Support overview links to the bundled chugins table

Changed

  • CI: Chugin tests enabled in wheel builds (.github/workflows/wheels.yml):

    • Removed and not chugin from CIBW_TEST_COMMAND filter
    • All three platforms (Linux, macOS, Windows) now use the custom repair script
    • Windows builds install delvewheel via CIBW_BEFORE_BUILD_WINDOWS
  • Chugin test helpers updated (tests/test_examples.py):

    • New _get_chugins_dir() helper checks bundled package directory first, falls back to examples/chugins/ for dev builds
    • All chugin tests (test_chugin_loading, test_chugin_bitcrusher_strict, test_chugin_gverb_strict, test_chugin_convrev_example) use the unified helper

Fixed

  • TUI tests skipped on Windows (tests/conftest.py):

    • Added pytest_collection_modifyitems hook to skip @pytest.mark.tui tests on Windows
    • prompt_toolkit raises NoConsoleScreenBufferError on Windows in non-console environments
    • 42 TUI tests now skip gracefully on Windows instead of failing
  • WAV file rendering tests (tests/test_wavfile.py):

    • Fixed test_render_sine_to_wav run duration: chuck.run(44100) changed to chuck.run(44100 * 4) to match 4-second ChucK code duration
    • Added del chuck before temp directory cleanup in all tests to release file handles
    • Fixes PermissionError on Windows where files can't be deleted while open
  • Async awaitable race condition (src/numchuck/api.py):

    • get_int_awaitable, get_float_awaitable, get_string_awaitable had a race between run_in_executor completion and call_soon_threadsafe callback delivery
    • Added await asyncio.sleep(0) after run_in_executor to yield to the event loop and process pending callbacks before checking future.done()
    • Fixes intermittent "callback not invoked" failures on slower platforms (macOS x86_64 under Rosetta)