Repository navigation
Add C extension build, test and CI infrastructure - #533
Conversation
|
@jeromekelleher, if you've got a minute could you glance over the infrastructure I've added here? |
jeromekelleher-bot
left a comment
There was a problem hiding this comment.
This looks good. It follows the tsinfer setup closely, which is what we want. Two things:
1. The release wheel build will fail. The shared build-wheels.yml@v22 workflow installs cibuildwheel with uv sync --locked --only-group wheels. This PR adds cibuildwheel to the packaging group, and there's no wheels group. I checked locally on this branch:
$ uv sync --locked --only-group wheels
error: Group `wheels` is not defined in the project's `dependency-groups` table
wheels.yml only runs on a release or a push to test-publish, so the PR checks don't catch this. We'd only find out when we try to release. The fix is to add a wheels = ["cibuildwheel"] group like tsinfer has, and re-lock. After that it's worth pushing to test-publish once to check the full wheel and publish pipeline end to end. The build-* artifact merge in the publish job is also new.
2. Fewer platforms get a wheel. Until now we've shipped a pure-Python wheel that installs everywhere. From the next release, wheels only cover cp311–cp313, plus x86_64 only on Linux. Anyone on Python 3.14, Linux aarch64 or musl will have to build from the sdist, which needs a compiler. That happens even though the extension isn't used yet. I think we should at least add cp314-*, since tskit already builds cp312–cp315. We should also keep this in mind if we cut a release before the C port is wired in.
|
@nspope - in case you're wondering, I'm using claude to do some initial reviews. I'm "reviewing the reviews" so please take this as my input (if in LLMese). |
|
Thanks @jeromekelleher.
I pushed to test-publish to check the full pipeline, the jobs show up in the CI overview in this PR. The macos-14 runner has been retired, so switched to macos-15. Presumably this'll hit tsinfer/tskit too. |
|
Thanks @nspope, this all looks great, and good to see the full pipeline go through on
Happy to merge after that. |
|
Done |
|
Great, thanks @nspope! I think it's OK to do the next step in one go, and just switch from numba to C in one go. I'd use a prompt something like this:
|
First step in replacing numba with a C extension. Infrastructure is copied from tsinfer.
lib/is a C library skeleton with tskit-style error handling, meson build with strict warnings and CUnit smoke tests_tsdatemodule.cis a minimal _tsdate module with LibraryErrorsetup.py,Makefile,MANIFEST.in,cibuildwheelconfig, uv cache-keysI'll build this in pieces, and only wire into the tsdate Python package at the end.