From 98b87270a71bfed7ebf1d0a248afba662f974a55 Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Thu, 23 Mar 2023 08:57:45 -0500 Subject: [PATCH 01/10] Bump version for testpypi --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5cc1519..38c094c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ requires = [ name = "suitesparse-graphblas" #dynamic = ["version"] # TODO -version = "0.0.3" +version = "0.0.4" description = "SuiteSparse:GraphBLAS Python bindings." readme = "README.md" requires-python = ">=3.8" @@ -29,7 +29,7 @@ maintainers = [ {name = "Michel Pelletier", email = "michel@graphegon.com"}, ] classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", From 89c422fc413e5e083f677b300bac8063b75d9f0d Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Thu, 23 Mar 2023 10:23:03 -0500 Subject: [PATCH 02/10] Update for linux images --- .github/workflows/wheels.yml | 16 ++++++++-------- pyproject.toml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7991df9..d802769 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -40,23 +40,23 @@ jobs: # Loosely based on scikit-learn's config: # https://github.com/scikit-learn/scikit-learn/blob/main/.github/workflows/wheels.yml include: - - os: windows-latest - python-version: "3.8" - platform_id: win_amd64 +# - os: windows-latest +# python-version: "3.8" +# platform_id: win_amd64 - os: ubuntu-latest python-version: "3.8" platform_id: manylinux_x86_64 - manylinux_image: manylinux2014 + manylinux_image: manylinux2014_x86_64 - os: ubuntu-latest python-version: "3.8" platform_id: manylinux_aarch64 - manylinux_image: manylinux2014 + manylinux_image: manylinux2014_aarch64 # Use x86 macOS runner to build both x86 and ARM. GitHub does not offer M1/M2 yet (only self-hosted). - - os: macos-latest - python-version: "3.8" - platform_id: macosx_x86_64 +# - os: macos-latest +# python-version: "3.8" +# platform_id: macosx_x86_64 steps: - uses: actions/checkout@v3 diff --git a/pyproject.toml b/pyproject.toml index 38c094c..6e861e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ requires = [ name = "suitesparse-graphblas" #dynamic = ["version"] # TODO -version = "0.0.4" +version = "0.0.4.1" description = "SuiteSparse:GraphBLAS Python bindings." readme = "README.md" requires-python = ">=3.8" From c4bf20d30a5a921273d5d533654927716e28512b Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Thu, 23 Mar 2023 13:40:57 -0500 Subject: [PATCH 03/10] Enable linux aarch64, disable osx-arm64 --- .github/workflows/wheels.yml | 5 ++++- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d802769..15fe47d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -98,8 +98,11 @@ jobs: # TODO CIBW_BUILD: "cp*" + # linux: build x86_64 and aarch64 + CIBW_ARCHS_LINUX: "x86_64 aarch64" + # macOS: build x86_64 and arm64 - CIBW_ARCHS_MACOS: "x86_64 arm64" + #CIBW_ARCHS_MACOS: "x86_64 arm64" # No 32-bit builds # TODO diff --git a/pyproject.toml b/pyproject.toml index 6e861e5..0630840 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ requires = [ name = "suitesparse-graphblas" #dynamic = ["version"] # TODO -version = "0.0.4.1" +version = "0.0.4.2" description = "SuiteSparse:GraphBLAS Python bindings." readme = "README.md" requires-python = ">=3.8" From f890700fe7a8d502c11ee486cc029c64122b6361 Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Thu, 23 Mar 2023 15:02:02 -0500 Subject: [PATCH 04/10] Bunch of changes from scikit-learn's file --- .github/workflows/wheels.yml | 71 ++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 20 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 15fe47d..e9062c4 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -32,7 +32,7 @@ jobs: build_wheels: - name: Wheels on ${{ matrix.platform_id }} - ${{ matrix.os }} + name: Wheels on cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -40,23 +40,50 @@ jobs: # Loosely based on scikit-learn's config: # https://github.com/scikit-learn/scikit-learn/blob/main/.github/workflows/wheels.yml include: -# - os: windows-latest -# python-version: "3.8" -# platform_id: win_amd64 - + - os: windows-latest + python: 38 + platform_id: win_amd64 + - os: windows-latest + python: 39 + platform_id: win_amd64 + - os: windows-latest + python: 310 + platform_id: win_amd64 + - os: windows-latest + python: 311 + platform_id: win_amd64 + + # Linux 64 bit manylinux2014 - os: ubuntu-latest - python-version: "3.8" + python: 38 platform_id: manylinux_x86_64 - manylinux_image: manylinux2014_x86_64 + manylinux_image: manylinux2014 - os: ubuntu-latest - python-version: "3.8" - platform_id: manylinux_aarch64 - manylinux_image: manylinux2014_aarch64 - - # Use x86 macOS runner to build both x86 and ARM. GitHub does not offer M1/M2 yet (only self-hosted). -# - os: macos-latest -# python-version: "3.8" -# platform_id: macosx_x86_64 + python: 39 + platform_id: manylinux_x86_64 + manylinux_image: manylinux2014 + - os: ubuntu-latest + python: 310 + platform_id: manylinux_x86_64 + manylinux_image: manylinux2014 + - os: ubuntu-latest + python: 311 + platform_id: manylinux_x86_64 + manylinux_image: manylinux2014 + + # MacOS x86_64 + - os: macos-latest + python: 38 + platform_id: macosx_x86_64 + - os: macos-latest + python: 39 + platform_id: macosx_x86_64 + - os: macos-latest + python: 310 + platform_id: macosx_x86_64 + - os: macos-latest + python: 311 + platform_id: macosx_x86_64 steps: - uses: actions/checkout@v3 @@ -65,7 +92,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: '3.9' - name: Install tools (macOS) if: contains(matrix.os, 'macos') @@ -80,8 +107,8 @@ jobs: - name: Build Wheels env: - # very verbose - CIBW_BUILD_VERBOSITY: 3 + # somewhat verbose + CIBW_BUILD_VERBOSITY: 2 # Build SuiteSparse # CIBW_BEFORE_ALL: bash suitesparse.sh ${{ github.ref }} @@ -96,10 +123,14 @@ jobs: # Uncomment to only build CPython wheels # TODO - CIBW_BUILD: "cp*" + CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} + + CIBW_ARCHS: all # linux: build x86_64 and aarch64 - CIBW_ARCHS_LINUX: "x86_64 aarch64" +# CIBW_ARCHS_LINUX: "x86_64 aarch64" + + CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} # macOS: build x86_64 and arm64 #CIBW_ARCHS_MACOS: "x86_64 arm64" From 200a443d8757dd8a02930ec0978c6b82227b0bd9 Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Thu, 23 Mar 2023 15:43:42 -0500 Subject: [PATCH 05/10] Undo last changes --- .github/workflows/wheels.yml | 54 ++++++------------------------------ pyproject.toml | 4 +-- 2 files changed, 10 insertions(+), 48 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e9062c4..22402a8 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -32,7 +32,7 @@ jobs: build_wheels: - name: Wheels on cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }} + name: Wheels on ${{ matrix.platform_id }} - ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -41,48 +41,19 @@ jobs: # https://github.com/scikit-learn/scikit-learn/blob/main/.github/workflows/wheels.yml include: - os: windows-latest - python: 38 - platform_id: win_amd64 - - os: windows-latest - python: 39 - platform_id: win_amd64 - - os: windows-latest - python: 310 - platform_id: win_amd64 - - os: windows-latest - python: 311 + python-version: "3.8" platform_id: win_amd64 # Linux 64 bit manylinux2014 - os: ubuntu-latest + python-version: "3.8" python: 38 platform_id: manylinux_x86_64 manylinux_image: manylinux2014 - - os: ubuntu-latest - python: 39 - platform_id: manylinux_x86_64 - manylinux_image: manylinux2014 - - os: ubuntu-latest - python: 310 - platform_id: manylinux_x86_64 - manylinux_image: manylinux2014 - - os: ubuntu-latest - python: 311 - platform_id: manylinux_x86_64 - manylinux_image: manylinux2014 - # MacOS x86_64 + # Use x86 macOS runner to build both x86 and ARM. GitHub does not offer M1/M2 yet (only self-hosted). - os: macos-latest - python: 38 - platform_id: macosx_x86_64 - - os: macos-latest - python: 39 - platform_id: macosx_x86_64 - - os: macos-latest - python: 310 - platform_id: macosx_x86_64 - - os: macos-latest - python: 311 + python-version: "3.8" platform_id: macosx_x86_64 steps: @@ -92,7 +63,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: ${{ matrix.python-version }} - name: Install tools (macOS) if: contains(matrix.os, 'macos') @@ -107,8 +78,8 @@ jobs: - name: Build Wheels env: - # somewhat verbose - CIBW_BUILD_VERBOSITY: 2 + # very verbose + CIBW_BUILD_VERBOSITY: 3 # Build SuiteSparse # CIBW_BEFORE_ALL: bash suitesparse.sh ${{ github.ref }} @@ -123,14 +94,7 @@ jobs: # Uncomment to only build CPython wheels # TODO - CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} - - CIBW_ARCHS: all - - # linux: build x86_64 and aarch64 -# CIBW_ARCHS_LINUX: "x86_64 aarch64" - - CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} + CIBW_BUILD: "cp*" # macOS: build x86_64 and arm64 #CIBW_ARCHS_MACOS: "x86_64 arm64" diff --git a/pyproject.toml b/pyproject.toml index 0630840..beccc7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,9 +11,7 @@ requires = [ [project] name = "suitesparse-graphblas" -#dynamic = ["version"] -# TODO -version = "0.0.4.2" +dynamic = ["version"] description = "SuiteSparse:GraphBLAS Python bindings." readme = "README.md" requires-python = ">=3.8" From ec69ef74157522b342f2d56f4e6faca1bcb521ae Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Fri, 24 Mar 2023 10:39:38 -0500 Subject: [PATCH 06/10] Try to see what is modifying repo --- .github/workflows/wheels.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 22402a8..2cfa36e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -40,21 +40,20 @@ jobs: # Loosely based on scikit-learn's config: # https://github.com/scikit-learn/scikit-learn/blob/main/.github/workflows/wheels.yml include: - - os: windows-latest - python-version: "3.8" - platform_id: win_amd64 +# - os: windows-latest +# python-version: "3.8" +# platform_id: win_amd64 # Linux 64 bit manylinux2014 - os: ubuntu-latest python-version: "3.8" - python: 38 platform_id: manylinux_x86_64 manylinux_image: manylinux2014 # Use x86 macOS runner to build both x86 and ARM. GitHub does not offer M1/M2 yet (only self-hosted). - - os: macos-latest - python-version: "3.8" - platform_id: macosx_x86_64 +# - os: macos-latest +# python-version: "3.8" +# platform_id: macosx_x86_64 steps: - uses: actions/checkout@v3 @@ -122,8 +121,11 @@ jobs: CIBW_TEST_SKIP: "*-macosx_arm64" run: | + git status python -m pip install cibuildwheel python -m cibuildwheel --output-dir wheelhouse . + git status + git diff . shell: bash - uses: actions/upload-artifact@v3 From 633c8f164fc6ac5dbdac10a34917864e39a69d78 Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Fri, 24 Mar 2023 12:05:14 -0500 Subject: [PATCH 07/10] Modify dirty string --- .github/workflows/wheels.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 2cfa36e..09c1021 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -40,9 +40,9 @@ jobs: # Loosely based on scikit-learn's config: # https://github.com/scikit-learn/scikit-learn/blob/main/.github/workflows/wheels.yml include: -# - os: windows-latest -# python-version: "3.8" -# platform_id: win_amd64 + - os: windows-latest + python-version: "3.8" + platform_id: win_amd64 # Linux 64 bit manylinux2014 - os: ubuntu-latest @@ -51,9 +51,9 @@ jobs: manylinux_image: manylinux2014 # Use x86 macOS runner to build both x86 and ARM. GitHub does not offer M1/M2 yet (only self-hosted). -# - os: macos-latest -# python-version: "3.8" -# platform_id: macosx_x86_64 + - os: macos-latest + python-version: "3.8" + platform_id: macosx_x86_64 steps: - uses: actions/checkout@v3 @@ -92,14 +92,12 @@ jobs: CIBW_ENVIRONMENT_MACOS: BREW_LIBOMP="1" # Uncomment to only build CPython wheels - # TODO CIBW_BUILD: "cp*" # macOS: build x86_64 and arm64 #CIBW_ARCHS_MACOS: "x86_64 arm64" # No 32-bit builds - # TODO CIBW_SKIP: "*-win32 *_i686 *musl*" # Use delvewheel on Windows. @@ -121,11 +119,9 @@ jobs: CIBW_TEST_SKIP: "*-macosx_arm64" run: | - git status + sed -i '' 's/{tag}+{ccount}.g{sha}.dirty/{tag}/g' pyproject.toml python -m pip install cibuildwheel python -m cibuildwheel --output-dir wheelhouse . - git status - git diff . shell: bash - uses: actions/upload-artifact@v3 From 8c3537a0d104a806cef57fe3a1142763d91d84b8 Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Fri, 24 Mar 2023 13:27:14 -0500 Subject: [PATCH 08/10] Try ignoring GraphBLAS-{version}/ checkout folder --- .github/workflows/wheels.yml | 1 - .gitignore | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 09c1021..96901e6 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -119,7 +119,6 @@ jobs: CIBW_TEST_SKIP: "*-macosx_arm64" run: | - sed -i '' 's/{tag}+{ccount}.g{sha}.dirty/{tag}/g' pyproject.toml python -m pip install cibuildwheel python -m cibuildwheel --output-dir wheelhouse . shell: bash diff --git a/.gitignore b/.gitignore index 609ca66..e382cda 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,9 @@ share/python-wheels/ MANIFEST wheelhouse +# Wheel building stuff +GraphBLAS-*/ + # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. From 8c1208fdd787e36e126826ed32a89746b6ceb435 Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Fri, 24 Mar 2023 14:20:44 -0500 Subject: [PATCH 09/10] Just keep swimming --- .github/workflows/wheels.yml | 2 +- add_arm_to_libomp_dylib.sh | 2 ++ suitesparse.sh | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 96901e6..a19d6dc 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -92,7 +92,7 @@ jobs: CIBW_ENVIRONMENT_MACOS: BREW_LIBOMP="1" # Uncomment to only build CPython wheels - CIBW_BUILD: "cp*" +# CIBW_BUILD: "cp*" # macOS: build x86_64 and arm64 #CIBW_ARCHS_MACOS: "x86_64 arm64" diff --git a/add_arm_to_libomp_dylib.sh b/add_arm_to_libomp_dylib.sh index 7394767..8492c7c 100755 --- a/add_arm_to_libomp_dylib.sh +++ b/add_arm_to_libomp_dylib.sh @@ -14,3 +14,5 @@ tar -xzf $(brew --cache --bottle-tag=arm64_big_sur libomp) --strip-components 2 # merge lipo armlib/lib/libomp.dylib $(brew --prefix libomp)/lib/libomp.dylib -output libomp.dylib -create cp -f libomp.dylib $(brew --prefix libomp)/lib +rm libomp.dylib +rm -rf armlib diff --git a/suitesparse.sh b/suitesparse.sh index 8fecb33..d12cddc 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -49,15 +49,15 @@ cd GraphBLAS-${VERSION}/build # Also the build with all types enabled sometimes stalls on GitHub Actions. Probably due to exceeded resource limits. # These can still be used, they'll just have reduced performance (AFAIK similar to UDTs). # TODO -echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h # -echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h # -echo "#define GxB_NO_FP64 1" >> ../Source/GB_control.h # +# echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h # +# echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h # +# echo "#define GxB_NO_FP64 1" >> ../Source/GB_control.h # echo "#define GxB_NO_FC32 1" >> ../Source/GB_control.h # echo "#define GxB_NO_FC64 1" >> ../Source/GB_control.h # echo "#define GxB_NO_INT16 1" >> ../Source/GB_control.h echo "#define GxB_NO_INT32 1" >> ../Source/GB_control.h -echo "#define GxB_NO_INT64 1" >> ../Source/GB_control.h # -echo "#define GxB_NO_INT8 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_INT64 1" >> ../Source/GB_control.h # +# echo "#define GxB_NO_INT8 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT16 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT32 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h From 7cf3595fc1d1abf9089e66ee6731ac7f59c96e1f Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Fri, 24 Mar 2023 15:46:43 -0500 Subject: [PATCH 10/10] Moar dtypes! --- .github/workflows/wheels.yml | 4 +--- suitesparse.sh | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a19d6dc..95c8d9b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -81,9 +81,7 @@ jobs: CIBW_BUILD_VERBOSITY: 3 # Build SuiteSparse -# CIBW_BEFORE_ALL: bash suitesparse.sh ${{ github.ref }} - # TODO - CIBW_BEFORE_ALL: bash suitesparse.sh refs/tags/7.4.3.0 + CIBW_BEFORE_ALL: bash suitesparse.sh ${{ github.ref }} # CMAKE_GNUtoMS=ON asks suitesparse.sh to build libraries in MSVC style on Windows. CIBW_ENVIRONMENT_WINDOWS: CMAKE_GNUtoMS=ON GRAPHBLAS_PREFIX="C:/GraphBLAS" diff --git a/suitesparse.sh b/suitesparse.sh index d12cddc..2e5f86e 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -54,13 +54,13 @@ cd GraphBLAS-${VERSION}/build # echo "#define GxB_NO_FP64 1" >> ../Source/GB_control.h # echo "#define GxB_NO_FC32 1" >> ../Source/GB_control.h # echo "#define GxB_NO_FC64 1" >> ../Source/GB_control.h # -echo "#define GxB_NO_INT16 1" >> ../Source/GB_control.h -echo "#define GxB_NO_INT32 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_INT16 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_INT32 1" >> ../Source/GB_control.h # echo "#define GxB_NO_INT64 1" >> ../Source/GB_control.h # # echo "#define GxB_NO_INT8 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT16 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT32 1" >> ../Source/GB_control.h -echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT8 1" >> ../Source/GB_control.h # Disable all Source/Generated2 kernels. For workflow development only.