From 1fe80e20e943e8a7b7dacd4c75a8d8c6079ebe64 Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sat, 15 Feb 2025 08:59:17 -0500 Subject: [PATCH 01/12] STUB --- .github/workflows/build-wheels.yml | 89 ++++++++++++++++++++++++++++++ setup.py | 5 ++ 2 files changed, 94 insertions(+) create mode 100644 .github/workflows/build-wheels.yml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 0000000..9418d48 --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -0,0 +1,89 @@ +name: Build Wheels + +on: + push: + branches: + - master + pull_request: + branches: + - master + release: + types: [created] + +jobs: + build-wheels: + name: Build Wheels on ${{ matrix.os }} - Python ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install system build dependencies (Linux & macOS) + run: | + if [[ "$RUNNER_OS" == "Linux" ]]; then + sudo apt update + sudo apt install -y build-essential wget tar cmake + elif [[ "$RUNNER_OS" == "macOS" ]]; then + brew install wget cmake + fi + + - name: Download and Compile ADMesh + env: + ADMESH_VERSION: "0.98.3" + run: | + wget https://github.com/admesh/admesh/releases/download/v$ADMESH_VERSION/admesh-$ADMESH_VERSION.tar.gz + tar -zxf admesh-$ADMESH_VERSION.tar.gz + cd admesh-$ADMESH_VERSION + ./configure + make + mkdir -p src/admesh + cp src/stl.h src/admesh/stl.h + cd .. + echo "ADMesh installed successfully!" + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + python -m pip install cibuildwheel pytest + + - name: Build wheels using cibuildwheel + run: | + python -m cibuildwheel --output-dir dist + + - name: Test built wheels + run: | + pip install --no-index --find-links=dist admesh + pytest -v test/ + + - name: Upload built wheels as artifact + uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.os }}-py${{ matrix.python-version }} + path: dist/ + + publish-pypi: + name: Publish to PyPI + needs: build-wheels + runs-on: ubuntu-latest + if: github.event_name == 'release' + + steps: + - name: Download built wheels + uses: actions/download-artifact@v4 + with: + path: dist + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/setup.py b/setup.py index 0f003dd..f06f433 100755 --- a/setup.py +++ b/setup.py @@ -41,6 +41,11 @@ def _autogen(*args, **kwargs): 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Multimedia :: Graphics :: 3D Modeling', ], ) From ce1486dfc3a18f608b35a0b385b59ac5b377f550 Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sat, 15 Feb 2025 09:02:01 -0500 Subject: [PATCH 02/12] STUB 2 --- .github/workflows/build-wheels.yml | 33 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 9418d48..04d9772 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -17,7 +17,8 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - python-version: ["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"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - name: Checkout repository @@ -39,7 +40,7 @@ jobs: - name: Download and Compile ADMesh env: - ADMESH_VERSION: "0.98.3" + ADMESH_VERSION: "0.98.5" run: | wget https://github.com/admesh/admesh/releases/download/v$ADMESH_VERSION/admesh-$ADMESH_VERSION.tar.gz tar -zxf admesh-$ADMESH_VERSION.tar.gz @@ -71,19 +72,19 @@ jobs: name: wheels-${{ matrix.os }}-py${{ matrix.python-version }} path: dist/ - publish-pypi: - name: Publish to PyPI - needs: build-wheels - runs-on: ubuntu-latest - if: github.event_name == 'release' + #publish-pypi: + # name: Publish to PyPI + # needs: build-wheels + # runs-on: ubuntu-latest + # if: github.event_name == 'release' - steps: - - name: Download built wheels - uses: actions/download-artifact@v4 - with: - path: dist + # steps: + # - name: Download built wheels + # uses: actions/download-artifact@v4 + # with: + # path: dist - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} + # - name: Publish to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # password: ${{ secrets.PYPI_API_TOKEN }} From 4cb8a78008ff989759da9b2c7aec6e6c72dfeef7 Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sat, 15 Feb 2025 10:05:48 -0500 Subject: [PATCH 03/12] STUB 3 --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 04d9772..5996638 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-13, macos-14] #python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] From 573fdde82dc03efb41dca48545b0db0984e9ecf4 Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sat, 15 Feb 2025 10:08:25 -0500 Subject: [PATCH 04/12] STUB 4 --- .github/workflows/build-wheels.yml | 45 +++++++++++------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 5996638..49e69cc 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -11,25 +11,19 @@ on: types: [created] jobs: - build-wheels: - name: Build Wheels on ${{ matrix.os }} - Python ${{ matrix.python-version }} + build_wheels: + name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-13, macos-14] - #python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + # macos-13 is Intel, macos-14 is Apple Silicon + os: [ubuntu-latest, windows-latest, macos-13, macos-14] steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install system build dependencies (Linux & macOS) + - name: Install system build dependencies run: | if [[ "$RUNNER_OS" == "Linux" ]]; then sudo apt update @@ -40,7 +34,7 @@ jobs: - name: Download and Compile ADMesh env: - ADMESH_VERSION: "0.98.5" + ADMESH_VERSION: "0.98.3" run: | wget https://github.com/admesh/admesh/releases/download/v$ADMESH_VERSION/admesh-$ADMESH_VERSION.tar.gz tar -zxf admesh-$ADMESH_VERSION.tar.gz @@ -52,29 +46,24 @@ jobs: cd .. echo "ADMesh installed successfully!" - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - python -m pip install cibuildwheel pytest - - name: Build wheels using cibuildwheel - run: | - python -m cibuildwheel --output-dir dist - - - name: Test built wheels - run: | - pip install --no-index --find-links=dist admesh - pytest -v test/ + uses: pypa/cibuildwheel@v2.22.0 + env: + #cibw_build: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" + cibw_build: "cp38-* cp39-* cp310-* cp311-* cp312-*" + CIBW_SKIP: "pp*" + CIBW_TEST_REQUIRES: "pytest" + CIBW_TEST_COMMAND: "pytest -v {project}/test" - name: Upload built wheels as artifact uses: actions/upload-artifact@v4 with: - name: wheels-${{ matrix.os }}-py${{ matrix.python-version }} - path: dist/ + name: cibw-wheels-${{ matrix.os }} + path: ./wheelhouse/*.whl - #publish-pypi: + #publish_pypi: # name: Publish to PyPI - # needs: build-wheels + # needs: build_wheels # runs-on: ubuntu-latest # if: github.event_name == 'release' From 1dc9bee4abe68e4e6198e8fae7f25563cb8462d2 Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sat, 15 Feb 2025 10:09:41 -0500 Subject: [PATCH 05/12] STUB 5 --- .github/workflows/build-wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 49e69cc..0dd7dba 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -17,7 +17,8 @@ jobs: strategy: matrix: # macos-13 is Intel, macos-14 is Apple Silicon - os: [ubuntu-latest, windows-latest, macos-13, macos-14] + #os: [ubuntu-latest, macos-13, macos-14] + os: [ubuntu-latest] steps: - name: Checkout repository From 154e499ce8a28cf178953f2d994382104aa71b2e Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sat, 15 Feb 2025 10:16:13 -0500 Subject: [PATCH 06/12] STUB 6 --- .github/workflows/build-wheels.yml | 50 +++++++++++------------------- 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 0dd7dba..caebdd1 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -16,8 +16,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - # macos-13 is Intel, macos-14 is Apple Silicon - #os: [ubuntu-latest, macos-13, macos-14] + #os: [ubuntu-latest, windows-latest, macos-13, macos-14] os: [ubuntu-latest] steps: @@ -33,26 +32,13 @@ jobs: brew install wget cmake fi - - name: Download and Compile ADMesh - env: - ADMESH_VERSION: "0.98.3" - run: | - wget https://github.com/admesh/admesh/releases/download/v$ADMESH_VERSION/admesh-$ADMESH_VERSION.tar.gz - tar -zxf admesh-$ADMESH_VERSION.tar.gz - cd admesh-$ADMESH_VERSION - ./configure - make - mkdir -p src/admesh - cp src/stl.h src/admesh/stl.h - cd .. - echo "ADMesh installed successfully!" - - name: Build wheels using cibuildwheel uses: pypa/cibuildwheel@v2.22.0 env: - #cibw_build: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" - cibw_build: "cp38-* cp39-* cp310-* cp311-* cp312-*" + CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" CIBW_SKIP: "pp*" + CIBW_BEFORE_BUILD_LINUX: | + sudo apt update && sudo apt install -y libadmesh-dev CIBW_TEST_REQUIRES: "pytest" CIBW_TEST_COMMAND: "pytest -v {project}/test" @@ -62,19 +48,19 @@ jobs: name: cibw-wheels-${{ matrix.os }} path: ./wheelhouse/*.whl - #publish_pypi: - # name: Publish to PyPI - # needs: build_wheels - # runs-on: ubuntu-latest - # if: github.event_name == 'release' + publish_pypi: + name: Publish to PyPI + needs: build_wheels + runs-on: ubuntu-latest + if: github.event_name == 'release' - # steps: - # - name: Download built wheels - # uses: actions/download-artifact@v4 - # with: - # path: dist + steps: + - name: Download built wheels + uses: actions/download-artifact@v4 + with: + path: dist - # - name: Publish to PyPI - # uses: pypa/gh-action-pypi-publish@release/v1 - # with: - # password: ${{ secrets.PYPI_API_TOKEN }} + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} From 43b5a542b06ae072d152cccff845a8b7db22aaf8 Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sat, 15 Feb 2025 10:20:10 -0500 Subject: [PATCH 07/12] STUB 7 --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index caebdd1..0af3e7c 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -38,7 +38,7 @@ jobs: CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" CIBW_SKIP: "pp*" CIBW_BEFORE_BUILD_LINUX: | - sudo apt update && sudo apt install -y libadmesh-dev + apt update && apt install -y libadmesh-dev CIBW_TEST_REQUIRES: "pytest" CIBW_TEST_COMMAND: "pytest -v {project}/test" From d5e721e77bbcd7c1a03e233fc8b9f12e74f873af Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sat, 15 Feb 2025 10:27:28 -0500 Subject: [PATCH 08/12] STUB 8 --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 0af3e7c..4f752eb 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -38,7 +38,7 @@ jobs: CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" CIBW_SKIP: "pp*" CIBW_BEFORE_BUILD_LINUX: | - apt update && apt install -y libadmesh-dev + rpm -q admesh-devel || yum install -y --nogpgcheck /project/travis/*.x86_64.rpm; {pip} install Cython CIBW_TEST_REQUIRES: "pytest" CIBW_TEST_COMMAND: "pytest -v {project}/test" From 30121b4a87baef4832f007035659ac1d01d44973 Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sun, 16 Feb 2025 10:07:25 -0500 Subject: [PATCH 09/12] STUB 9 --- .github/workflows/build-wheels.yml | 34 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 4f752eb..e6cd2a8 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -35,10 +35,10 @@ jobs: - name: Build wheels using cibuildwheel uses: pypa/cibuildwheel@v2.22.0 env: - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" - CIBW_SKIP: "pp*" + #CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" + CIBW_BUILD: "cp38-*_x86_64 cp39-*_x86_64 cp310-*_x86_64 cp311-*_x86_64 cp312-*_x86_64" CIBW_BEFORE_BUILD_LINUX: | - rpm -q admesh-devel || yum install -y --nogpgcheck /project/travis/*.x86_64.rpm; {pip} install Cython + rpm -q admesh-devel || yum install -y --nogpgcheck /project/travis/*.x86_64.rpm; pip install Cython CIBW_TEST_REQUIRES: "pytest" CIBW_TEST_COMMAND: "pytest -v {project}/test" @@ -48,19 +48,19 @@ jobs: name: cibw-wheels-${{ matrix.os }} path: ./wheelhouse/*.whl - publish_pypi: - name: Publish to PyPI - needs: build_wheels - runs-on: ubuntu-latest - if: github.event_name == 'release' + #publish_pypi: + # name: Publish to PyPI + # needs: build_wheels + # runs-on: ubuntu-latest + # if: github.event_name == 'release' - steps: - - name: Download built wheels - uses: actions/download-artifact@v4 - with: - path: dist + # steps: + # - name: Download built wheels + # uses: actions/download-artifact@v4 + # with: + # path: dist - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} + # - name: Publish to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # password: ${{ secrets.PYPI_API_TOKEN }} From c9209d802bb24ae9f21ca9072afbdf9a5984700d Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sun, 16 Feb 2025 10:17:31 -0500 Subject: [PATCH 10/12] STUB 10 --- .github/workflows/build-wheels.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index e6cd2a8..d70d2df 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -11,6 +11,8 @@ on: types: [created] jobs: + # TODO: Test before wheel building + build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -32,11 +34,13 @@ jobs: brew install wget cmake fi + # TODO: Musl? Does the original project use musllinux? No its just manylinux - name: Build wheels using cibuildwheel uses: pypa/cibuildwheel@v2.22.0 env: #CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" - CIBW_BUILD: "cp38-*_x86_64 cp39-*_x86_64 cp310-*_x86_64 cp311-*_x86_64 cp312-*_x86_64" + #CIBW_BUILD: "cp38-*_x86_64 cp39-*_x86_64 cp310-*_x86_64 cp311-*_x86_64 cp312-*_x86_64" + CIBW_BUILD: "*p3*-*_x86_64 *p39-*_x86_64 *p310-*_x86_64 *p311-*_x86_64 *p312-*_x86_64" CIBW_BEFORE_BUILD_LINUX: | rpm -q admesh-devel || yum install -y --nogpgcheck /project/travis/*.x86_64.rpm; pip install Cython CIBW_TEST_REQUIRES: "pytest" From b1893f0d7b4046f801f73dfa5de870d40c9d08e0 Mon Sep 17 00:00:00 2001 From: rknizzle Date: Sun, 16 Feb 2025 16:14:28 -0500 Subject: [PATCH 11/12] STUB 11 --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index d70d2df..af68568 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -40,7 +40,7 @@ jobs: env: #CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" #CIBW_BUILD: "cp38-*_x86_64 cp39-*_x86_64 cp310-*_x86_64 cp311-*_x86_64 cp312-*_x86_64" - CIBW_BUILD: "*p3*-*_x86_64 *p39-*_x86_64 *p310-*_x86_64 *p311-*_x86_64 *p312-*_x86_64" + CIBW_BUILD: "*p3*-manylinux_x86_64" CIBW_BEFORE_BUILD_LINUX: | rpm -q admesh-devel || yum install -y --nogpgcheck /project/travis/*.x86_64.rpm; pip install Cython CIBW_TEST_REQUIRES: "pytest" From 0a744f131b9b72c829fed7754256ecb2e9f67e2b Mon Sep 17 00:00:00 2001 From: rknizzle Date: Mon, 17 Feb 2025 15:53:35 -0500 Subject: [PATCH 12/12] STUB 12 --- .github/workflows/build-wheels.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index af68568..523dc81 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -12,13 +12,37 @@ on: jobs: # TODO: Test before wheel building + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install admesh + # TODO: Do I need to install wget? + run: | + if [ ! -f admesh-$ADMESH/.libs/admesh ]; then + wget https://github.com/admesh/admesh/releases/download/v$ADMESH/admesh-$ADMESH.tar.gz; + tar -zxf admesh-$ADMESH.tar.gz; + cd admesh-$ADMESH; + "./configure"; + make; + mkdir src/admesh; + cp src/stl.h src/admesh/stl.h; + cd ..; + fi + + python -m pip install tox Cython + LD_LIBRARY_PATH=$PWD/admesh-$ADMESH/.libs LDFLAGS=-L$PWD/admesh-$ADMESH/.libs CFLAGS=-I$PWD/admesh-$ADMESH/src tox build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - #os: [ubuntu-latest, windows-latest, macos-13, macos-14] os: [ubuntu-latest] steps: @@ -34,12 +58,10 @@ jobs: brew install wget cmake fi - # TODO: Musl? Does the original project use musllinux? No its just manylinux - name: Build wheels using cibuildwheel uses: pypa/cibuildwheel@v2.22.0 env: - #CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" - #CIBW_BUILD: "cp38-*_x86_64 cp39-*_x86_64 cp310-*_x86_64 cp311-*_x86_64 cp312-*_x86_64" + # Build CPython and PyPy wheels for x86_64 linux CIBW_BUILD: "*p3*-manylinux_x86_64" CIBW_BEFORE_BUILD_LINUX: | rpm -q admesh-devel || yum install -y --nogpgcheck /project/travis/*.x86_64.rpm; pip install Cython