From fa9f97760843fd4865a7e1b0526147559c510876 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Tue, 26 Aug 2025 13:24:08 +0530 Subject: [PATCH 01/13] testing builds for python 3.13 adn 3.14 for free threading support --- .github/workflows/build_wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 37a80387..cb481b4d 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -39,7 +39,7 @@ jobs: - name: Build wheels env: - CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64" + CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp314-manylinux_x86_64" CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 CIBW_BUILD_VERBOSITY: "3" CIBW_BEFORE_ALL: | @@ -122,7 +122,7 @@ jobs: - name: Build wheels env: - CIBW_BUILD: "cp310-* cp311-* cp312-*" + CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*" CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }} CIBW_BUILD_VERBOSITY: "3" CIBW_ENVIRONMENT: > @@ -197,8 +197,8 @@ jobs: - name: Build wheels env: - CIBW_BUILD: "cp310-* cp311-* cp312-*" - CIBW_SKIP: "pp* cp36-* cp37-* cp38-* cp39-* cp313-*" + CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*" + CIBW_SKIP: "pp* cp36-* cp37-* cp38-* cp39-*" CIBW_ARCHS_WINDOWS: ${{ matrix.architecture == 'x86' && 'x86' || 'AMD64' }} CIBW_BUILD_VERBOSITY: "3" DISTUTILS_USE_SDK: "1" From 3cf2cc9de65450da40b2bcb619e2c7ef0ed54fa4 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Tue, 26 Aug 2025 13:36:55 +0530 Subject: [PATCH 02/13] updating cibuildwheel --- .github/workflows/build_wheels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index cb481b4d..11d7d307 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -35,7 +35,7 @@ jobs: ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - name: Install cibuildwheel - run: pip install cibuildwheel==2.20.0 + run: pip install cibuildwheel==3.1.4 - name: Build wheels env: @@ -118,7 +118,7 @@ jobs: ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - name: Install cibuildwheel - run: pip install cibuildwheel==2.20.0 + run: pip install cibuildwheel==3.1.4 - name: Build wheels env: @@ -193,7 +193,7 @@ jobs: shell: bash -l {0} run: | pip install -U pip - pip install cibuildwheel==2.20.0 ninja meson meson-python numpy delvewheel pytest + pip install cibuildwheel==3.1.4 ninja meson meson-python numpy delvewheel pytest - name: Build wheels env: From 77847036414618c2caa8185ace54d3bc6769c3b0 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Tue, 26 Aug 2025 13:41:25 +0530 Subject: [PATCH 03/13] updating python --- .github/workflows/build_wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 11d7d307..9cfa0786 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -27,7 +27,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: ">=3.10.0" + python-version: ">=3.11.0" - name: Verify QuadBLAS submodule run: | @@ -90,7 +90,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: ">=3.11.0" - name: Install dependencies run: | @@ -165,10 +165,10 @@ jobs: with: arch: ${{ matrix.architecture }} - - name: Set up Python 3.10 + - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: ">=3.11.0" architecture: ${{ matrix.architecture }} - name: Install CMake From 2260c98a5ca2695425c177e0da38851a5d9623a5 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 27 Aug 2025 04:13:28 +0530 Subject: [PATCH 04/13] testing 3.13t and 3.14t on macos --- .github/workflows/build_wheels.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 9cfa0786..501b4d36 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -117,12 +117,14 @@ jobs: ls -la quaddtype/numpy_quaddtype/QBLAS/ ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - - name: Install cibuildwheel - run: pip install cibuildwheel==3.1.4 + - name: Installing dependencies + run: | + pip install -U pip + pip install pytest-run-parallel - name: Build wheels env: - CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*" + CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*" CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }} CIBW_BUILD_VERBOSITY: "3" CIBW_ENVIRONMENT: > @@ -136,7 +138,11 @@ jobs: delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_TEST_COMMAND: | pip install {package}[test] - pytest -s {project}/tests + if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then + pytest --parallel-threads=10 --iterations=10 {project}/tests + else + pytest -s {project}/tests + fi CIBW_TEST_EXTRAS: "test" run: | python -m cibuildwheel --output-dir wheelhouse From e5462e0ae84dfbd887fb30fa40f11bcef7d5f8a3 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 27 Aug 2025 04:18:50 +0530 Subject: [PATCH 05/13] adding cibw --- .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 501b4d36..5f7b3b76 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -117,9 +117,10 @@ jobs: ls -la quaddtype/numpy_quaddtype/QBLAS/ ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - - name: Installing dependencies + - name: Installing Python dependencies run: | pip install -U pip + pip install cibuildwheel==3.1.4 pip install pytest-run-parallel - name: Build wheels From f12ff3c2d4b372313746fe26122b4bce44a51128 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 27 Aug 2025 04:24:11 +0530 Subject: [PATCH 06/13] enablign cibw free-thread --- .github/workflows/build_wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 5f7b3b76..77858347 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -126,6 +126,7 @@ jobs: - name: Build wheels env: CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*" + CIBW_FREE_THREADED_SUPPORT: true CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }} CIBW_BUILD_VERBOSITY: "3" CIBW_ENVIRONMENT: > From 05d2d6cb01defa822c46804ba93c8e6d59fb8904 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 27 Aug 2025 04:28:12 +0530 Subject: [PATCH 07/13] enablign cibw free-thread --- .github/workflows/build_wheels.yml | 250 ++++++++++++++--------------- 1 file changed, 125 insertions(+), 125 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 77858347..316495f8 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -16,64 +16,64 @@ on: workflow_dispatch: jobs: - build_wheels_linux: - name: Build wheels on Linux - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive + # build_wheels_linux: + # name: Build wheels on Linux + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # with: + # submodules: recursive - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ">=3.11.0" + # - name: Set up Python + # uses: actions/setup-python@v4 + # with: + # python-version: ">=3.11.0" - - name: Verify QuadBLAS submodule - run: | - ls -la quaddtype/numpy_quaddtype/QBLAS/ - ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ + # - name: Verify QuadBLAS submodule + # run: | + # ls -la quaddtype/numpy_quaddtype/QBLAS/ + # ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - - name: Install cibuildwheel - run: pip install cibuildwheel==3.1.4 + # - name: Install cibuildwheel + # run: pip install cibuildwheel==3.1.4 - - name: Build wheels - env: - CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp314-manylinux_x86_64" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 - CIBW_BUILD_VERBOSITY: "3" - CIBW_BEFORE_ALL: | - yum update -y - yum install -y cmake gcc gcc-c++ make git pkgconfig - # Install SLEEF in container - git clone --branch 3.8 https://github.com/shibatch/sleef.git - cd sleef - cmake -S . -B build \ - -DSLEEF_BUILD_QUAD:BOOL=ON \ - -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - cmake --build build/ --clean-first -j - cmake --install build --prefix /usr/local - CIBW_ENVIRONMENT: > - CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" - CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include -fext-numeric-literals $CXXFLAGS" - LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib -fopenmp $LDFLAGS" - LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH" - PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" - CIBW_REPAIR_WHEEL_COMMAND: | - auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel} - CIBW_TEST_COMMAND: | - pip install {package}[test] - pytest -s {project}/tests - CIBW_TEST_EXTRAS: "test" - run: | - python -m cibuildwheel --output-dir wheelhouse - working-directory: ./quaddtype + # - name: Build wheels + # env: + # CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp314-manylinux_x86_64" + # CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + # CIBW_BUILD_VERBOSITY: "3" + # CIBW_BEFORE_ALL: | + # yum update -y + # yum install -y cmake gcc gcc-c++ make git pkgconfig + # # Install SLEEF in container + # git clone --branch 3.8 https://github.com/shibatch/sleef.git + # cd sleef + # cmake -S . -B build \ + # -DSLEEF_BUILD_QUAD:BOOL=ON \ + # -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ + # -DCMAKE_POSITION_INDEPENDENT_CODE=ON + # cmake --build build/ --clean-first -j + # cmake --install build --prefix /usr/local + # CIBW_ENVIRONMENT: > + # CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" + # CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include -fext-numeric-literals $CXXFLAGS" + # LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib -fopenmp $LDFLAGS" + # LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH" + # PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" + # CIBW_REPAIR_WHEEL_COMMAND: | + # auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel} + # CIBW_TEST_COMMAND: | + # pip install {package}[test] + # pytest -s {project}/tests + # CIBW_TEST_EXTRAS: "test" + # run: | + # python -m cibuildwheel --output-dir wheelhouse + # working-directory: ./quaddtype - - uses: actions/upload-artifact@v4 - with: - path: ./quaddtype/wheelhouse/*.whl - name: wheels-linux + # - uses: actions/upload-artifact@v4 + # with: + # path: ./quaddtype/wheelhouse/*.whl + # name: wheels-linux build_wheels_macos: name: Build wheels on ${{ matrix.os }} @@ -126,7 +126,7 @@ jobs: - name: Build wheels env: CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*" - CIBW_FREE_THREADED_SUPPORT: true + CIBW_ENABLE: cpython-prerelease cpython-freethreading CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }} CIBW_BUILD_VERBOSITY: "3" CIBW_ENVIRONMENT: > @@ -156,86 +156,86 @@ jobs: name: wheels-${{ matrix.os }} # disabling QBLAS optimization for windows due to incompatibility with MSVC - build_wheels_windows: - name: Build wheels on Windows - runs-on: windows-latest - strategy: - matrix: - architecture: [x64] + # build_wheels_windows: + # name: Build wheels on Windows + # runs-on: windows-latest + # strategy: + # matrix: + # architecture: [x64] - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive + # steps: + # - uses: actions/checkout@v3 + # with: + # submodules: recursive - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ matrix.architecture }} + # - name: Setup MSVC + # uses: ilammy/msvc-dev-cmd@v1 + # with: + # arch: ${{ matrix.architecture }} - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ">=3.11.0" - architecture: ${{ matrix.architecture }} + # - name: Set up Python + # uses: actions/setup-python@v4 + # with: + # python-version: ">=3.11.0" + # architecture: ${{ matrix.architecture }} - - name: Install CMake - uses: lukka/get-cmake@latest + # - name: Install CMake + # uses: lukka/get-cmake@latest - - name: Verify QuadBLAS submodule - shell: pwsh - run: | - Get-ChildItem quaddtype/numpy_quaddtype/QBLAS/ - Get-ChildItem quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ + # - name: Verify QuadBLAS submodule + # shell: pwsh + # run: | + # Get-ChildItem quaddtype/numpy_quaddtype/QBLAS/ + # Get-ChildItem quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - - name: Clone and Build SLEEF - shell: pwsh - run: | - git clone --branch 3.8 https://github.com/shibatch/sleef.git - cd sleef - cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture == 'x86' && 'Win32' || 'x64' }} -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON - cmake --build build --config Release - cmake --install build --prefix "C:/sleef" --config Release + # - name: Clone and Build SLEEF + # shell: pwsh + # run: | + # git clone --branch 3.8 https://github.com/shibatch/sleef.git + # cd sleef + # cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture == 'x86' && 'Win32' || 'x64' }} -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON + # cmake --build build --config Release + # cmake --install build --prefix "C:/sleef" --config Release - - name: Install build dependencies - shell: bash -l {0} - run: | - pip install -U pip - pip install cibuildwheel==3.1.4 ninja meson meson-python numpy delvewheel pytest + # - name: Install build dependencies + # shell: bash -l {0} + # run: | + # pip install -U pip + # pip install cibuildwheel==3.1.4 ninja meson meson-python numpy delvewheel pytest - - name: Build wheels - env: - CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*" - CIBW_SKIP: "pp* cp36-* cp37-* cp38-* cp39-*" - CIBW_ARCHS_WINDOWS: ${{ matrix.architecture == 'x86' && 'x86' || 'AMD64' }} - CIBW_BUILD_VERBOSITY: "3" - DISTUTILS_USE_SDK: "1" - MSSdk: "1" - CIBW_BEFORE_BUILD: | - pip install meson meson-python ninja numpy - CIBW_ENVIRONMENT: > - INCLUDE="C:/sleef/include;{project}/numpy_quaddtype/QBLAS/include;$INCLUDE" - LIB="C:/sleef/lib;$LIB" - PATH="C:/sleef/bin;$PATH" - CFLAGS="/IC:/sleef/include /I{project}/numpy_quaddtype/QBLAS/include /DDISABLE_QUADBLAS $CFLAGS" - CXXFLAGS="/IC:/sleef/include /I{project}/numpy_quaddtype/QBLAS/include /DDISABLE_QUADBLAS $CXXFLAGS" - LDFLAGS="C:/sleef/lib/sleef.lib C:/sleef/lib/sleefquad.lib $LDFLAGS" - CIBW_REPAIR_WHEEL_COMMAND: 'delvewheel repair -w {dest_dir} {wheel} --add-path C:\sleef\bin' - CIBW_TEST_COMMAND: | - pip install {package}[test] - pytest -s {project}/tests - CIBW_TEST_EXTRAS: test - CIBW_TEST_FAIL_FAST: 1 - shell: pwsh - run: | - python -m cibuildwheel --output-dir wheelhouse - if (-not (Test-Path wheelhouse/*.whl)) { throw "Wheel was not created" } - working-directory: ./quaddtype + # - name: Build wheels + # env: + # CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*" + # CIBW_SKIP: "pp* cp36-* cp37-* cp38-* cp39-*" + # CIBW_ARCHS_WINDOWS: ${{ matrix.architecture == 'x86' && 'x86' || 'AMD64' }} + # CIBW_BUILD_VERBOSITY: "3" + # DISTUTILS_USE_SDK: "1" + # MSSdk: "1" + # CIBW_BEFORE_BUILD: | + # pip install meson meson-python ninja numpy + # CIBW_ENVIRONMENT: > + # INCLUDE="C:/sleef/include;{project}/numpy_quaddtype/QBLAS/include;$INCLUDE" + # LIB="C:/sleef/lib;$LIB" + # PATH="C:/sleef/bin;$PATH" + # CFLAGS="/IC:/sleef/include /I{project}/numpy_quaddtype/QBLAS/include /DDISABLE_QUADBLAS $CFLAGS" + # CXXFLAGS="/IC:/sleef/include /I{project}/numpy_quaddtype/QBLAS/include /DDISABLE_QUADBLAS $CXXFLAGS" + # LDFLAGS="C:/sleef/lib/sleef.lib C:/sleef/lib/sleefquad.lib $LDFLAGS" + # CIBW_REPAIR_WHEEL_COMMAND: 'delvewheel repair -w {dest_dir} {wheel} --add-path C:\sleef\bin' + # CIBW_TEST_COMMAND: | + # pip install {package}[test] + # pytest -s {project}/tests + # CIBW_TEST_EXTRAS: test + # CIBW_TEST_FAIL_FAST: 1 + # shell: pwsh + # run: | + # python -m cibuildwheel --output-dir wheelhouse + # if (-not (Test-Path wheelhouse/*.whl)) { throw "Wheel was not created" } + # working-directory: ./quaddtype - - uses: actions/upload-artifact@v4 - with: - path: ./quaddtype/wheelhouse/*.whl - name: wheels-windows-${{ matrix.architecture }} + # - uses: actions/upload-artifact@v4 + # with: + # path: ./quaddtype/wheelhouse/*.whl + # name: wheels-windows-${{ matrix.architecture }} publish_to_pypi: name: Publish to PyPI From 0edbba37798ffaa14d9d04a259bdf4ebdb99ab66 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 27 Aug 2025 04:30:29 +0530 Subject: [PATCH 08/13] enablign cibw free-thread --- .github/workflows/build_wheels.yml | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 316495f8..a91c8d23 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -237,26 +237,26 @@ jobs: # path: ./quaddtype/wheelhouse/*.whl # name: wheels-windows-${{ matrix.architecture }} - publish_to_pypi: - name: Publish to PyPI - needs: [build_wheels_linux, build_wheels_macos, build_wheels_windows] - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/quaddtype-v') + # publish_to_pypi: + # name: Publish to PyPI + # needs: [build_wheels_linux, build_wheels_macos, build_wheels_windows] + # runs-on: ubuntu-latest + # if: startsWith(github.ref, 'refs/tags/quaddtype-v') - environment: - name: quadtype_release - url: https://pypi.org/p/numpy-quaddtype + # environment: + # name: quadtype_release + # url: https://pypi.org/p/numpy-quaddtype - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing + # permissions: + # id-token: write # IMPORTANT: mandatory for trusted publishing - steps: - - name: Download all workflow run artifacts - uses: actions/download-artifact@v4 - with: - path: dist + # steps: + # - name: Download all workflow run artifacts + # uses: actions/download-artifact@v4 + # with: + # path: dist - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - packages-dir: dist/* + # - name: Publish to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # packages-dir: dist/* From f11b08b1b96d95be23ec78493b535e6281d9d37d Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 27 Aug 2025 04:37:40 +0530 Subject: [PATCH 09/13] adding pytest-test-parallel --- quaddtype/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/quaddtype/pyproject.toml b/quaddtype/pyproject.toml index 30898c72..3f42895b 100644 --- a/quaddtype/pyproject.toml +++ b/quaddtype/pyproject.toml @@ -21,4 +21,5 @@ dependencies = [ [project.optional-dependencies] test = [ "pytest", + "pytest-run-parallel" ] \ No newline at end of file From d46a8f75bb2aaa52f1fcf74d6a08ee3a66135e34 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 27 Aug 2025 04:56:00 +0530 Subject: [PATCH 10/13] edit extension --- .github/workflows/build_wheels.yml | 2 +- .../numpy_quaddtype/src/quaddtype_main.c | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index a91c8d23..e18de616 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -125,7 +125,7 @@ jobs: - name: Build wheels env: - CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*" + CIBW_BUILD: "cp314-* cp313t-* cp314t-*" CIBW_ENABLE: cpython-prerelease cpython-freethreading CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }} CIBW_BUILD_VERBOSITY: "3" diff --git a/quaddtype/numpy_quaddtype/src/quaddtype_main.c b/quaddtype/numpy_quaddtype/src/quaddtype_main.c index 39f3da8a..929927a4 100644 --- a/quaddtype/numpy_quaddtype/src/quaddtype_main.c +++ b/quaddtype/numpy_quaddtype/src/quaddtype_main.c @@ -80,14 +80,17 @@ get_sleef_constant(PyObject *self, PyObject *args) else if (strcmp(constant_name, "precision") == 0) { Py_DECREF(result); // precision = int(-log10(epsilon)) - int64_t precision = Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON))); + int64_t precision = + Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON))); return PyLong_FromLong(precision); } else if (strcmp(constant_name, "resolution") == 0) { // precision = int(-log10(epsilon)) - int64_t precision = Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON))); + int64_t precision = + Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON))); // resolution = 10 ** (-precision) - result->value.sleef_value = Sleef_powq1_u10(Sleef_cast_from_int64q1(10), Sleef_cast_from_int64q1(-precision)); + result->value.sleef_value = + Sleef_powq1_u10(Sleef_cast_from_int64q1(10), Sleef_cast_from_int64q1(-precision)); } else { PyErr_SetString(PyExc_ValueError, "Unknown constant name"); @@ -109,9 +112,12 @@ static PyMethodDef module_methods[] = { {NULL, NULL, 0, NULL}}; static struct PyModuleDef moduledef = { - PyModuleDef_HEAD_INIT, .m_name = "_quaddtype_main", + PyModuleDef_HEAD_INIT, + .m_name = "_quaddtype_main", .m_doc = "Quad (128-bit) floating point Data Type for NumPy with multiple backends", - .m_size = -1, .m_methods = module_methods}; + .m_size = -1, + .m_methods = module_methods, +}; PyMODINIT_FUNC PyInit__quaddtype_main(void) @@ -123,6 +129,10 @@ PyInit__quaddtype_main(void) return NULL; } +#ifdef Py_GIL_DISABLED + PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED); +#endif + if (init_quadprecision_scalar() < 0) goto error; From 9e28e06c638f0e035aaffc60088556006581f913 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 27 Aug 2025 05:17:30 +0530 Subject: [PATCH 11/13] checking linux --- .github/workflows/build_wheels.yml | 207 +++++++++++++++-------------- 1 file changed, 106 insertions(+), 101 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index e18de616..56401fd5 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -16,72 +16,9 @@ on: workflow_dispatch: jobs: - # build_wheels_linux: - # name: Build wheels on Linux - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive - - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: ">=3.11.0" - - # - name: Verify QuadBLAS submodule - # run: | - # ls -la quaddtype/numpy_quaddtype/QBLAS/ - # ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - - # - name: Install cibuildwheel - # run: pip install cibuildwheel==3.1.4 - - # - name: Build wheels - # env: - # CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp314-manylinux_x86_64" - # CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 - # CIBW_BUILD_VERBOSITY: "3" - # CIBW_BEFORE_ALL: | - # yum update -y - # yum install -y cmake gcc gcc-c++ make git pkgconfig - # # Install SLEEF in container - # git clone --branch 3.8 https://github.com/shibatch/sleef.git - # cd sleef - # cmake -S . -B build \ - # -DSLEEF_BUILD_QUAD:BOOL=ON \ - # -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ - # -DCMAKE_POSITION_INDEPENDENT_CODE=ON - # cmake --build build/ --clean-first -j - # cmake --install build --prefix /usr/local - # CIBW_ENVIRONMENT: > - # CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" - # CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include -fext-numeric-literals $CXXFLAGS" - # LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib -fopenmp $LDFLAGS" - # LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH" - # PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" - # CIBW_REPAIR_WHEEL_COMMAND: | - # auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel} - # CIBW_TEST_COMMAND: | - # pip install {package}[test] - # pytest -s {project}/tests - # CIBW_TEST_EXTRAS: "test" - # run: | - # python -m cibuildwheel --output-dir wheelhouse - # working-directory: ./quaddtype - - # - uses: actions/upload-artifact@v4 - # with: - # path: ./quaddtype/wheelhouse/*.whl - # name: wheels-linux - - build_wheels_macos: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-13, macos-14] - + build_wheels_linux: + name: Build wheels on Linux + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: @@ -92,52 +29,40 @@ jobs: with: python-version: ">=3.11.0" - - name: Install dependencies - run: | - brew install cmake libomp git - - - name: Install SLEEF - env: - MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-13' && '13.0' || '14.0' }} - run: | - git clone --branch 3.8 https://github.com/shibatch/sleef.git - cd sleef - cmake -S . -B build \ - -DSLEEF_BUILD_QUAD:BOOL=ON \ - -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.os == 'macos-13' && '13.0' || '14.0' }} \ - -DCMAKE_INSTALL_RPATH="@loader_path/../lib" \ - -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON - cmake --build build/ --clean-first -j - sudo cmake --install build --prefix /usr/local - - name: Verify QuadBLAS submodule run: | ls -la quaddtype/numpy_quaddtype/QBLAS/ ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - - name: Installing Python dependencies - run: | - pip install -U pip - pip install cibuildwheel==3.1.4 - pip install pytest-run-parallel + - name: Install cibuildwheel + run: pip install cibuildwheel==3.1.4 - name: Build wheels env: - CIBW_BUILD: "cp314-* cp313t-* cp314t-*" + CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp313t-manylinux_x86_64 cp314-manylinux_x86_64 cp314t-manylinux_x86_64" CIBW_ENABLE: cpython-prerelease cpython-freethreading - CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }} + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 CIBW_BUILD_VERBOSITY: "3" + CIBW_BEFORE_ALL: | + yum update -y + yum install -y cmake gcc gcc-c++ make git pkgconfig + # Install SLEEF in container + git clone --branch 3.8 https://github.com/shibatch/sleef.git + cd sleef + cmake -S . -B build \ + -DSLEEF_BUILD_QUAD:BOOL=ON \ + -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + cmake --build build/ --clean-first -j + cmake --install build --prefix /usr/local CIBW_ENVIRONMENT: > - MACOSX_DEPLOYMENT_TARGET="${{ matrix.os == 'macos-13' && '13.0' || '14.0' }}" - DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH" CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" - CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CXXFLAGS" - LDFLAGS="-L/usr/local/lib $LDFLAGS" - PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" - CIBW_REPAIR_WHEEL_COMMAND: > - delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include -fext-numeric-literals $CXXFLAGS" + LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib -fopenmp $LDFLAGS" + LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH" + PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" + CIBW_REPAIR_WHEEL_COMMAND: | + auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel} CIBW_TEST_COMMAND: | pip install {package}[test] if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then @@ -153,7 +78,87 @@ jobs: - uses: actions/upload-artifact@v4 with: path: ./quaddtype/wheelhouse/*.whl - name: wheels-${{ matrix.os }} + name: wheels-linux + + # build_wheels_macos: + # name: Build wheels on ${{ matrix.os }} + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [macos-13, macos-14] + + # steps: + # - uses: actions/checkout@v3 + # with: + # submodules: recursive + + # - name: Set up Python + # uses: actions/setup-python@v4 + # with: + # python-version: ">=3.11.0" + + # - name: Install dependencies + # run: | + # brew install cmake libomp git + + # - name: Install SLEEF + # env: + # MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-13' && '13.0' || '14.0' }} + # run: | + # git clone --branch 3.8 https://github.com/shibatch/sleef.git + # cd sleef + # cmake -S . -B build \ + # -DSLEEF_BUILD_QUAD:BOOL=ON \ + # -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ + # -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + # -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.os == 'macos-13' && '13.0' || '14.0' }} \ + # -DCMAKE_INSTALL_RPATH="@loader_path/../lib" \ + # -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON + # cmake --build build/ --clean-first -j + # sudo cmake --install build --prefix /usr/local + + # - name: Verify QuadBLAS submodule + # run: | + # ls -la quaddtype/numpy_quaddtype/QBLAS/ + # ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ + + # - name: Installing Python dependencies + # run: | + # pip install -U pip + # pip install cibuildwheel==3.1.4 + # pip install pytest-run-parallel + + # - name: Build wheels + # env: + # CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*" + # CIBW_ENABLE: cpython-prerelease cpython-freethreading + # CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }} + # CIBW_BUILD_VERBOSITY: "3" + # CIBW_ENVIRONMENT: > + # MACOSX_DEPLOYMENT_TARGET="${{ matrix.os == 'macos-13' && '13.0' || '14.0' }}" + # DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH" + # CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" + # CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CXXFLAGS" + # LDFLAGS="-L/usr/local/lib $LDFLAGS" + # PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" + # CIBW_REPAIR_WHEEL_COMMAND: > + # delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + # CIBW_TEST_COMMAND: | + # pip install {package}[test] + # if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then + # pytest --parallel-threads=10 --iterations=10 {project}/tests + # else + # pytest -s {project}/tests + # fi + # CIBW_TEST_EXTRAS: "test" + # run: | + # python -m cibuildwheel --output-dir wheelhouse + # working-directory: ./quaddtype + + # - uses: actions/upload-artifact@v4 + # with: + # path: ./quaddtype/wheelhouse/*.whl + # name: wheels-${{ matrix.os }} # disabling QBLAS optimization for windows due to incompatibility with MSVC # build_wheels_windows: From ccf066df1c1567c22002e9a5393cbe1102ba6156 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 27 Aug 2025 05:27:46 +0530 Subject: [PATCH 12/13] checking windows --- .github/workflows/build_wheels.yml | 263 +++++++++++++++-------------- 1 file changed, 134 insertions(+), 129 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 56401fd5..0583acde 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -16,69 +16,69 @@ on: workflow_dispatch: jobs: - build_wheels_linux: - name: Build wheels on Linux - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive + # build_wheels_linux: + # name: Build wheels on Linux + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # with: + # submodules: recursive - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ">=3.11.0" + # - name: Set up Python + # uses: actions/setup-python@v4 + # with: + # python-version: ">=3.11.0" - - name: Verify QuadBLAS submodule - run: | - ls -la quaddtype/numpy_quaddtype/QBLAS/ - ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ + # - name: Verify QuadBLAS submodule + # run: | + # ls -la quaddtype/numpy_quaddtype/QBLAS/ + # ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - - name: Install cibuildwheel - run: pip install cibuildwheel==3.1.4 + # - name: Install cibuildwheel + # run: pip install cibuildwheel==3.1.4 - - name: Build wheels - env: - CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp313t-manylinux_x86_64 cp314-manylinux_x86_64 cp314t-manylinux_x86_64" - CIBW_ENABLE: cpython-prerelease cpython-freethreading - CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 - CIBW_BUILD_VERBOSITY: "3" - CIBW_BEFORE_ALL: | - yum update -y - yum install -y cmake gcc gcc-c++ make git pkgconfig - # Install SLEEF in container - git clone --branch 3.8 https://github.com/shibatch/sleef.git - cd sleef - cmake -S . -B build \ - -DSLEEF_BUILD_QUAD:BOOL=ON \ - -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - cmake --build build/ --clean-first -j - cmake --install build --prefix /usr/local - CIBW_ENVIRONMENT: > - CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" - CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include -fext-numeric-literals $CXXFLAGS" - LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib -fopenmp $LDFLAGS" - LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH" - PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" - CIBW_REPAIR_WHEEL_COMMAND: | - auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel} - CIBW_TEST_COMMAND: | - pip install {package}[test] - if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then - pytest --parallel-threads=10 --iterations=10 {project}/tests - else - pytest -s {project}/tests - fi - CIBW_TEST_EXTRAS: "test" - run: | - python -m cibuildwheel --output-dir wheelhouse - working-directory: ./quaddtype + # - name: Build wheels + # env: + # CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp313t-manylinux_x86_64 cp314-manylinux_x86_64 cp314t-manylinux_x86_64" + # CIBW_ENABLE: cpython-prerelease cpython-freethreading + # CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + # CIBW_BUILD_VERBOSITY: "3" + # CIBW_BEFORE_ALL: | + # yum update -y + # yum install -y cmake gcc gcc-c++ make git pkgconfig + # # Install SLEEF in container + # git clone --branch 3.8 https://github.com/shibatch/sleef.git + # cd sleef + # cmake -S . -B build \ + # -DSLEEF_BUILD_QUAD:BOOL=ON \ + # -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ + # -DCMAKE_POSITION_INDEPENDENT_CODE=ON + # cmake --build build/ --clean-first -j + # cmake --install build --prefix /usr/local + # CIBW_ENVIRONMENT: > + # CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" + # CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include -fext-numeric-literals $CXXFLAGS" + # LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib -fopenmp $LDFLAGS" + # LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH" + # PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" + # CIBW_REPAIR_WHEEL_COMMAND: | + # auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel} + # CIBW_TEST_COMMAND: | + # pip install {package}[test] + # if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then + # pytest --parallel-threads=10 --iterations=10 {project}/tests + # else + # pytest -s {project}/tests + # fi + # CIBW_TEST_EXTRAS: "test" + # run: | + # python -m cibuildwheel --output-dir wheelhouse + # working-directory: ./quaddtype - - uses: actions/upload-artifact@v4 - with: - path: ./quaddtype/wheelhouse/*.whl - name: wheels-linux + # - uses: actions/upload-artifact@v4 + # with: + # path: ./quaddtype/wheelhouse/*.whl + # name: wheels-linux # build_wheels_macos: # name: Build wheels on ${{ matrix.os }} @@ -161,86 +161,91 @@ jobs: # name: wheels-${{ matrix.os }} # disabling QBLAS optimization for windows due to incompatibility with MSVC - # build_wheels_windows: - # name: Build wheels on Windows - # runs-on: windows-latest - # strategy: - # matrix: - # architecture: [x64] + build_wheels_windows: + name: Build wheels on Windows + runs-on: windows-latest + strategy: + matrix: + architecture: [x64] - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive - # - name: Setup MSVC - # uses: ilammy/msvc-dev-cmd@v1 - # with: - # arch: ${{ matrix.architecture }} + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.architecture }} - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: ">=3.11.0" - # architecture: ${{ matrix.architecture }} + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ">=3.11.0" + architecture: ${{ matrix.architecture }} - # - name: Install CMake - # uses: lukka/get-cmake@latest + - name: Install CMake + uses: lukka/get-cmake@latest - # - name: Verify QuadBLAS submodule - # shell: pwsh - # run: | - # Get-ChildItem quaddtype/numpy_quaddtype/QBLAS/ - # Get-ChildItem quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ + - name: Verify QuadBLAS submodule + shell: pwsh + run: | + Get-ChildItem quaddtype/numpy_quaddtype/QBLAS/ + Get-ChildItem quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - # - name: Clone and Build SLEEF - # shell: pwsh - # run: | - # git clone --branch 3.8 https://github.com/shibatch/sleef.git - # cd sleef - # cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture == 'x86' && 'Win32' || 'x64' }} -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON - # cmake --build build --config Release - # cmake --install build --prefix "C:/sleef" --config Release + - name: Clone and Build SLEEF + shell: pwsh + run: | + git clone --branch 3.8 https://github.com/shibatch/sleef.git + cd sleef + cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture == 'x86' && 'Win32' || 'x64' }} -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON + cmake --build build --config Release + cmake --install build --prefix "C:/sleef" --config Release - # - name: Install build dependencies - # shell: bash -l {0} - # run: | - # pip install -U pip - # pip install cibuildwheel==3.1.4 ninja meson meson-python numpy delvewheel pytest + - name: Install build dependencies + shell: bash -l {0} + run: | + pip install -U pip + pip install cibuildwheel==3.1.4 ninja meson meson-python numpy delvewheel pytest - # - name: Build wheels - # env: - # CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*" - # CIBW_SKIP: "pp* cp36-* cp37-* cp38-* cp39-*" - # CIBW_ARCHS_WINDOWS: ${{ matrix.architecture == 'x86' && 'x86' || 'AMD64' }} - # CIBW_BUILD_VERBOSITY: "3" - # DISTUTILS_USE_SDK: "1" - # MSSdk: "1" - # CIBW_BEFORE_BUILD: | - # pip install meson meson-python ninja numpy - # CIBW_ENVIRONMENT: > - # INCLUDE="C:/sleef/include;{project}/numpy_quaddtype/QBLAS/include;$INCLUDE" - # LIB="C:/sleef/lib;$LIB" - # PATH="C:/sleef/bin;$PATH" - # CFLAGS="/IC:/sleef/include /I{project}/numpy_quaddtype/QBLAS/include /DDISABLE_QUADBLAS $CFLAGS" - # CXXFLAGS="/IC:/sleef/include /I{project}/numpy_quaddtype/QBLAS/include /DDISABLE_QUADBLAS $CXXFLAGS" - # LDFLAGS="C:/sleef/lib/sleef.lib C:/sleef/lib/sleefquad.lib $LDFLAGS" - # CIBW_REPAIR_WHEEL_COMMAND: 'delvewheel repair -w {dest_dir} {wheel} --add-path C:\sleef\bin' - # CIBW_TEST_COMMAND: | - # pip install {package}[test] - # pytest -s {project}/tests - # CIBW_TEST_EXTRAS: test - # CIBW_TEST_FAIL_FAST: 1 - # shell: pwsh - # run: | - # python -m cibuildwheel --output-dir wheelhouse - # if (-not (Test-Path wheelhouse/*.whl)) { throw "Wheel was not created" } - # working-directory: ./quaddtype + - name: Build wheels + env: + CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*" + CIBW_ENABLE: cpython-prerelease cpython-freethreading + CIBW_SKIP: "pp* cp36-* cp37-* cp38-* cp39-*" + CIBW_ARCHS_WINDOWS: ${{ matrix.architecture == 'x86' && 'x86' || 'AMD64' }} + CIBW_BUILD_VERBOSITY: "3" + DISTUTILS_USE_SDK: "1" + MSSdk: "1" + CIBW_BEFORE_BUILD: | + pip install meson meson-python ninja numpy + CIBW_ENVIRONMENT: > + INCLUDE="C:/sleef/include;{project}/numpy_quaddtype/QBLAS/include;$INCLUDE" + LIB="C:/sleef/lib;$LIB" + PATH="C:/sleef/bin;$PATH" + CFLAGS="/IC:/sleef/include /I{project}/numpy_quaddtype/QBLAS/include /DDISABLE_QUADBLAS $CFLAGS" + CXXFLAGS="/IC:/sleef/include /I{project}/numpy_quaddtype/QBLAS/include /DDISABLE_QUADBLAS $CXXFLAGS" + LDFLAGS="C:/sleef/lib/sleef.lib C:/sleef/lib/sleefquad.lib $LDFLAGS" + CIBW_REPAIR_WHEEL_COMMAND: 'delvewheel repair -w {dest_dir} {wheel} --add-path C:\sleef\bin' + CIBW_TEST_COMMAND: | + pip install {package}[test] + if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then + pytest --parallel-threads=10 --iterations=10 {project}/tests + else + pytest -s {project}/tests + fi + CIBW_TEST_EXTRAS: test + CIBW_TEST_FAIL_FAST: 1 + shell: pwsh + run: | + python -m cibuildwheel --output-dir wheelhouse + if (-not (Test-Path wheelhouse/*.whl)) { throw "Wheel was not created" } + working-directory: ./quaddtype - # - uses: actions/upload-artifact@v4 - # with: - # path: ./quaddtype/wheelhouse/*.whl - # name: wheels-windows-${{ matrix.architecture }} + - uses: actions/upload-artifact@v4 + with: + path: ./quaddtype/wheelhouse/*.whl + name: wheels-windows-${{ matrix.architecture }} # publish_to_pypi: # name: Publish to PyPI From 15abf9301f43047a97b8a88081780b97a584d1c4 Mon Sep 17 00:00:00 2001 From: swayaminsync Date: Wed, 27 Aug 2025 05:46:14 +0530 Subject: [PATCH 13/13] and they all worked --- .github/workflows/build_wheels.yml | 296 ++++++++++++++--------------- 1 file changed, 148 insertions(+), 148 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 0583acde..20af6dbe 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -16,149 +16,149 @@ on: workflow_dispatch: jobs: - # build_wheels_linux: - # name: Build wheels on Linux - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive + build_wheels_linux: + name: Build wheels on Linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: ">=3.11.0" + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ">=3.11.0" - # - name: Verify QuadBLAS submodule - # run: | - # ls -la quaddtype/numpy_quaddtype/QBLAS/ - # ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ + - name: Verify QuadBLAS submodule + run: | + ls -la quaddtype/numpy_quaddtype/QBLAS/ + ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - # - name: Install cibuildwheel - # run: pip install cibuildwheel==3.1.4 + - name: Install cibuildwheel + run: pip install cibuildwheel==3.1.4 - # - name: Build wheels - # env: - # CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp313t-manylinux_x86_64 cp314-manylinux_x86_64 cp314t-manylinux_x86_64" - # CIBW_ENABLE: cpython-prerelease cpython-freethreading - # CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 - # CIBW_BUILD_VERBOSITY: "3" - # CIBW_BEFORE_ALL: | - # yum update -y - # yum install -y cmake gcc gcc-c++ make git pkgconfig - # # Install SLEEF in container - # git clone --branch 3.8 https://github.com/shibatch/sleef.git - # cd sleef - # cmake -S . -B build \ - # -DSLEEF_BUILD_QUAD:BOOL=ON \ - # -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ - # -DCMAKE_POSITION_INDEPENDENT_CODE=ON - # cmake --build build/ --clean-first -j - # cmake --install build --prefix /usr/local - # CIBW_ENVIRONMENT: > - # CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" - # CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include -fext-numeric-literals $CXXFLAGS" - # LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib -fopenmp $LDFLAGS" - # LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH" - # PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" - # CIBW_REPAIR_WHEEL_COMMAND: | - # auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel} - # CIBW_TEST_COMMAND: | - # pip install {package}[test] - # if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then - # pytest --parallel-threads=10 --iterations=10 {project}/tests - # else - # pytest -s {project}/tests - # fi - # CIBW_TEST_EXTRAS: "test" - # run: | - # python -m cibuildwheel --output-dir wheelhouse - # working-directory: ./quaddtype + - name: Build wheels + env: + CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp313t-manylinux_x86_64 cp314-manylinux_x86_64 cp314t-manylinux_x86_64" + CIBW_ENABLE: cpython-prerelease cpython-freethreading + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + CIBW_BUILD_VERBOSITY: "3" + CIBW_BEFORE_ALL: | + yum update -y + yum install -y cmake gcc gcc-c++ make git pkgconfig + # Install SLEEF in container + git clone --branch 3.8 https://github.com/shibatch/sleef.git + cd sleef + cmake -S . -B build \ + -DSLEEF_BUILD_QUAD:BOOL=ON \ + -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + cmake --build build/ --clean-first -j + cmake --install build --prefix /usr/local + CIBW_ENVIRONMENT: > + CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" + CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include -fext-numeric-literals $CXXFLAGS" + LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -Wl,-rpath,/usr/local/lib64 -Wl,-rpath,/usr/local/lib -fopenmp $LDFLAGS" + LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH" + PKG_CONFIG_PATH="/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" + CIBW_REPAIR_WHEEL_COMMAND: | + auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel} + CIBW_TEST_COMMAND: | + pip install {package}[test] + if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then + pytest --parallel-threads=10 --iterations=10 {project}/tests + else + pytest -s {project}/tests + fi + CIBW_TEST_EXTRAS: "test" + run: | + python -m cibuildwheel --output-dir wheelhouse + working-directory: ./quaddtype - # - uses: actions/upload-artifact@v4 - # with: - # path: ./quaddtype/wheelhouse/*.whl - # name: wheels-linux + - uses: actions/upload-artifact@v4 + with: + path: ./quaddtype/wheelhouse/*.whl + name: wheels-linux - # build_wheels_macos: - # name: Build wheels on ${{ matrix.os }} - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [macos-13, macos-14] + build_wheels_macos: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-13, macos-14] - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: ">=3.11.0" + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ">=3.11.0" - # - name: Install dependencies - # run: | - # brew install cmake libomp git + - name: Install dependencies + run: | + brew install cmake libomp git - # - name: Install SLEEF - # env: - # MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-13' && '13.0' || '14.0' }} - # run: | - # git clone --branch 3.8 https://github.com/shibatch/sleef.git - # cd sleef - # cmake -S . -B build \ - # -DSLEEF_BUILD_QUAD:BOOL=ON \ - # -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ - # -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - # -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.os == 'macos-13' && '13.0' || '14.0' }} \ - # -DCMAKE_INSTALL_RPATH="@loader_path/../lib" \ - # -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON - # cmake --build build/ --clean-first -j - # sudo cmake --install build --prefix /usr/local + - name: Install SLEEF + env: + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-13' && '13.0' || '14.0' }} + run: | + git clone --branch 3.8 https://github.com/shibatch/sleef.git + cd sleef + cmake -S . -B build \ + -DSLEEF_BUILD_QUAD:BOOL=ON \ + -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.os == 'macos-13' && '13.0' || '14.0' }} \ + -DCMAKE_INSTALL_RPATH="@loader_path/../lib" \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON + cmake --build build/ --clean-first -j + sudo cmake --install build --prefix /usr/local - # - name: Verify QuadBLAS submodule - # run: | - # ls -la quaddtype/numpy_quaddtype/QBLAS/ - # ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ + - name: Verify QuadBLAS submodule + run: | + ls -la quaddtype/numpy_quaddtype/QBLAS/ + ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/ - # - name: Installing Python dependencies - # run: | - # pip install -U pip - # pip install cibuildwheel==3.1.4 - # pip install pytest-run-parallel + - name: Installing Python dependencies + run: | + pip install -U pip + pip install cibuildwheel==3.1.4 + pip install pytest-run-parallel - # - name: Build wheels - # env: - # CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*" - # CIBW_ENABLE: cpython-prerelease cpython-freethreading - # CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }} - # CIBW_BUILD_VERBOSITY: "3" - # CIBW_ENVIRONMENT: > - # MACOSX_DEPLOYMENT_TARGET="${{ matrix.os == 'macos-13' && '13.0' || '14.0' }}" - # DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH" - # CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" - # CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CXXFLAGS" - # LDFLAGS="-L/usr/local/lib $LDFLAGS" - # PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" - # CIBW_REPAIR_WHEEL_COMMAND: > - # delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} - # CIBW_TEST_COMMAND: | - # pip install {package}[test] - # if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then - # pytest --parallel-threads=10 --iterations=10 {project}/tests - # else - # pytest -s {project}/tests - # fi - # CIBW_TEST_EXTRAS: "test" - # run: | - # python -m cibuildwheel --output-dir wheelhouse - # working-directory: ./quaddtype + - name: Build wheels + env: + CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*" + CIBW_ENABLE: cpython-prerelease cpython-freethreading + CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }} + CIBW_BUILD_VERBOSITY: "3" + CIBW_ENVIRONMENT: > + MACOSX_DEPLOYMENT_TARGET="${{ matrix.os == 'macos-13' && '13.0' || '14.0' }}" + DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH" + CFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CFLAGS" + CXXFLAGS="-I/usr/local/include -I{project}/numpy_quaddtype/QBLAS/include $CXXFLAGS" + LDFLAGS="-L/usr/local/lib $LDFLAGS" + PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" + CIBW_REPAIR_WHEEL_COMMAND: > + delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + CIBW_TEST_COMMAND: | + pip install {package}[test] + if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then + pytest --parallel-threads=10 --iterations=10 {project}/tests + else + pytest -s {project}/tests + fi + CIBW_TEST_EXTRAS: "test" + run: | + python -m cibuildwheel --output-dir wheelhouse + working-directory: ./quaddtype - # - uses: actions/upload-artifact@v4 - # with: - # path: ./quaddtype/wheelhouse/*.whl - # name: wheels-${{ matrix.os }} + - uses: actions/upload-artifact@v4 + with: + path: ./quaddtype/wheelhouse/*.whl + name: wheels-${{ matrix.os }} # disabling QBLAS optimization for windows due to incompatibility with MSVC build_wheels_windows: @@ -247,26 +247,26 @@ jobs: path: ./quaddtype/wheelhouse/*.whl name: wheels-windows-${{ matrix.architecture }} - # publish_to_pypi: - # name: Publish to PyPI - # needs: [build_wheels_linux, build_wheels_macos, build_wheels_windows] - # runs-on: ubuntu-latest - # if: startsWith(github.ref, 'refs/tags/quaddtype-v') + publish_to_pypi: + name: Publish to PyPI + needs: [build_wheels_linux, build_wheels_macos, build_wheels_windows] + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/quaddtype-v') - # environment: - # name: quadtype_release - # url: https://pypi.org/p/numpy-quaddtype + environment: + name: quadtype_release + url: https://pypi.org/p/numpy-quaddtype - # permissions: - # id-token: write # IMPORTANT: mandatory for trusted publishing + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing - # steps: - # - name: Download all workflow run artifacts - # uses: actions/download-artifact@v4 - # with: - # path: dist + steps: + - name: Download all workflow run artifacts + uses: actions/download-artifact@v4 + with: + path: dist - # - name: Publish to PyPI - # uses: pypa/gh-action-pypi-publish@release/v1 - # with: - # packages-dir: dist/* + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist/*