Skip to content

Commit

Permalink
enable free-threaded build, simplify build, enable musllinux
Browse files Browse the repository at this point in the history
  • Loading branch information
schuhmaj committed Sep 9, 2024
1 parent 1fc7a0d commit 50d9f9b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 51 deletions.
92 changes: 42 additions & 50 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: Build wheels (Linux)
uses: pypa/[email protected]
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:
Expand All @@ -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/[email protected]
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/[email protected]
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: .
Expand All @@ -75,7 +66,8 @@ jobs:
- name: Build wheels (Windows)
uses: pypa/[email protected]
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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]",
description="Package to compute full gravity tensor of a given constant density polyhedron for arbitrary points "
Expand Down

0 comments on commit 50d9f9b

Please sign in to comment.