Skip to content

Migrate to uv, fix Cython for ARM, support Python 3.10-3.14#597

Open
hardbyte wants to merge 5 commits intomainfrom
migrate-to-uv
Open

Migrate to uv, fix Cython for ARM, support Python 3.10-3.14#597
hardbyte wants to merge 5 commits intomainfrom
migrate-to-uv

Conversation

@hardbyte
Copy link
Collaborator

@hardbyte hardbyte commented Mar 16, 2026

Summary

  • Build system: Migrate from pip/requirements.txt/setup.cfg to uv with modern pyproject.toml. Cython 3.x is now the build dependency.
  • Cython fixes: Resolve name collisions between .pxd extern declarations and .pyx wrapper functions. Fix nogil context issues. Add language_level=3 directives.
  • ARM support: Native C++ extensions now build and run on ARM (aarch64/Apple Silicon) using NEON intrinsics via libpopcount. Fix char signedness mismatch on ARM Linux by using explicit int8_t memoryview types.
  • Python versions: Add support for 3.12, 3.13, 3.14. Drop 3.8, 3.9.
  • CI: Replace Azure Pipelines with GitHub Actions. Test matrix covers Python 3.10-3.14 on Linux, macOS (ARM), Windows, plus a native ARM Linux runner (ubuntu-24.04-arm). Add mypy typecheck job. Wheel builds include Linux aarch64 via QEMU.
  • Bug fixes: Fix divide-by-zero with zero-length filters in accelerated Dice comparison. Replace deprecated pkg_resources with importlib.metadata.
  • Docs: Update README with ARM benchmark results (~389M cmp/s at threshold 0.7), refresh install/test instructions, remove Azure badge.

Benchmark (Apple M1)

Scenario Throughput
Threshold 0.5, k=100, 20k x 20k 171 M cmp/s
Threshold 0.7, all results, 20k x 20k 384 M cmp/s
Threshold 0.7, k=100, 20k x 20k 389 M cmp/s

Test plan

  • All 9051 tests pass locally on Python 3.12, 3.13, 3.14
  • CI green: 17/17 jobs (Linux/macOS/Windows x 3.10-3.14 + ARM Linux + mypy)
  • Native extensions verified loaded (not Python fallbacks) in CI
  • Benchmark runs end-to-end with native solver and similarity metric

- Replace pip/requirements.txt/setup.cfg with uv and modern pyproject.toml
- Fix Cython 3.x compatibility: move extern declarations from _dice.pxd
  into _dice.pyx with C name aliasing to resolve name collisions
- Add language_level=3 directive to all .pyx files
- Replace deprecated pkg_resources with importlib.metadata
- Fix zero-length filter divide-by-zero edge case in _dice_x86.py
- Update CI: use uv, test Python 3.10-3.14, add ARM Linux runner
  (ubuntu-24.04-arm), add QEMU aarch64 wheel builds
- Native C extensions now build and load on ARM (NEON) and x86
Use int8_t (signed char) for Cython memoryview types instead of char,
since Python's array('b') is always signed char but plain char is
unsigned on ARM Linux. Cast to const char* at C function call sites.
The Azure DevOps account is no longer active. CI has been migrated
to GitHub Actions.
Adds mypy and types-setuptools as dev dependencies and a typecheck
job to the unit testing workflow, replacing the Azure Pipeline
static checks stage.
@hardbyte hardbyte changed the title Migrate to uv, fix Cython extensions for ARM and modern Python Migrate to uv, fix Cython for ARM, support Python 3.10-3.14 Mar 16, 2026
- Version bump to 0.16.0 reflecting breaking changes (dropped Python
  3.8/3.9, Cython 3 requirement, build system migration)
- Update README: remove Azure badge, refresh install instructions for
  uv, update benchmark numbers with ARM results, update test output
- Add changelog entry for 0.16.0
- Clean up MANIFEST.in: remove stale _entitymatcher reference, add
  _multiparty_solving_inner.cpp
@hardbyte hardbyte requested a review from maxott March 16, 2026 06:51
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