From 315ece7688eac86959fcf0a5b9caac9c18deb517 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 14:20:39 -0400 Subject: [PATCH 01/57] ci: build wheels using cibuildwheel --- .github/workflows/publish-to-test-pypi.yml | 45 +++++++++++----------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 6492b81..daa86c5 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,25 +1,25 @@ --- name: Publish OpenSTL -on: push +on: [push, pull_request] jobs: - build: - name: Build distribution 📦 - timeout-minutes: 30 - if: startsWith(github.ref, 'refs/tags/') - runs-on: - - self-hosted - - manylinux - env: - PLAT: manylinux_2_28_x86_64 + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + steps: - uses: actions/checkout@v4 - - name: Build a binary wheel and a source tarball -> manylinux_2_28_x86_64 - run: bash python/build-wheels.sh - - name: Store the distribution packages - uses: actions/upload-artifact@v3 + - uses: actions/setup-python@v5 + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.18.1 + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + - uses: actions/upload-artifact@v4 with: - name: python-package-distributions - path: dist/ + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl publish-to-testpypi: name: Publish Python 🐍 distribution 📦 to TestPyPI needs: @@ -35,7 +35,7 @@ jobs: uses: actions/download-artifact@v3 with: name: python-package-distributions - path: dist/ + path: ./wheelhouse/ - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: @@ -44,9 +44,10 @@ jobs: name: Test openstl testpypi distrib needs: - publish-to-testpypi - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-14] python-version: ["pypy3.7", "pypy3.8", "pypy3.9", "pypy3.10", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -74,7 +75,7 @@ jobs: uses: actions/download-artifact@v3 with: name: python-package-distributions - path: dist/ + path: ./wheelhouse/ - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 github-release: @@ -91,11 +92,11 @@ jobs: uses: actions/download-artifact@v3 with: name: python-package-distributions - path: dist/ + path: ./wheelhouse/ - name: Sign the dists with Sigstore uses: sigstore/gh-action-sigstore-python@v1.2.3 with: - inputs: ./dist/*.tar.gz ./dist/*.whl + inputs: ./wheelhouse/*.tar.gz ./wheelhouse/*.whl - name: Create GitHub Release env: GITHUB_TOKEN: ${{ github.token }} @@ -104,5 +105,5 @@ jobs: - name: Upload artifact signatures to GitHub Release env: GITHUB_TOKEN: ${{ github.token }} - run: gh release upload '${{ github.ref_name }}' dist/** --repo '${{ + run: gh release upload '${{ github.ref_name }}' ./wheelhouse/** --repo '${{ github.repository }}' \ No newline at end of file From 90068575c9db8a74082b2f6cc3f28d2591fb40c8 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 14:22:12 -0400 Subject: [PATCH 02/57] ci: fix github workflow --- .github/workflows/publish-to-test-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index daa86c5..00c5993 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -23,7 +23,7 @@ jobs: publish-to-testpypi: name: Publish Python 🐍 distribution 📦 to TestPyPI needs: - - build + - build_wheels runs-on: ubuntu-latest environment: name: testpypi From 98505532569ada8ca1e096055bf90e820f7d47c5 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 14:37:37 -0400 Subject: [PATCH 03/57] ci: fix the cmake path --- .github/workflows/publish-to-test-pypi.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 00c5993..edeb1c8 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -15,7 +15,9 @@ jobs: - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.18.1 - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse + run: | + CMAKE_PATH=$(python -c "import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'cmake'))") + OPENSTL_CMAKE_PATH=$CMAKE_PATH python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} From b8b21ed9f93e0f31728e9985a4d07cbf2e1bb028 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 14:40:25 -0400 Subject: [PATCH 04/57] ci: fix the cmake path --- .github/workflows/publish-to-test-pypi.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index edeb1c8..7c4d9cd 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,6 +1,6 @@ --- name: Publish OpenSTL -on: [push, pull_request] +on: [pull_request] jobs: build_wheels: name: Build wheels on ${{ matrix.os }} @@ -16,7 +16,11 @@ jobs: run: python -m pip install cibuildwheel==2.18.1 - name: Build wheels run: | - CMAKE_PATH=$(python -c "import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'cmake'))") + if [ "${{ runner.os }}" = "Windows" ]; then + set CMAKE_PATH=$(python -c "import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'cmake'))") + else + CMAKE_PATH=$(python -c "import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'cmake'))") + fi OPENSTL_CMAKE_PATH=$CMAKE_PATH python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v4 with: From 6d8d8e349640d292fcb3f46207f051626e72f945 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 14:56:00 -0400 Subject: [PATCH 05/57] ci: fix the cmake path --- .github/workflows/publish-to-test-pypi.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 7c4d9cd..87e31bb 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,6 +1,6 @@ --- name: Publish OpenSTL -on: [pull_request] +on: [push, pull_request] jobs: build_wheels: name: Build wheels on ${{ matrix.os }} @@ -13,15 +13,9 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.18.1 + run: python -m pip install cibuildwheel==2.18.1, cmake==3.29.3 - name: Build wheels - run: | - if [ "${{ runner.os }}" = "Windows" ]; then - set CMAKE_PATH=$(python -c "import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'cmake'))") - else - CMAKE_PATH=$(python -c "import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'cmake'))") - fi - OPENSTL_CMAKE_PATH=$CMAKE_PATH python -m cibuildwheel --output-dir wheelhouse + run: python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} From 454b735d96fb6ff926f252302cb1139a853b2773 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 14:56:29 -0400 Subject: [PATCH 06/57] ci: fix the cmake path --- .github/workflows/publish-to-test-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 87e31bb..067fac5 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.18.1, cmake==3.29.3 + run: python -m pip install cibuildwheel==2.18.1 cmake==3.29.3 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v4 From 13b90f5fb5763c931da514a3e241edb542d207cb Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 15:05:24 -0400 Subject: [PATCH 07/57] ci: try to fix build for max python3.8 --- .github/workflows/publish-to-test-pypi.yml | 2 ++ pyproject.toml | 2 +- python/build-wheels.sh | 22 ---------------------- 3 files changed, 3 insertions(+), 23 deletions(-) delete mode 100644 python/build-wheels.sh diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 067fac5..b6e1439 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -12,6 +12,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version: '3.8' - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.18.1 cmake==3.29.3 - name: Build wheels diff --git a/pyproject.toml b/pyproject.toml index 25739b0..fd53ed0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel" , "ninja", "cmake>=3.15.3"] +requires = ["setuptools>=42", "wheel", "cmake>=3.15.3"] build-backend = "setuptools.build_meta" [tool.pytest.ini_options] diff --git a/python/build-wheels.sh b/python/build-wheels.sh deleted file mode 100644 index 609b956..0000000 --- a/python/build-wheels.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -set -e -u -x - -function repair_wheel { - wheel="$1" - if ! auditwheel show "$wheel"; then - echo "Skipping non-platform wheel $wheel" - else - auditwheel repair "$wheel" --plat "$PLAT" -w ./dist/ - fi -} - -# Compile wheels -for PYBIN in /opt/python/*/bin; do - OPENSTL_SOURCE_DIR=$PWD "${PYBIN}/pip" wheel . --no-deps -w dist/ -done - -# Bundle external shared libraries into the wheels -for whl in dist/*.whl; do - repair_wheel "$whl" - rm $whl -done \ No newline at end of file From 54466810a7758b90a91a7cb5e0d4222ebe2ee9e4 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 15:13:14 -0400 Subject: [PATCH 08/57] ci: try to fix build formultiple python distribs --- .github/workflows/publish-to-test-pypi.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index b6e1439..1fd7f40 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -8,12 +8,14 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-13, macos-14] + python-version: ["pypy3.7", "pypy3.8", "pypy3.9", "pypy3.10", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: ${{ matrix.python-version }} - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.18.1 cmake==3.29.3 - name: Build wheels From dc0b38460f0e20ee50720a440533eff72b6e9636 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 15:17:44 -0400 Subject: [PATCH 09/57] ci: try to fix build formultiple python distribs --- .github/workflows/publish-to-test-pypi.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 1fd7f40..9b800d9 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -3,7 +3,7 @@ name: Publish OpenSTL on: [push, pull_request] jobs: build_wheels: - name: Build wheels on ${{ matrix.os }} + name: Build ${{ matrix.python-version }} wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -17,7 +17,9 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install cibuildwheel - run: python -m pip install cibuildwheel==2.18.1 cmake==3.29.3 + run: | + python -m pip install cmake==3.29.3 + python -m pip install -U git+https://github.com/pypa/cibuildwheel@v2.18.1 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v4 From 9fd77a8d83d3034a4ac07c221ff4ca5a9dff9eb1 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 15:19:52 -0400 Subject: [PATCH 10/57] ci: try to fix build formultiple python distribs --- .github/workflows/publish-to-test-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 9b800d9..8cf2c8d 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-13, macos-14] - python-version: ["pypy3.7", "pypy3.8", "pypy3.9", "pypy3.10", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["pypy3.8", "pypy3.9", "pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 From 48f556a36139fbd12ba0b7384031836cac7ba913 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 15:28:31 -0400 Subject: [PATCH 11/57] ci: fix compiler architecture options --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 2ddd616..d5ea7aa 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ import subprocess import sysconfig from pathlib import Path +import platform from setuptools import Extension, setup from setuptools.command.build_ext import build_ext @@ -35,7 +36,12 @@ def build_extension(self, ext: CMakeExtension) -> None: ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) extdir = ext_fullpath.parent.resolve() + # Detect Python architecture + architecture_flag = "-m64" if platform.architecture()[0] == "64bit" else "-m32" + cmake_args = [ + f"CMAKE_C_FLAGS={architecture_flag}", + f"CMAKE_CXX_FLAGS={architecture_flag}", f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}", f"-DPYTHON_EXECUTABLE={sys.executable}", f"-DPYTHON_INCLUDE_DIR={sysconfig.get_path('include')}", From 189abc5d3fba9a5816b23b04d0ab91f4925b9aa0 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 15:32:32 -0400 Subject: [PATCH 12/57] ci: clean up pipeline --- .github/workflows/publish-to-test-pypi.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 8cf2c8d..9bb9612 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -3,19 +3,17 @@ name: Publish OpenSTL on: [push, pull_request] jobs: build_wheels: - name: Build ${{ matrix.python-version }} wheels on ${{ matrix.os }} + name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-13, macos-14] - python-version: ["pypy3.8", "pypy3.9", "pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: '3.8' - name: Install cibuildwheel run: | python -m pip install cmake==3.29.3 From 669c1c911493f855d132e6ac97f45223e02740b2 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 15:34:14 -0400 Subject: [PATCH 13/57] ci: clean up pipeline --- .github/workflows/publish-to-test-pypi.yml | 4 +--- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 9bb9612..fa2100e 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -15,9 +15,7 @@ jobs: with: python-version: '3.8' - name: Install cibuildwheel - run: | - python -m pip install cmake==3.29.3 - python -m pip install -U git+https://github.com/pypa/cibuildwheel@v2.18.1 + run: python -m pip install -U cibuildwheel - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v4 diff --git a/pyproject.toml b/pyproject.toml index fd53ed0..ba92d2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel", "cmake>=3.15.3"] +requires = ["setuptools>=42", "wheel", "cmake==3.29.3"] build-backend = "setuptools.build_meta" [tool.pytest.ini_options] From a0cad9a0747cf35703944d789dd8c40705ab1aae Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 15:34:46 -0400 Subject: [PATCH 14/57] ci: clean up pipeline --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ba92d2e..fd53ed0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel", "cmake==3.29.3"] +requires = ["setuptools>=42", "wheel", "cmake>=3.15.3"] build-backend = "setuptools.build_meta" [tool.pytest.ini_options] From 2ac0231eb153e1789349f2fd283b832e2ae9095d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 15:48:20 -0400 Subject: [PATCH 15/57] ci: fix pipeline compiler arch requirements --- setup.py | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/setup.py b/setup.py index d5ea7aa..9e37c5e 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,18 @@ def read_version_from_pyproject(file_path): else: return None +def get_cmake_architecture_flags(): + system = platform.system() + is_64bits = sys.maxsize > 2**32 + + if system == "Linux": + architecture_flag = "-m64" if is_64bits else "-m32" + return [f"CMAKE_C_FLAGS={architecture_flag}", f"CMAKE_CXX_FLAGS={architecture_flag}",] + elif system == "Darwin": # macOS + return [f"-DCMAKE_OSX_ARCHITECTURES={'x86_64' if is_64bits else 'i386'}"] + elif system == "Windows": + return ["-A x64"] if is_64bits else ["-A Win32"] + return [] class CMakeExtension(Extension): def __init__(self, name: str, sourcedir: str = "", cmake: str = "cmake") -> None: @@ -30,47 +42,36 @@ def __init__(self, name: str, sourcedir: str = "", cmake: str = "cmake") -> None class CMakeBuild(build_ext): - # Inspired by pybind/cmake_example - # https://github.com/pybind/cmake_example/blob/835e1a81b01d06097ccbb7b8f214ef9bd2d0c159/setup.py def build_extension(self, ext: CMakeExtension) -> None: ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) extdir = ext_fullpath.parent.resolve() - # Detect Python architecture - architecture_flag = "-m64" if platform.architecture()[0] == "64bit" else "-m32" - cmake_args = [ - f"CMAKE_C_FLAGS={architecture_flag}", - f"CMAKE_CXX_FLAGS={architecture_flag}", - f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}", + f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}", f"-DPYTHON_EXECUTABLE={sys.executable}", f"-DPYTHON_INCLUDE_DIR={sysconfig.get_path('include')}", f"-DPYTHON_LIBRARY={sysconfig.get_config_var('LIBDIR')}", - f"-DCMAKE_BUILD_TYPE=Release", + "-DCMAKE_BUILD_TYPE=Release", '-DCMAKE_INSTALL_RPATH=$ORIGIN', '-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON', '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF', '-DOPENSTL_BUILD_PYTHON:BOOL=ON' - ] - build_args = [] + ] + get_cmake_architecture_flags() + if "CMAKE_ARGS" in os.environ: - cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item] + cmake_args += os.environ["CMAKE_ARGS"].split() + + build_temp = Path(self.build_temp) / ext.name + build_temp.mkdir(parents=True, exist_ok=True) + subprocess.run([ext.cmake, ext.sourcedir] + cmake_args, cwd=build_temp, check=True) + + build_args = [] if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: if hasattr(self, "parallel") and self.parallel: build_args += [f"-j{self.parallel}"] - - build_temp = Path(self.build_temp) / ext.name - if not build_temp.exists(): - build_temp.mkdir(parents=True) - - subprocess.run( - [ext.cmake, ext.sourcedir] + cmake_args, cwd=build_temp, check=True - ) - subprocess.run( - [ext.cmake, "--build", "."] + build_args, cwd=build_temp, check=True - ) + subprocess.run([ext.cmake, "--build", "."] + build_args, cwd=build_temp, check=True) test_deps = [ 'coverage', From df45d29f33d22075062ec8afd82f3ed828cf6498 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 16:39:18 -0400 Subject: [PATCH 16/57] ci: add info about the arch and system --- .github/workflows/publish-to-test-pypi.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index fa2100e..602081a 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -14,6 +14,8 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.8' + - name: Print the arch and system + run: python -c "import platform; print(f'System: {platform.system()}'); print(f'Architecture: {platform.architecture()[0]}')" - name: Install cibuildwheel run: python -m pip install -U cibuildwheel - name: Build wheels From bf93aeef12e0bad962b3e61a50698ae166a1d909 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 16:41:32 -0400 Subject: [PATCH 17/57] ci: add info about the arch and system --- .github/workflows/publish-to-test-pypi.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 602081a..7ae13aa 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -15,7 +15,8 @@ jobs: with: python-version: '3.8' - name: Print the arch and system - run: python -c "import platform; print(f'System: {platform.system()}'); print(f'Architecture: {platform.architecture()[0]}')" + run: | + python -c "import platform; print(f'System: {platform.system()}'); print(f'Architecture: {platform.architecture()[0]}')" - name: Install cibuildwheel run: python -m pip install -U cibuildwheel - name: Build wheels From e92c9423953c96d6aa0862d3064883fbb7ee9151 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 16:45:14 -0400 Subject: [PATCH 18/57] ci: removed macos-14 --- .github/workflows/publish-to-test-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 7ae13aa..733e9fa 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -7,7 +7,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-13, macos-14] + os: [ubuntu-latest, windows-latest, macos-13] steps: - uses: actions/checkout@v4 From 43accbc785a19ea4aa399c0ad6f9e3e97405bfd7 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 16:52:50 -0400 Subject: [PATCH 19/57] fix: unused find_package --- python/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 990344e..82f9e7f 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -6,7 +6,6 @@ message(STATUS "Adding OpenSTL python binding") FIND_PACKAGE(PythonInterp 3) FIND_PACKAGE(PythonLibs 3) find_package(Python COMPONENTS Interpreter Development) -find_package(pybind11 CONFIG) #------------------------------------------------------------------------------- # Internal libraries From a26b67473de4907d8b599ea92e72af884c1f9e85 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 16:58:25 -0400 Subject: [PATCH 20/57] build: remove wextra --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3e37df..9318d7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wextra -std=c++11 -lstdc++ -pthread") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++11 -lstdc++ -pthread") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-math-errno") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lm ") From 86c3cbc22e995e0d6c9aace0c3f565bd8a4012f1 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 17:05:53 -0400 Subject: [PATCH 21/57] build: improve build for windows specific compilers --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9318d7b..51cf49f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,10 +24,15 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++11 -lstdc++ -pthread") +# Compiler-specific flags +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -pthread") +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /EHsc") +endif() + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-math-errno") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lm ") # Do not allow to build in main repo file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH) From 24fe634192b2c8587dcfe47949dcc9572ce43696 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 17:13:21 -0400 Subject: [PATCH 22/57] build: improve build for windows specific compilers --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51cf49f..1e25b40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,13 +27,14 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Compiler-specific flags if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -pthread") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-math-errno") + set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /EHsc") + set(CMAKE_CXX_FLAGS_RELEASE "/O2") + set(CMAKE_CXX_FLAGS_DEBUG "/Od /Zi") endif() -set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-math-errno") -set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") - # Do not allow to build in main repo file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH) if(EXISTS "${LOC_PATH}") From 5b44f7f40f04c77031d76f457cd1b522b0cd051e Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Mon, 27 May 2024 17:53:51 -0400 Subject: [PATCH 23/57] fix: conventions for MSBuild --- python/core/src/stl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/core/src/stl.cpp b/python/core/src/stl.cpp index 5fc59a6..507643f 100644 --- a/python/core/src/stl.cpp +++ b/python/core/src/stl.cpp @@ -73,7 +73,7 @@ namespace pybind11 { namespace detail { bool load(handle src, bool convert) { - if ( !convert and !py::array_t::check_(src) ) + if ( (!convert) && (!py::array_t::check_(src)) ) return false; auto buf = py::array_t::ensure(src); From fdd036443c6f833d547a7d436054f80b451a82de Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 11:36:26 -0400 Subject: [PATCH 24/57] fix: link python3 --- python/CMakeLists.txt | 4 ++-- setup.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 82f9e7f..5ca81ad 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -5,7 +5,7 @@ message(STATUS "Adding OpenSTL python binding") #------------------------------------------------------------------------------- FIND_PACKAGE(PythonInterp 3) FIND_PACKAGE(PythonLibs 3) -find_package(Python COMPONENTS Interpreter Development) +find_package(Python3 COMPONENTS Interpreter Development) #------------------------------------------------------------------------------- # Internal libraries @@ -29,7 +29,7 @@ IF(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND) file(GLOB_RECURSE python_SRC core/*.cpp) pybind11_add_module(openstl MODULE ${python_SRC}) target_include_directories(openstl PRIVATE ${PYBIND11_SUBMODULE}/include) - target_link_libraries(openstl PRIVATE openstl::core pybind11::headers) + target_link_libraries(openstl PRIVATE openstl::core pybind11::headers Python3::Python) target_compile_definitions(openstl PRIVATE VERSION_INFO=${PROJECT_VERSION}) set_target_properties(openstl PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON diff --git a/setup.py b/setup.py index 9e37c5e..4164492 100644 --- a/setup.py +++ b/setup.py @@ -48,9 +48,9 @@ def build_extension(self, ext: CMakeExtension) -> None: cmake_args = [ f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}", - f"-DPYTHON_EXECUTABLE={sys.executable}", - f"-DPYTHON_INCLUDE_DIR={sysconfig.get_path('include')}", - f"-DPYTHON_LIBRARY={sysconfig.get_config_var('LIBDIR')}", + f"-DPYTHON3_EXECUTABLE={sys.executable}", + f"-DPYTHON3_INCLUDE_DIR={sysconfig.get_path('include')}", + f"-DPYTHON3_LIBRARY={sysconfig.get_config_var('LIBDIR')}", "-DCMAKE_BUILD_TYPE=Release", '-DCMAKE_INSTALL_RPATH=$ORIGIN', '-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON', From 0748c1bd5f30df0f72354c21c681cc109cb3f4cc Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 11:40:21 -0400 Subject: [PATCH 25/57] fix: link python3 --- python/CMakeLists.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 5ca81ad..c7434f4 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -3,8 +3,6 @@ message(STATUS "Adding OpenSTL python binding") #------------------------------------------------------------------------------- # External libraries #------------------------------------------------------------------------------- -FIND_PACKAGE(PythonInterp 3) -FIND_PACKAGE(PythonLibs 3) find_package(Python3 COMPONENTS Interpreter Development) #------------------------------------------------------------------------------- @@ -17,15 +15,12 @@ endif() #------------------------------------------------------------------------------- # Build Python Binding #------------------------------------------------------------------------------- -if(NOT PYTHONINTERP_FOUND) - message( FATAL_ERROR "PYTHONINTERP could not be found") -endif() -if(NOT PYTHONLIBS_FOUND) - message( FATAL_ERROR "PYTHONLIBS could not be found") +if(NOT PYTHON3_FOUND) + message( FATAL_ERROR "PYTHON3 could not be found") endif() -IF(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND) +IF(PYTHON3_FOUND) file(GLOB_RECURSE python_SRC core/*.cpp) pybind11_add_module(openstl MODULE ${python_SRC}) target_include_directories(openstl PRIVATE ${PYBIND11_SUBMODULE}/include) From 70434be144e930462ad773ac50f97b6d4a5d939d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 11:42:05 -0400 Subject: [PATCH 26/57] fix: link python3 --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 4164492..9e94365 100644 --- a/setup.py +++ b/setup.py @@ -48,9 +48,9 @@ def build_extension(self, ext: CMakeExtension) -> None: cmake_args = [ f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}", - f"-DPYTHON3_EXECUTABLE={sys.executable}", - f"-DPYTHON3_INCLUDE_DIR={sysconfig.get_path('include')}", - f"-DPYTHON3_LIBRARY={sysconfig.get_config_var('LIBDIR')}", + f"-DPython3_EXECUTABLE={sys.executable}", + f"-DPython3_INCLUDE_DIR={sysconfig.get_path('include')}", + f"-DPython3_LIBRARIES={sysconfig.get_config_var('LIBDIR')}", "-DCMAKE_BUILD_TYPE=Release", '-DCMAKE_INSTALL_RPATH=$ORIGIN', '-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON', From fb9ae882df763e5d83f5f6cad54d1f6b91ec6557 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 11:46:06 -0400 Subject: [PATCH 27/57] fix: link python3 --- python/CMakeLists.txt | 8 ++++---- setup.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index c7434f4..bd1d486 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -3,7 +3,7 @@ message(STATUS "Adding OpenSTL python binding") #------------------------------------------------------------------------------- # External libraries #------------------------------------------------------------------------------- -find_package(Python3 COMPONENTS Interpreter Development) +find_package(Python COMPONENTS Interpreter Development) #------------------------------------------------------------------------------- # Internal libraries @@ -15,8 +15,8 @@ endif() #------------------------------------------------------------------------------- # Build Python Binding #------------------------------------------------------------------------------- -if(NOT PYTHON3_FOUND) - message( FATAL_ERROR "PYTHON3 could not be found") +if(NOT PYTHON_FOUND) + message( FATAL_ERROR "PYTHON could not be found") endif() @@ -24,7 +24,7 @@ IF(PYTHON3_FOUND) file(GLOB_RECURSE python_SRC core/*.cpp) pybind11_add_module(openstl MODULE ${python_SRC}) target_include_directories(openstl PRIVATE ${PYBIND11_SUBMODULE}/include) - target_link_libraries(openstl PRIVATE openstl::core pybind11::headers Python3::Python) + target_link_libraries(openstl PRIVATE openstl::core pybind11::headers) target_compile_definitions(openstl PRIVATE VERSION_INFO=${PROJECT_VERSION}) set_target_properties(openstl PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON diff --git a/setup.py b/setup.py index 9e94365..065dfeb 100644 --- a/setup.py +++ b/setup.py @@ -48,9 +48,9 @@ def build_extension(self, ext: CMakeExtension) -> None: cmake_args = [ f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}", - f"-DPython3_EXECUTABLE={sys.executable}", - f"-DPython3_INCLUDE_DIR={sysconfig.get_path('include')}", - f"-DPython3_LIBRARIES={sysconfig.get_config_var('LIBDIR')}", + f"-DPYTHON_EXECUTABLE={sys.executable}", + f"-DPYTHON_INCLUDE_DIR={sysconfig.get_path('include')}", + f"-DPYTHON_LIBRARIES={sysconfig.get_config_var('LIBDIR')}", "-DCMAKE_BUILD_TYPE=Release", '-DCMAKE_INSTALL_RPATH=$ORIGIN', '-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON', From c82fe028d0603593640f97970ec54b707598be0a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 12:00:57 -0400 Subject: [PATCH 28/57] fix: link python3 --- pyproject.toml | 2 +- python/CMakeLists.txt | 29 ++++-------- setup.py | 102 +++++++++++++++++++++++++++++++++--------- 3 files changed, 92 insertions(+), 41 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fd53ed0..9e98107 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=42", "wheel", "cmake>=3.15.3"] +requires = ["setuptools>=42", "wheel", "ninja", "cmake>=3.15.3"] build-backend = "setuptools.build_meta" [tool.pytest.ini_options] diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index bd1d486..aae2c99 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,9 +1,5 @@ message(STATUS "Adding OpenSTL python binding") -#------------------------------------------------------------------------------- -# External libraries -#------------------------------------------------------------------------------- -find_package(Python COMPONENTS Interpreter Development) #------------------------------------------------------------------------------- # Internal libraries @@ -15,19 +11,12 @@ endif() #------------------------------------------------------------------------------- # Build Python Binding #------------------------------------------------------------------------------- -if(NOT PYTHON_FOUND) - message( FATAL_ERROR "PYTHON could not be found") -endif() - - -IF(PYTHON3_FOUND) - file(GLOB_RECURSE python_SRC core/*.cpp) - pybind11_add_module(openstl MODULE ${python_SRC}) - target_include_directories(openstl PRIVATE ${PYBIND11_SUBMODULE}/include) - target_link_libraries(openstl PRIVATE openstl::core pybind11::headers) - target_compile_definitions(openstl PRIVATE VERSION_INFO=${PROJECT_VERSION}) - set_target_properties(openstl PROPERTIES - INTERPROCEDURAL_OPTIMIZATION ON - CXX_VISIBILITY_PRESET hidden - VISIBILITY_INLINES_HIDDEN ON) -ENDIF() \ No newline at end of file +file(GLOB_RECURSE python_SRC core/*.cpp) +pybind11_add_module(openstl MODULE ${python_SRC}) +target_include_directories(openstl PRIVATE ${PYBIND11_SUBMODULE}/include) +target_link_libraries(openstl PRIVATE openstl::core pybind11::headers) +target_compile_definitions(openstl PRIVATE VERSION_INFO=${PROJECT_VERSION}) +set_target_properties(openstl PROPERTIES + INTERPROCEDURAL_OPTIMIZATION ON + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON) diff --git a/setup.py b/setup.py index 065dfeb..e47b1a8 100644 --- a/setup.py +++ b/setup.py @@ -21,18 +21,14 @@ def read_version_from_pyproject(file_path): else: return None -def get_cmake_architecture_flags(): - system = platform.system() - is_64bits = sys.maxsize > 2**32 - - if system == "Linux": - architecture_flag = "-m64" if is_64bits else "-m32" - return [f"CMAKE_C_FLAGS={architecture_flag}", f"CMAKE_CXX_FLAGS={architecture_flag}",] - elif system == "Darwin": # macOS - return [f"-DCMAKE_OSX_ARCHITECTURES={'x86_64' if is_64bits else 'i386'}"] - elif system == "Windows": - return ["-A x64"] if is_64bits else ["-A Win32"] - return [] + +# Convert distutils Windows platform specifiers to CMake -A arguments +PLAT_TO_CMAKE = { + "win32": "Win32", + "win-amd64": "x64", + "win-arm32": "ARM", + "win-arm64": "ARM64", +} class CMakeExtension(Extension): def __init__(self, name: str, sourcedir: str = "", cmake: str = "cmake") -> None: @@ -42,28 +38,94 @@ def __init__(self, name: str, sourcedir: str = "", cmake: str = "cmake") -> None class CMakeBuild(build_ext): + # Inspired from https://github.com/pybind/cmake_example/blob/master/setup.py def build_extension(self, ext: CMakeExtension) -> None: ext_fullpath = Path.cwd() / self.get_ext_fullpath(ext.name) extdir = ext_fullpath.parent.resolve() + debug = int(os.environ.get("DEBUG", 0)) if self.debug is None else self.debug + cfg = "Debug" if debug else "Release" + + # CMake lets you override the generator - we need to check this. + # Can be set with Conda-Build, for example. + cmake_generator = os.environ.get("CMAKE_GENERATOR", "") + cmake_args = [ - f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}", - f"-DPYTHON_EXECUTABLE={sys.executable}", - f"-DPYTHON_INCLUDE_DIR={sysconfig.get_path('include')}", - f"-DPYTHON_LIBRARIES={sysconfig.get_config_var('LIBDIR')}", + f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}", + f"-DPython_EXECUTABLE={sys.executable}", + f"-DCMAKE_BUILD_TYPE={cfg}", "-DCMAKE_BUILD_TYPE=Release", '-DCMAKE_INSTALL_RPATH=$ORIGIN', '-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON', '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF', '-DOPENSTL_BUILD_PYTHON:BOOL=ON' - ] + get_cmake_architecture_flags() + ] + build_args = [] + # Adding CMake arguments set as environment variable + # (needed e.g. to build for ARM OSx on conda-forge) if "CMAKE_ARGS" in os.environ: - cmake_args += os.environ["CMAKE_ARGS"].split() + cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item] + + # In this example, we pass in the version to C++. You might not need to. + cmake_args += [f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"] + + if self.compiler.compiler_type != "msvc": + # Using Ninja-build since it a) is available as a wheel and b) + # multithreads automatically. MSVC would require all variables be + # exported for Ninja to pick it up, which is a little tricky to do. + # Users can override the generator with CMAKE_GENERATOR in CMake + # 3.15+. + if not cmake_generator or cmake_generator == "Ninja": + try: + import ninja + + ninja_executable_path = Path(ninja.BIN_DIR) / "ninja" + cmake_args += [ + "-GNinja", + f"-DCMAKE_MAKE_PROGRAM:FILEPATH={ninja_executable_path}", + ] + except ImportError: + pass + + else: + # Single config generators are handled "normally" + single_config = any(x in cmake_generator for x in {"NMake", "Ninja"}) + + # CMake allows an arch-in-generator style for backward compatibility + contains_arch = any(x in cmake_generator for x in {"ARM", "Win64"}) + + # Specify the arch if using MSVC generator, but only if it doesn't + # contain a backward-compatibility arch spec already in the + # generator name. + if not single_config and not contains_arch: + cmake_args += ["-A", PLAT_TO_CMAKE[self.plat_name]] + + # Multi-config generators have a different way to specify configs + if not single_config: + cmake_args += [ + f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{cfg.upper()}={extdir}" + ] + build_args += ["--config", cfg] + + if sys.platform.startswith("darwin"): + # Cross-compile support for macOS - respect ARCHFLAGS if set + archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", "")) + if archs: + cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))] + + # Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level + # across all generators. + if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: + # self.parallel is a Python 3 only way to set parallel jobs by hand + # using -j in the build_ext call, not supported by pip or PyPA-build. + if hasattr(self, "parallel") and self.parallel: + # CMake 3.12+ only. + build_args += [f"-j{self.parallel}"] build_temp = Path(self.build_temp) / ext.name - build_temp.mkdir(parents=True, exist_ok=True) - + if not build_temp.exists(): + build_temp.mkdir(parents=True) subprocess.run([ext.cmake, ext.sourcedir] + cmake_args, cwd=build_temp, check=True) From fa811253fc36c30bf8d7fc61828a404161d2a3db Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 13:08:04 -0400 Subject: [PATCH 29/57] fix: link python3 --- setup.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/setup.py b/setup.py index e47b1a8..e16799f 100644 --- a/setup.py +++ b/setup.py @@ -67,9 +67,6 @@ def build_extension(self, ext: CMakeExtension) -> None: if "CMAKE_ARGS" in os.environ: cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item] - # In this example, we pass in the version to C++. You might not need to. - cmake_args += [f"-DEXAMPLE_VERSION_INFO={self.distribution.get_version()}"] - if self.compiler.compiler_type != "msvc": # Using Ninja-build since it a) is available as a wheel and b) # multithreads automatically. MSVC would require all variables be @@ -128,11 +125,6 @@ def build_extension(self, ext: CMakeExtension) -> None: build_temp.mkdir(parents=True) subprocess.run([ext.cmake, ext.sourcedir] + cmake_args, cwd=build_temp, check=True) - - build_args = [] - if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: - if hasattr(self, "parallel") and self.parallel: - build_args += [f"-j{self.parallel}"] subprocess.run([ext.cmake, "--build", "."] + build_args, cwd=build_temp, check=True) test_deps = [ From 762fe6686311f61470b853b0699b3cdb702282f5 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 13:15:27 -0400 Subject: [PATCH 30/57] fix: link python3 --- setup.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.py b/setup.py index e16799f..ea27d08 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,6 @@ import os, re, sys import subprocess -import sysconfig from pathlib import Path -import platform from setuptools import Extension, setup from setuptools.command.build_ext import build_ext From bb56dce26938d81039d9f30f0877441166b2a61a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 13:30:19 -0400 Subject: [PATCH 31/57] fix: link python3 --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index ea27d08..db78f19 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,6 @@ def build_extension(self, ext: CMakeExtension) -> None: cmake_args = [ f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}", - f"-DPython_EXECUTABLE={sys.executable}", f"-DCMAKE_BUILD_TYPE={cfg}", "-DCMAKE_BUILD_TYPE=Release", '-DCMAKE_INSTALL_RPATH=$ORIGIN', From 989de181c51e74c104dfac315cd1cbec1654035b Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 13:40:20 -0400 Subject: [PATCH 32/57] fix: link python3 --- pyproject.toml | 18 ++++++++++++++++++ setup.py | 1 + 2 files changed, 19 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 9e98107..1b4bdf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,12 +9,30 @@ testpaths = [ "tests/python", ] +[tool.mypy] +files = "setup.py" +python_version = "3.7" +strict = true +show_error_codes = true +enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] +warn_unreachable = true + +[[tool.mypy.overrides]] +module = ["ninja"] +ignore_missing_imports = true + [tool] [tool.commitizen] name = "cz_conventional_commits" version = "1.1.1" tag_format = "v$version" +[tool.cibuildwheel] +test-command = "pytest {project}/tests" +test-extras = ["test"] +test-skip = ["*universal2:arm64"] +# Setuptools bug causes collision between pypy and cpython artifacts +before-build = "rm -rf {project}/build" [tool.poetry.dependencies] pybind11 = "v2.11.1" diff --git a/setup.py b/setup.py index db78f19..e76d8b3 100644 --- a/setup.py +++ b/setup.py @@ -50,6 +50,7 @@ def build_extension(self, ext: CMakeExtension) -> None: cmake_args = [ f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}", + f"-DPYTHON_EXECUTABLE={sys.executable}", f"-DCMAKE_BUILD_TYPE={cfg}", "-DCMAKE_BUILD_TYPE=Release", '-DCMAKE_INSTALL_RPATH=$ORIGIN', From c507c98b162d1b21c1f3f60421bee3374b301bb1 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 13:56:40 -0400 Subject: [PATCH 33/57] ci: add ci rules --- .github/workflows/publish-to-test-pypi.yml | 43 +++++++++++++++++++--- pyproject.toml | 18 +++++---- 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 733e9fa..0ba6a23 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,19 +1,50 @@ --- name: Publish OpenSTL -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: + branches: + - main + jobs: + build: + name: Build and Test on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.8' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install . + + - name: Run tests + run: | + python3 -m pip install numpy pytest + pytest build_wheels: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-13] + os: [ubuntu-latest, windows-latest, macos-13, macos-14] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - with: - python-version: '3.8' - name: Print the arch and system run: | python -c "import platform; print(f'System: {platform.system()}'); print(f'Architecture: {platform.architecture()[0]}')" @@ -45,7 +76,7 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ - tests: + tests_pypi_distrib: name: Test openstl testpypi distrib needs: - publish-to-testpypi @@ -68,7 +99,7 @@ jobs: publish-to-pypi: name: Publish Python 🐍 distribution 📦 to PyPI needs: - - tests + - tests_pypi_distrib runs-on: ubuntu-latest environment: name: pypi diff --git a/pyproject.toml b/pyproject.toml index 1b4bdf5..d4a2ca0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,13 +2,6 @@ requires = ["setuptools>=42", "wheel", "ninja", "cmake>=3.15.3"] build-backend = "setuptools.build_meta" -[tool.pytest.ini_options] -minversion = "6.0" -addopts = "-ra -q" -testpaths = [ - "tests/python", -] - [tool.mypy] files = "setup.py" python_version = "3.7" @@ -21,7 +14,16 @@ warn_unreachable = true module = ["ninja"] ignore_missing_imports = true -[tool] +[tool.pytest.ini_options] +minversion = "6.0" +addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] +xfail_strict = true +filterwarnings = [ + "error", + "ignore:(ast.Str|Attribute s|ast.NameConstant|ast.Num) is deprecated:DeprecationWarning:_pytest", +] +testpaths = ["tests/python"] + [tool.commitizen] name = "cz_conventional_commits" version = "1.1.1" From 221f3dc5581fb55e4fc57e52ae3285d9d846fb3c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 14:06:14 -0400 Subject: [PATCH 34/57] ci: skip tests for pp*-win_amd64 --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index d4a2ca0..32609c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,8 @@ test-extras = ["test"] test-skip = ["*universal2:arm64"] # Setuptools bug causes collision between pypy and cpython artifacts before-build = "rm -rf {project}/build" +# Will avoid testing on emulated architectures +test-skip = "pp*-win_amd64" [tool.poetry.dependencies] pybind11 = "v2.11.1" From fcb531d5b03d2defdfdcca13bda92ada579a5bd3 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 14:08:06 -0400 Subject: [PATCH 35/57] ci: skip tests for pp*-win_amd64 --- pyproject.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 32609c8..6ba69bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,11 +32,9 @@ tag_format = "v$version" [tool.cibuildwheel] test-command = "pytest {project}/tests" test-extras = ["test"] -test-skip = ["*universal2:arm64"] +test-skip = ["*universal2:arm64", "pp*-win_amd64"] # Setuptools bug causes collision between pypy and cpython artifacts before-build = "rm -rf {project}/build" -# Will avoid testing on emulated architectures -test-skip = "pp*-win_amd64" [tool.poetry.dependencies] pybind11 = "v2.11.1" From ee60e9381295fb55f989e37ea252bbe722ea822f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 14:09:54 -0400 Subject: [PATCH 36/57] ci: temp remore push rule --- .github/workflows/publish-to-test-pypi.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 0ba6a23..16a00e9 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -35,7 +35,6 @@ jobs: python3 -m pip install numpy pytest pytest build_wheels: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: From 86b4de74d9053c4b6572fe764225ae6dc7dc27a8 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 14:14:45 -0400 Subject: [PATCH 37/57] ci: silence cibuildwheel warning as documented here https://github.com/pypa/cibuildwheel/pull/1169 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6ba69bc..0e0b307 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ tag_format = "v$version" [tool.cibuildwheel] test-command = "pytest {project}/tests" test-extras = ["test"] -test-skip = ["*universal2:arm64", "pp*-win_amd64"] +test-skip = ["*universal2:arm64", "pp*-win_amd64", "cp38-macosx_*:arm64"] # Setuptools bug causes collision between pypy and cpython artifacts before-build = "rm -rf {project}/build" From 8a5d834fefd682ceb2d2e778fb35778cfc77ff08 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 14:18:47 -0400 Subject: [PATCH 38/57] ci: skip tetst for pp{36,37}-manylinux* Numpy issues : ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__ RandomState = Sequence = __builtins__ = __file__ = '/tmp/tmp.OlUtV1nm1u/venv/site-packages/numpy/random/mtrand.pypy37-pp73-x86_64-linux-gnu.so' __name__ = 'numpy.random.mtrand' np = operator = warnings = =========================== short test summary info ============================ ERROR ../../../project/tests/python/test_stl.py - ImportWarning: can't resolv... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.70s =============================== --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0e0b307..261f026 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ tag_format = "v$version" [tool.cibuildwheel] test-command = "pytest {project}/tests" test-extras = ["test"] -test-skip = ["*universal2:arm64", "pp*-win_amd64", "cp38-macosx_*:arm64"] +test-skip = ["*universal2:arm64", "pp{36,37}-win_amd64", "pp{36,37}-manylinux*", "cp38-macosx_*:arm64"] # Setuptools bug causes collision between pypy and cpython artifacts before-build = "rm -rf {project}/build" From a9555edf29bea04dd399ccf93da786049bb4cd49 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 14:23:32 -0400 Subject: [PATCH 39/57] ci: skip tetst for pp*-manylinux* Numpy issues : ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__ RandomState = Sequence = __builtins__ = __file__ = '/tmp/tmp.OlUtV1nm1u/venv/site-packages/numpy/random/mtrand.pypy37-pp73-x86_64-linux-gnu.so' __name__ = 'numpy.random.mtrand' np = operator = warnings = =========================== short test summary info ============================ ERROR ../../../project/tests/python/test_stl.py - ImportWarning: can't resolv... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.70s =============================== --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 261f026..304a685 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ tag_format = "v$version" [tool.cibuildwheel] test-command = "pytest {project}/tests" test-extras = ["test"] -test-skip = ["*universal2:arm64", "pp{36,37}-win_amd64", "pp{36,37}-manylinux*", "cp38-macosx_*:arm64"] +test-skip = ["*universal2:arm64", "pp*-win_amd64", "pp*-manylinux*", "cp38-macosx_*:arm64"] # Setuptools bug causes collision between pypy and cpython artifacts before-build = "rm -rf {project}/build" From 011d5f0c39293998f82a70d470d1bc58e4d70791 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 14:29:36 -0400 Subject: [PATCH 40/57] ci: skip tetst for pp* Numpy issues : ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__ RandomState = Sequence = __builtins__ = __file__ = '/tmp/tmp.OlUtV1nm1u/venv/site-packages/numpy/random/mtrand.pypy37-pp73-x86_64-linux-gnu.so' __name__ = 'numpy.random.mtrand' np = operator = warnings = =========================== short test summary info ============================ ERROR ../../../project/tests/python/test_stl.py - ImportWarning: can't resolv... !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.70s =============================== --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 304a685..6bce8a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ tag_format = "v$version" [tool.cibuildwheel] test-command = "pytest {project}/tests" test-extras = ["test"] -test-skip = ["*universal2:arm64", "pp*-win_amd64", "pp*-manylinux*", "cp38-macosx_*:arm64"] +test-skip = ["*universal2:arm64", "pp*"] # Setuptools bug causes collision between pypy and cpython artifacts before-build = "rm -rf {project}/build" From 47bb4952dced09542d367bb7652f0fb3dc75abb2 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 14:59:23 -0400 Subject: [PATCH 41/57] ci: skip tests for musllinux and sme architecture --- .github/workflows/publish-to-test-pypi.yml | 5 +++-- pyproject.toml | 2 +- setup.py | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 16a00e9..8bc8a9f 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -10,6 +10,7 @@ on: jobs: build: + if: github.event_name == 'pull_request' && github.ref == 'refs/heads/main' name: Build and Test on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: @@ -83,11 +84,11 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-13, macos-14] - python-version: ["pypy3.7", "pypy3.8", "pypy3.9", "pypy3.10", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Test the python package diff --git a/pyproject.toml b/pyproject.toml index 6bce8a2..3d0c9b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ tag_format = "v$version" [tool.cibuildwheel] test-command = "pytest {project}/tests" test-extras = ["test"] -test-skip = ["*universal2:arm64", "pp*"] +test-skip = ["*universal2:arm64", "pp*", "cp{38,39,310,311,312}-manylinux_i686", "*musllinux*", "*ppc64le", "*s390x"] # Setuptools bug causes collision between pypy and cpython artifacts before-build = "rm -rf {project}/build" diff --git a/setup.py b/setup.py index e76d8b3..687e6b4 100644 --- a/setup.py +++ b/setup.py @@ -159,6 +159,10 @@ def build_extension(self, ext: CMakeExtension) -> None: "Topic :: Scientific/Engineering :: Visualization", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", From 8055a3f898e64251f6902edf2e1e0549ebecaac0 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 15:02:58 -0400 Subject: [PATCH 42/57] ci: remove cibuildwheel warning as issued here: https://github.com/pypa/cibuildwheel/pull/1169 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3d0c9b3..7c43e21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ tag_format = "v$version" [tool.cibuildwheel] test-command = "pytest {project}/tests" test-extras = ["test"] -test-skip = ["*universal2:arm64", "pp*", "cp{38,39,310,311,312}-manylinux_i686", "*musllinux*", "*ppc64le", "*s390x"] +test-skip = ["*universal2:arm64", "pp*", "cp{38,39,310,311,312}-manylinux_i686", "cp38-macosx_*:arm64", "*musllinux*", "*ppc64le", "*s390x"] # Setuptools bug causes collision between pypy and cpython artifacts before-build = "rm -rf {project}/build" From 77956d056246f9a8d4ff2e8eebdcab2ed7b37fce Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 15:21:41 -0400 Subject: [PATCH 43/57] ci: fix artifacts download --- .github/workflows/publish-to-test-pypi.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 8bc8a9f..7e72d97 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-13, macos-14] + os: [macos-14] steps: - name: Checkout code @@ -49,7 +49,7 @@ jobs: run: | python -c "import platform; print(f'System: {platform.system()}'); print(f'Architecture: {platform.architecture()[0]}')" - name: Install cibuildwheel - run: python -m pip install -U cibuildwheel + run: python -m pip install cibuildwheel==2.18.1 - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v4 @@ -68,9 +68,8 @@ jobs: id-token: write steps: - name: Download all the dists - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: python-package-distributions path: ./wheelhouse/ - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 @@ -108,9 +107,8 @@ jobs: id-token: write steps: - name: Download all the dists - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: python-package-distributions path: ./wheelhouse/ - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 @@ -125,9 +123,8 @@ jobs: id-token: write steps: - name: Download all the dists - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: python-package-distributions path: ./wheelhouse/ - name: Sign the dists with Sigstore uses: sigstore/gh-action-sigstore-python@v1.2.3 From b817835c4707303f7ac3f32d64bbb0df42fb9971 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 15:23:20 -0400 Subject: [PATCH 44/57] ci: fix artifacts download --- .github/workflows/publish-to-test-pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 7e72d97..c0db474 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-14] + os: [ubuntu-latest, windows-latest, macos-13, macos-14] steps: - name: Checkout code @@ -40,7 +40,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-13, macos-14] + os: [macos-14] steps: - uses: actions/checkout@v4 From f3bc34abee1ebd949a2dceb9fc939664f4fdba15 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 15:35:30 -0400 Subject: [PATCH 45/57] ci: fix artifacts download --- .github/workflows/publish-to-test-pypi.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index c0db474..0320138 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -51,11 +51,11 @@ jobs: - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.18.1 - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse + run: python -m cibuildwheel --output-dir dist - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl + path: dist/*.whl publish-to-testpypi: name: Publish Python 🐍 distribution 📦 to TestPyPI needs: @@ -70,7 +70,7 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - path: ./wheelhouse/ + path: dist/ - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: @@ -109,7 +109,7 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - path: ./wheelhouse/ + path: dist/ - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 github-release: @@ -125,11 +125,11 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - path: ./wheelhouse/ + path: dist/ - name: Sign the dists with Sigstore uses: sigstore/gh-action-sigstore-python@v1.2.3 with: - inputs: ./wheelhouse/*.tar.gz ./wheelhouse/*.whl + inputs: ./dist/*.tar.gz ./dist/*.whl - name: Create GitHub Release env: GITHUB_TOKEN: ${{ github.token }} @@ -138,5 +138,5 @@ jobs: - name: Upload artifact signatures to GitHub Release env: GITHUB_TOKEN: ${{ github.token }} - run: gh release upload '${{ github.ref_name }}' ./wheelhouse/** --repo '${{ + run: gh release upload '${{ github.ref_name }}' dist/** --repo '${{ github.repository }}' \ No newline at end of file From b4dcb3dda81a70e9bb55701ea6d9862ff4154676 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 15:45:52 -0400 Subject: [PATCH 46/57] ci: fix download artifacts --- .github/workflows/publish-to-test-pypi.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 0320138..c2adb0b 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -41,7 +41,6 @@ jobs: strategy: matrix: os: [macos-14] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -51,11 +50,11 @@ jobs: - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.18.1 - name: Build wheels - run: python -m cibuildwheel --output-dir dist + run: python -m cibuildwheel --output-dir wheelhouse - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: dist/*.whl + path: ./wheelhouse/*.whl publish-to-testpypi: name: Publish Python 🐍 distribution 📦 to TestPyPI needs: @@ -70,7 +69,9 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - path: dist/ + pattern: cibw-* + path: dist + merge-multiple: true - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: @@ -109,7 +110,9 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - path: dist/ + pattern: cibw-* + path: dist + merge-multiple: true - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 github-release: @@ -125,7 +128,9 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - path: dist/ + pattern: cibw-* + path: dist + merge-multiple: true - name: Sign the dists with Sigstore uses: sigstore/gh-action-sigstore-python@v1.2.3 with: From f824915e34e922b95a2495f9a6221537c8dc0e2d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 15:53:08 -0400 Subject: [PATCH 47/57] ci: fix download artifacts --- .github/workflows/publish-to-test-pypi.yml | 48 ++++++++++++---------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index c2adb0b..08d0617 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -35,8 +35,31 @@ jobs: run: | python3 -m pip install numpy pytest pytest + + bump_version_and_tag: + name: Bump version and tag on main + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + - name: Install Commitizen + run: pip install commitizen + - name: Bump version and create tag + run: cz bump --yes + - name: Push changes and tags + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git push origin main + git push origin --tags + build_wheels: name: Build wheels on ${{ matrix.os }} + needs: + - bump_version_and_tag runs-on: ${{ matrix.os }} strategy: matrix: @@ -55,6 +78,7 @@ jobs: with: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl + publish-to-testpypi: name: Publish Python 🐍 distribution 📦 to TestPyPI needs: @@ -76,30 +100,11 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ - tests_pypi_distrib: - name: Test openstl testpypi distrib - needs: - - publish-to-testpypi - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-13, macos-14] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Test the python package - run: | - python3 -m pip install --index-url https://test.pypi.org/simple/ openstl - python3 -m pip install numpy pytest - pytest ./tests/python + publish-to-pypi: name: Publish Python 🐍 distribution 📦 to PyPI needs: - - tests_pypi_distrib + - publish-to-testpypi runs-on: ubuntu-latest environment: name: pypi @@ -115,6 +120,7 @@ jobs: merge-multiple: true - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 + github-release: name: Sign the Python 🐍 distribution 📦 with Sigstore and upload them to GitHub Release From 2eb36b9b0012a8c7cdfeafc2f97b73779466512f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 16:06:05 -0400 Subject: [PATCH 48/57] ci: fix cz bump --- .github/workflows/publish-to-test-pypi.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 08d0617..3b5d9f6 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -41,20 +41,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 with: - python-version: 3.8 - - name: Install Commitizen - run: pip install commitizen - - name: Bump version and create tag - run: cz bump --yes - - name: Push changes and tags - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git push origin main - git push origin --tags + fetch-depth: 0 + token: "${{ secrets.GITHUB_TOKEN }}" + - id: cz + name: Create bump and changelog + uses: commitizen-tools/commitizen-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Print Version + run: echo "Bumped to version ${{ steps.cz.outputs.version }}" build_wheels: name: Build wheels on ${{ matrix.os }} From 462009fc57b8c69b0c1974bd0c587231b6a723b0 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 16:15:59 -0400 Subject: [PATCH 49/57] ci: fix cz bump --- .github/workflows/publish-to-test-pypi.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 3b5d9f6..a5af751 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -37,6 +37,7 @@ jobs: pytest bump_version_and_tag: + if: "!startsWith(github.event.head_commit.message, 'bump:')" name: Bump version and tag on main runs-on: ubuntu-latest steps: @@ -53,13 +54,12 @@ jobs: run: echo "Bumped to version ${{ steps.cz.outputs.version }}" build_wheels: + if: "startsWith(github.event.head_commit.message, 'bump:')" name: Build wheels on ${{ matrix.os }} - needs: - - bump_version_and_tag runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-14] + os: [ macos-14] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From 10a0197f2a63d5da1db55e8614cc99caf62dca46 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 16:18:30 -0400 Subject: [PATCH 50/57] ci: fix cz bump --- .github/workflows/publish-to-test-pypi.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index a5af751..999bd1a 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - 'v*' pull_request: branches: - main @@ -59,7 +61,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-14] + os: [macos-14] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From b057b07e1519d695a44920a24c3740c9bccca12b Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 16:27:38 -0400 Subject: [PATCH 51/57] ci: fix cz bump --- .github/workflows/publish-to-test-pypi.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 999bd1a..944d964 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -42,18 +42,21 @@ jobs: if: "!startsWith(github.event.head_commit.message, 'bump:')" name: Bump version and tag on main runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + steps: + - name: Check out + uses: actions/checkout@v4 with: fetch-depth: 0 token: "${{ secrets.GITHUB_TOKEN }}" - - id: cz - name: Create bump and changelog + - name: Create bump and changelog uses: commitizen-tools/commitizen-action@master with: - github_token: ${{ secrets.GITHUB_TOKEN }} + push: false - name: Print Version run: echo "Bumped to version ${{ steps.cz.outputs.version }}" + - name: Push using ssh + run: | + git push origin main --tags build_wheels: if: "startsWith(github.event.head_commit.message, 'bump:')" From 82e8c5bb1261e4f2abd136c791b3ba651b3bce33 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 16:28:29 -0400 Subject: [PATCH 52/57] ci: fix cz bump --- .github/workflows/publish-to-test-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 944d964..eb70e37 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -42,7 +42,7 @@ jobs: if: "!startsWith(github.event.head_commit.message, 'bump:')" name: Bump version and tag on main runs-on: ubuntu-latest - steps: + steps: - name: Check out uses: actions/checkout@v4 with: From 2f750090774c683cde91658f0046a08b8106f922 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 16:30:23 -0400 Subject: [PATCH 53/57] ci: fix cz bump --- .github/workflows/publish-to-test-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index eb70e37..22f78de 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -56,7 +56,7 @@ jobs: run: echo "Bumped to version ${{ steps.cz.outputs.version }}" - name: Push using ssh run: | - git push origin main --tags + git push --tags build_wheels: if: "startsWith(github.event.head_commit.message, 'bump:')" From 8ab8d192b4f88125705438a4944ac7ca8df59b2d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 16:31:58 -0400 Subject: [PATCH 54/57] ci: fix cz bump --- .github/workflows/publish-to-test-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 22f78de..d738e14 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - token: "${{ secrets.GITHUB_TOKEN }}" + ssh-key: "${{ secrets.COMMIT_KEY }}" - name: Create bump and changelog uses: commitizen-tools/commitizen-action@master with: From 0d23d8e598675265e2a2fd80736e48609781b2f9 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 16:34:59 -0400 Subject: [PATCH 55/57] ci: fix cz bump --- .github/workflows/publish-to-test-pypi.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index d738e14..fed1231 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -40,6 +40,7 @@ jobs: bump_version_and_tag: if: "!startsWith(github.event.head_commit.message, 'bump:')" + #if: "github.event_name == 'push' && github.ref == 'refs/heads/main' && !startsWith(github.event.head_commit.message, 'bump:')" name: Bump version and tag on main runs-on: ubuntu-latest steps: @@ -47,7 +48,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ssh-key: "${{ secrets.COMMIT_KEY }}" + token: "${{ secrets.GITHUB_TOKEN }}" - name: Create bump and changelog uses: commitizen-tools/commitizen-action@master with: @@ -55,7 +56,10 @@ jobs: - name: Print Version run: echo "Bumped to version ${{ steps.cz.outputs.version }}" - name: Push using ssh + #if: github.event_name == 'push' run: | + git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" + git config --global user.email "ruelj2@users.noreply.github.com" git push --tags build_wheels: @@ -65,6 +69,7 @@ jobs: strategy: matrix: os: [macos-14] + #os: [ubuntu-latest, windows-latest, macos-13, macos-14] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From b2498d8d9185afbe5276f0ac1c9135d67c92b0ee Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 16:49:53 -0400 Subject: [PATCH 56/57] ci: fix cz bump --- .github/workflows/publish-to-test-pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index fed1231..4df5df8 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -45,10 +45,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out - uses: actions/checkout@v4 + uses: actions/checkout@v3 with: fetch-depth: 0 - token: "${{ secrets.GITHUB_TOKEN }}" + ssh-key: "${{ secrets.COMMIT_KEY }}" - name: Create bump and changelog uses: commitizen-tools/commitizen-action@master with: From 754a71700368b484158c0b2f60007383f443de84 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Ruel Date: Tue, 28 May 2024 17:01:03 -0400 Subject: [PATCH 57/57] fix: release next ci --- .github/workflows/publish-to-test-pypi.yml | 11 +++++------ pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 4df5df8..9fdadee 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -12,7 +12,7 @@ on: jobs: build: - if: github.event_name == 'pull_request' && github.ref == 'refs/heads/main' + if: "github.event_name == 'pull_request'" name: Build and Test on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: @@ -39,8 +39,7 @@ jobs: pytest bump_version_and_tag: - if: "!startsWith(github.event.head_commit.message, 'bump:')" - #if: "github.event_name == 'push' && github.ref == 'refs/heads/main' && !startsWith(github.event.head_commit.message, 'bump:')" + if: "github.event_name == 'push' && github.ref == 'refs/heads/main' && !startsWith(github.event.head_commit.message, 'bump:')" name: Bump version and tag on main runs-on: ubuntu-latest steps: @@ -56,11 +55,12 @@ jobs: - name: Print Version run: echo "Bumped to version ${{ steps.cz.outputs.version }}" - name: Push using ssh - #if: github.event_name == 'push' + if: github.event_name == 'push' run: | git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" git config --global user.email "ruelj2@users.noreply.github.com" git push --tags + git push build_wheels: if: "startsWith(github.event.head_commit.message, 'bump:')" @@ -68,8 +68,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-14] - #os: [ubuntu-latest, windows-latest, macos-13, macos-14] + os: [ubuntu-latest, windows-latest, macos-13, macos-14] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 diff --git a/pyproject.toml b/pyproject.toml index 7c43e21..568977b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ tag_format = "v$version" [tool.cibuildwheel] test-command = "pytest {project}/tests" test-extras = ["test"] -test-skip = ["*universal2:arm64", "pp*", "cp{38,39,310,311,312}-manylinux_i686", "cp38-macosx_*:arm64", "*musllinux*", "*ppc64le", "*s390x"] +test-skip = ["*universal2:arm64", "pp*", "cp{38,39,310,311,312}-manylinux_i686", "cp38-macosx_arm64", "*musllinux*", "*ppc64le", "*s390x"] # Setuptools bug causes collision between pypy and cpython artifacts before-build = "rm -rf {project}/build"