From 50d9f9b5ee9c2136e400809702e73b3be31ede91 Mon Sep 17 00:00:00 2001 From: Jonas Schuhmacher Date: Mon, 9 Sep 2024 11:20:41 +0200 Subject: [PATCH] enable free-threaded build, simplify build, enable musllinux --- .github/workflows/wheels.yml | 92 ++++++++++++++++-------------------- setup.py | 2 +- 2 files changed, 43 insertions(+), 51 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index db6b3f2..b2d2f97 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -33,8 +33,8 @@ jobs: - name: Build wheels (Linux) uses: pypa/cibuildwheel@v2.20.0 env: - CIBW_BEFORE_BUILD: yum makecache && yum install -y gcc-c++ cmake && pip install ninja - CIBW_BUILD: "*manylinux*" + CIBW_BEFORE_BUILD: pipx install ninja cmake + CIBW_FREE_THREADED_SUPPORT: 1 CIBW_ARCHS_LINUX: "x86_64 aarch64" CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"' with: @@ -46,22 +46,13 @@ jobs: # The GCC compiler installable via brew does not support cross-compiling for x86_64. Hence, also Apple Claang # For the x86_64, we set the MACOSX_DEPLOYMENT_TARGET='10.13' (released 2017) in order to have support for C++17 # We don't need this for the arm64 stuff since it works (and macOS on arm64 cam after C++17) - - name: Build wheels (macOS ARM) - uses: pypa/cibuildwheel@v2.20.0 - env: - CIBW_BEFORE_BUILD: brew install ninja - CIBW_ARCHS_MACOS: "arm64" - CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"' - with: - package-dir: . - output-dir: dist - if: matrix.os == 'macos-latest' - name: Build wheels (macOS x86_64) uses: pypa/cibuildwheel@v2.20.0 env: - CIBW_BEFORE_BUILD: brew install ninja + CIBW_BEFORE_BUILD: pipx install ninja cmake + CIBW_FREE_THREADED_SUPPORT: 1 CIBW_ENVIRONMENT: 'MACOSX_DEPLOYMENT_TARGET="10.13"' - CIBW_ARCHS_MACOS: "x86_64" + CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"' with: package-dir: . @@ -75,7 +66,8 @@ jobs: - name: Build wheels (Windows) uses: pypa/cibuildwheel@v2.20.0 env: - CIBW_BEFORE_BUILD: choco install -y ninja cmake + CIBW_BEFORE_BUILD: pipx install ninja cmake + CIBW_FREE_THREADED_SUPPORT: 1 CIBW_ARCHS_WINDOWS: "auto64" CIBW_TEST_COMMAND: 'python -c "import polyhedral_gravity"' with: @@ -98,38 +90,38 @@ jobs: with: path: dist/*.tar.gz - # 2. Upload the wheels and the source distribution to testpypi - # using trusted publishing - upload_testpypi: - needs: [build_wheels, make_sdist] - environment: - name: testpypi - url: https://test.pypi.org/p/polyhedral-gravity - permissions: - id-token: write - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v3 - with: - name: artifact - path: dist - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - - # 3. Upload the wheels to the actually Python Package Index - # using trusted publishing - upload_pypi: - needs: [build_wheels, make_sdist, upload_testpypi] - environment: - name: pypi - url: https://pypi.org/p/polyhedral-gravity - permissions: - id-token: write - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v3 - with: - name: artifact - path: dist - - uses: pypa/gh-action-pypi-publish@release/v1 +# # 2. Upload the wheels and the source distribution to testpypi +# # using trusted publishing +# upload_testpypi: +# needs: [build_wheels, make_sdist] +# environment: +# name: testpypi +# url: https://test.pypi.org/p/polyhedral-gravity +# permissions: +# id-token: write +# runs-on: ubuntu-latest +# steps: +# - uses: actions/download-artifact@v3 +# with: +# name: artifact +# path: dist +# - uses: pypa/gh-action-pypi-publish@release/v1 +# with: +# repository-url: https://test.pypi.org/legacy/ +# +# # 3. Upload the wheels to the actually Python Package Index +# # using trusted publishing +# upload_pypi: +# needs: [build_wheels, make_sdist, upload_testpypi] +# environment: +# name: pypi +# url: https://pypi.org/p/polyhedral-gravity +# permissions: +# id-token: write +# runs-on: ubuntu-latest +# steps: +# - uses: actions/download-artifact@v3 +# with: +# name: artifact +# path: dist +# - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/setup.py b/setup.py index a5139d2..cb6e05e 100644 --- a/setup.py +++ b/setup.py @@ -175,7 +175,7 @@ def build_extension(self, ext): # -------------------------------------------------------------------------------- setup( name="polyhedral_gravity", - version="3.2", + version="3.2.1rc1", author="Jonas Schuhmacher", author_email="jonas.schuhmacher@tum.de", description="Package to compute full gravity tensor of a given constant density polyhedron for arbitrary points "