From ec915524f884153c6c86b9c407ccfc9e1788dff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Fri, 27 Jun 2025 16:05:27 +0200 Subject: [PATCH 1/9] Switch to abi3 wheels --- .github/workflows/create_wheels.yaml | 10 ++++------ Cargo.toml | 2 +- setup.cfg | 3 +++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create_wheels.yaml b/.github/workflows/create_wheels.yaml index 94373be..cfb2201 100644 --- a/.github/workflows/create_wheels.yaml +++ b/.github/workflows/create_wheels.yaml @@ -15,7 +15,6 @@ jobs: strategy: matrix: os: [macos-latest, ubuntu-latest, windows-latest] - python-version: [37, 38, 39, 310, 311] steps: - uses: actions/checkout@v3 @@ -34,7 +33,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.11.3 env: - CIBW_BUILD: cp${{matrix.python-version}}-* + CIBW_BUILD: cp38-* CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH" CARGO_TERM_COLOR="always"' CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"' @@ -49,7 +48,6 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.7, 3.8, 3.9, '3.10', '3.11'] os: [macos-latest, ubuntu-latest, windows-latest] steps: @@ -59,10 +57,10 @@ jobs: - uses: actions/download-artifact@v3 with: name: wheels - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: 3.x - name: Install wheel run: | pip install --force-reinstall --no-deps --no-index --find-links . cpp-demangle @@ -86,7 +84,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.x - name: Push to PyPi env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} diff --git a/Cargo.toml b/Cargo.toml index 6401b55..567897a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,4 +13,4 @@ cpp_demangle = "0.4.0" [dependencies.pyo3] version = "0.17.3" -features = ["extension-module"] +features = ["extension-module", "abi3"] diff --git a/setup.cfg b/setup.cfg index 6769b8a..75d85b9 100755 --- a/setup.cfg +++ b/setup.cfg @@ -10,3 +10,6 @@ search = name = "py_cpp_demangle" version = "{current_version}" replace = name = "py_cpp_demangle" version = "{new_version}" + +[bdist_wheel] +py_limited_api=cp38 \ No newline at end of file From 01df01f66f9d097c4d7586cbcc993aeb36d99801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:08:05 +0200 Subject: [PATCH 2/9] ci: update {upload,download}-artifact actions --- .github/workflows/create_wheels.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/create_wheels.yaml b/.github/workflows/create_wheels.yaml index cfb2201..83e754b 100644 --- a/.github/workflows/create_wheels.yaml +++ b/.github/workflows/create_wheels.yaml @@ -38,9 +38,9 @@ jobs: CIBW_ENVIRONMENT_WINDOWS: 'PATH="$UserProfile\.cargo\bin;$PATH"' - name: Upload Binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: wheels + name: wheels-${{ matrix.os }} path: wheelhouse test-wheels: @@ -54,9 +54,9 @@ jobs: - uses: actions/checkout@v3 with: path: py_cpp_demangle_source - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels + name: wheels-${{ matrix.os }} - name: Set up Python uses: actions/setup-python@v4 with: @@ -74,9 +74,10 @@ jobs: if: "startsWith(github.ref, 'refs/tags/')" needs: [test-wheels] steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels + pattern: wheels-* + merge-multiple: true - name: Create GitHub Release uses: fnkr/github-action-ghr@v1.3 env: From ab04c26a17b5ea9be888214e0fcec7607b2690e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:13:14 +0200 Subject: [PATCH 3/9] ci: update setup-python action --- .github/workflows/create_wheels.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create_wheels.yaml b/.github/workflows/create_wheels.yaml index 83e754b..858552f 100644 --- a/.github/workflows/create_wheels.yaml +++ b/.github/workflows/create_wheels.yaml @@ -58,7 +58,7 @@ jobs: with: name: wheels-${{ matrix.os }} - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.x - name: Install wheel @@ -83,7 +83,7 @@ jobs: env: GHR_PATH: . GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: python-version: 3.x - name: Push to PyPi From 22939e9d86ad33812e4c87a990e2ad8205c92e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:13:23 +0200 Subject: [PATCH 4/9] ci: update cibuildwheel action --- .github/workflows/create_wheels.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_wheels.yaml b/.github/workflows/create_wheels.yaml index 858552f..6d7014b 100644 --- a/.github/workflows/create_wheels.yaml +++ b/.github/workflows/create_wheels.yaml @@ -31,7 +31,7 @@ jobs: toolchain: stable - name: Build wheels - uses: pypa/cibuildwheel@v2.11.3 + uses: pypa/cibuildwheel@v3.0.0 env: CIBW_BUILD: cp38-* CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH" CARGO_TERM_COLOR="always"' From 918c366b3f164b43d862f25d527b025054803111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:15:58 +0200 Subject: [PATCH 5/9] ci: update checkout action --- .github/workflows/create_wheels.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create_wheels.yaml b/.github/workflows/create_wheels.yaml index 6d7014b..24c1408 100644 --- a/.github/workflows/create_wheels.yaml +++ b/.github/workflows/create_wheels.yaml @@ -17,7 +17,7 @@ jobs: os: [macos-latest, ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up QEMU if: runner.os == 'Linux' @@ -51,7 +51,7 @@ jobs: os: [macos-latest, ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: path: py_cpp_demangle_source - uses: actions/download-artifact@v4 From 453e7356aea2a7d6ed4c6644e2722f3a107d9631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:20:41 +0200 Subject: [PATCH 6/9] ci: do not use deprecated setup-rust action Rust is available on GitHub hosted runners anyway. --- .github/workflows/create_wheels.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/create_wheels.yaml b/.github/workflows/create_wheels.yaml index 24c1408..e472fbc 100644 --- a/.github/workflows/create_wheels.yaml +++ b/.github/workflows/create_wheels.yaml @@ -25,11 +25,6 @@ jobs: with: platforms: all - - name: Setup rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: Build wheels uses: pypa/cibuildwheel@v3.0.0 env: From 3738dc399729e3be848eef92871f632a64e6c14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:24:35 +0200 Subject: [PATCH 7/9] ci: update macos deployment target Otherwise build fails with this error: + delocate-wheel --require-archs x86_64 -w /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/cibw-run-4aju7ur6/cp38-macosx_x86_64/repaired_wheel -v /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/cibw-run-4aju7ur6/cp38-macosx_x86_64/built_wheel/cpp_demangle-0.1.2-cp38-abi3-macosx_10_12_x86_64.whl Fixing: /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/cibw-run-4aju7ur6/cp38-macosx_x86_64/built_wheel/cpp_demangle-0.1.2-cp38-abi3-macosx_10_12_x86_64.whl Traceback (most recent call last): File "/private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/cibw-run-4aju7ur6/cp38-macosx_x86_64/build/venv/bin/delocate-wheel", line 8, in sys.exit(main()) File "/private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/cibw-run-4aju7ur6/cp38-macosx_x86_64/build/venv/lib/python3.8/site-packages/delocate/cmd/delocate_wheel.py", line 116, in main copied = delocate_wheel( File "/private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/cibw-run-4aju7ur6/cp38-macosx_x86_64/build/venv/lib/python3.8/site-packages/delocate/delocating.py", line 1090, in delocate_wheel out_wheel_fixed = _check_and_update_wheel_name( File "/private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/cibw-run-4aju7ur6/cp38-macosx_x86_64/build/venv/lib/python3.8/site-packages/delocate/delocating.py", line 925, in _check_and_update_wheel_name raise DelocationError( delocate.libsana.DelocationError: Library dependencies do not satisfy target MacOS version 10.9: /private/var/folders/y6/nj790rtn62lfktb1sh__79hc0000gn/T/tmp9i_sockf/wheel/cpp_demangle.abi3.so has a minimum target of 10.12 Set the environment variable 'MACOSX_DEPLOYMENT_TARGET=10.12' to update minimum supported macOS for this wheel. --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 67d2c50..15932e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,9 @@ skip = ["pp*", "*musl*", "*-manylinux_i686", "*win32"] [tool.cibuildwheel.macos] archs = ["x86_64"] +[tool.cibuildwheel.macos.environment] +MACOSX_DEPLOYMENT_TARGET = "10.12" + [build-system] requires = [ "setuptools>=42", From 0ccfa612d484d981c116f20f9be38ca62be76f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:34:27 +0200 Subject: [PATCH 8/9] cibuildwheel: build native (i.e arm) wheels for MacOS --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 15932e9..f1bc672 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,9 +4,6 @@ test-command = "" skip = ["pp*", "*musl*", "*-manylinux_i686", "*win32"] -[tool.cibuildwheel.macos] -archs = ["x86_64"] - [tool.cibuildwheel.macos.environment] MACOSX_DEPLOYMENT_TARGET = "10.12" From 009a1c5629e3928cfedef50533533277d13fe053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:34:55 +0200 Subject: [PATCH 9/9] cibuildwheel: removing unused selector `pp*` See this build warning: Warning: cibuildwheel: Invalid skip selector: 'pp*'. This selector matches a group that wasn't enabled. Enable it using the `enable` option or remove this selector. This selector will have no effect. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f1bc672..4c9e6a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ # skip testing in the cibuildwheel phase, will install the wheels later # and verify test-command = "" -skip = ["pp*", "*musl*", "*-manylinux_i686", "*win32"] +skip = ["*musl*", "*-manylinux_i686", "*win32"] [tool.cibuildwheel.macos.environment] MACOSX_DEPLOYMENT_TARGET = "10.12"