Skip to content

Commit 412809f

Browse files
committed
Build a single abi3 (Stable ABI) wheel for CPython 3.11+, release 1.0.0
Target the CPython Limited API via scikit-build-core's wheel.py-api so a single abi3 wheel per platform covers CPython 3.11 and later. CPython 3.10 still receives a regular, version-specific wheel, preserving support for all currently-supported Python versions. - pyproject.toml: set wheel.py-api = "cp311" and raise the scikit-build-core build requirement to >=0.11 for the SKBUILD_SABI_COMPONENT and SKBUILD_SABI_VERSION variables - CMakeLists.txt: request the Development.SABIModule component and pass USE_SABI to python_add_library when targeting the Stable ABI, so FindPython defines Py_LIMITED_API and names the extension cutil.abi3.so - README: document the abi3 wheels and the 3.11 floor (and fix a stray reference to Simplification) - Bump version to 1.0.0 (CITATION.cff and pyproject.toml; uv.lock follows) The floor is 3.11 because the typed memoryviews used in cutil.pyx are only available under the Limited API from CPython 3.11 onwards. The Rust lonlat_bng FFI library is a pure C-ABI dependency and is unaffected. cibuildwheel 4.0.0 handles abi3 wheels automatically (build once, test on all later versions, run abi3audit after repair), so no CI changes are required.
1 parent 37cab68 commit 412809f

5 files changed

Lines changed: 28 additions & 9 deletions

File tree

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ authors:
77
given-names: Stephan
88
orcid: "https://orcid.org/0000-0003-4379-2450"
99
title: "Convertbng"
10-
date-released: 2021-12-12
10+
date-released: 2026-06-08
1111
doi: "10.5281/zenodo.5774931"
1212
keywords:
1313
- geo
1414
- gis
1515
- polyline
1616
license: BlueOak-1.0.0
1717
repository-code: "https://github.com/urschrei/convertbng"
18-
version: "0.2.72"
18+
version: "1.0.0"

CMakeLists.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ project(
88
set(convertbng_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/convertbng")
99

1010
# Find Python
11+
# ${SKBUILD_SABI_COMPONENT} resolves to "Development.SABIModule" when
12+
# scikit-build-core is targeting the Stable ABI (see wheel.py-api in
13+
# pyproject.toml) and to an empty string otherwise (e.g. CPython 3.10, PyPy).
1114
find_package(
1215
Python
13-
COMPONENTS Interpreter Development.Module NumPy
16+
COMPONENTS Interpreter Development.Module NumPy ${SKBUILD_SABI_COMPONENT}
1417
REQUIRED)
1518
include(UseCython)
1619

@@ -24,8 +27,17 @@ cython_transpile(
2427
CYTHON_ARGS -I "${convertbng_SRC_DIR}"
2528
)
2629

27-
# Create the extension module
28-
python_add_library(cutil MODULE "${cutil}" WITH_SOABI)
30+
# Create the extension module.
31+
# When targeting the Stable ABI, ${SKBUILD_SABI_VERSION} holds the minimum
32+
# CPython version (e.g. "3.11"); passing it via USE_SABI makes FindPython define
33+
# Py_LIMITED_API and name the module cutil.abi3.so. When it is empty (CPython
34+
# 3.10, PyPy) we fall back to a regular, version-specific extension module.
35+
if(NOT "${SKBUILD_SABI_VERSION}" STREQUAL "")
36+
message(STATUS "Building cutil against the Limited API for ${SKBUILD_SABI_VERSION}")
37+
python_add_library(cutil MODULE "${cutil}" WITH_SOABI USE_SABI ${SKBUILD_SABI_VERSION})
38+
else()
39+
python_add_library(cutil MODULE "${cutil}" WITH_SOABI)
40+
endif()
2941

3042
# Set include directories
3143
target_include_directories(cutil PRIVATE

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ To build from the sdist, download the release archive for your platform from the
2727
Changes in `pyx` and `pxd` files, and the Rust library and header will bust the cache, triggering a rebuild when `uv` commands are run.
2828

2929
### Supported Python Versions
30-
Simplification supports all [_currently_ supported Python versions](https://devguide.python.org/versions/).
30+
convertbng supports all [_currently_ supported Python versions](https://devguide.python.org/versions/).
31+
32+
Binary wheels target the CPython [Stable ABI](https://docs.python.org/3/c-api/stable.html) (`abi3`): a single `abi3` wheel per platform covers CPython 3.11 and later, while CPython 3.10 receives a standard version-specific wheel.
3133

3234
### Supported Platforms
3335
- Linux (`manylinux`-compatible) x86_64 and aarch64

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "convertbng"
3-
version = "0.7.12"
3+
version = "1.0.0"
44
description = "Fast lon, lat to and from ETRS89 and BNG (OSGB36) using the OS OSTN15 transform via Rust FFI"
55
readme = "README.md"
66
requires-python = ">=3.10"
@@ -39,10 +39,15 @@ dev = [
3939
[tool.scikit-build]
4040
minimum-version = "build-system.requires"
4141
wheel.packages = ["src/convertbng"]
42+
# Build a single Stable ABI (abi3) wheel for CPython 3.11+. Typed memoryviews,
43+
# which cutil.pyx relies on, are only available under the Limited API from
44+
# CPython 3.11 onwards, so that is the floor. CPython 3.10 still receives a
45+
# regular, version-specific wheel.
46+
wheel.py-api = "cp311"
4247

4348
[build-system]
4449
requires = [
45-
"scikit-build-core>=0.10",
50+
"scikit-build-core>=0.11",
4651
"numpy >= 2.0.0",
4752
"cython >= 3.1.0",
4853
"cython-cmake"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)