Repository navigation
Package for PyPI - #16
Merged
Merged
Conversation
Replace setup.py with scikit-build-core and move the metadata into pyproject.toml. The setuptools sdist contained no sources; the new one includes the CDT submodule and builds on its own. pybind11 now comes from the build requirements instead of a submodule, numpy is declared as a dependency, and Python 3.10 or newer is required. Rename the package to pythoncdt and make it a package with the compiled module as pythoncdt._core, so that it can ship type stubs (_core.pyi and py.typed). CI checks the stubs against the module with mypy.stubtest. Build wheels with cibuildwheel for Linux, macOS and Windows, and publish them to PyPI with trusted publishing when a GitHub release is published. Run the tests on several threads at once on free-threaded Python. Declare the package and its free-threading support stable.
The version is no longer set in pyproject.toml: setuptools-scm takes it from the git tag, so publishing a GitHub release tagged 2.1.0 publishes version 2.1.0 to PyPI. Builds between releases get dev versions. Release Drafter keeps a draft of the next release, listing the merged pull requests and choosing the version from their labels: major, minor, or patch when unlabeled. Publishing the draft releases it.
Add pre-commit hooks running ruff's linter and formatter, and a CI job running the same hooks so that unformatted or failing code can't be merged. Fix what the linter found and reformat the tests.
CMake passes the version as a string literal, so the stringify macros and the "dev" fallback are gone. The tests hash the OFF text in memory instead of writing it to a temporary file.
The update only bumps CDT's version and its docs, so the bindings need no changes.
The V2d and Edge buffers had twice the item size as stride, so the second item was read past the end of the object, and Edge reported its items as doubles. Their constructors read past short buffers and ignored strides. They now reuse the checks of the insert overloads, and the Edge buffer is read-only so that it can't break the v1 < v2 order. The stubs declare __buffer__ for both classes, so type checkers accept them as buffers. CI fetches the full history, so the test builds get the version from the git tags.
Owner
Author
…uilds the wheels without a failed publish
This was referenced Oct 6, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Package the bindings for PyPI and publish them from GitHub releases.
Packaging
setup.pyis replaced by scikit-build-core; the metadata is inpyproject.toml.pythoncdt, with the compiled module aspythoncdt._core._core.pyi,py.typed) are included. CI checks them against the module withmypy.stubtest.Releases
major,minor, orpatchwhen unlabeled.CI
import PythonCDTbecomesimport pythoncdt.