diff --git a/.github/scripts/build-macos.sh b/.github/scripts/build-macos.sh index 3dd341d..f6997cd 100755 --- a/.github/scripts/build-macos.sh +++ b/.github/scripts/build-macos.sh @@ -37,11 +37,11 @@ pip freeze # By default, wheels are tagged with the architecture of the Python # installation, which would produce universal2 even if only building # for x86_64. The following line overrides that behavior. -export _PYTHON_HOST_PLATFORM="macosx-${MACOS_MIN_VERSION}-$ARCH" +export _PYTHON_HOST_PLATFORM="macosx-${MACOS_MIN_VERSION}-${PYTHON_ARCH}" export CC=clang export CXX=clang++ -export CFLAGS="-arch $ARCH" +export CFLAGS="-arch ${PYTHON_ARCH}" export CXXFLAGS=$CFLAGS export LDFLAGS=$CFLAGS export ARCHFLAGS=$CFLAGS @@ -54,7 +54,7 @@ python setup.py bdist_wheel # no shared library dependencies that have to be bundled. delocate-listdeps --all --depending dist/*.whl # lists library dependencies -delocate-wheel --verbose --require-archs=$ARCH dist/*.whl # copies library dependencies into wheel +delocate-wheel --verbose --require-archs=${PYTHON_ARCH} dist/*.whl # copies library dependencies into wheel delocate-listdeps --all --depending dist/*.whl # verify # Dump target versions of dependend libraries. diff --git a/.github/scripts/build-windows.ps1 b/.github/scripts/build-windows.ps1 index 1525998..ec6bcc1 100644 --- a/.github/scripts/build-windows.ps1 +++ b/.github/scripts/build-windows.ps1 @@ -22,7 +22,6 @@ function Initialize-Python { } # Check Python version/arch exec { python -c "import platform; assert platform.python_version().startswith('$env:PYTHON_VERSION')" } - exec { python -c "import struct; assert struct.calcsize('P') * 8 == $env:PYTHON_ARCH" } } function Create-VEnv { @@ -63,8 +62,8 @@ function Exit-VEnv { if (!$env:PYTHON_VERSION) { throw "PYTHON_VERSION env var missing, must be x.y" } -if ($env:PYTHON_ARCH -ne '32' -and $env:PYTHON_ARCH -ne '64') { - throw "PYTHON_ARCH env var must be 32 or 64" +if ($env:PYTHON_ARCH -ne 'x86' -and $env:PYTHON_ARCH -ne 'x86_64') { + throw "PYTHON_ARCH env var must be x86 or x86_64" } if (!$env:NUMPY_VERSION) { throw "NUMPY_VERSION env var missing" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92194ed..2955cb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,64 +40,68 @@ jobs: - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 + python-arch: 'x86_64' python-version: '3.9' numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 + python-arch: 'x86_64' python-version: '3.10' numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 + python-arch: 'x86_64' python-version: '3.11' numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 + python-arch: 'x86_64' python-version: '3.12' numpy-version: '2.0.*' - os-image: macos-12 os-name: mac - arch: x86_64 + python-arch: x86_64 macos-min-version: '10.9' python-version: '3.9' numpy-version: '2.0.*' - os-image: macos-12 os-name: mac - arch: x86_64 + python-arch: x86_64 macos-min-version: '10.9' python-version: '3.10' numpy-version: '2.0.*' - os-image: macos-12 os-name: mac - arch: x86_64 + python-arch: x86_64 macos-min-version: '10.9' python-version: '3.11' numpy-version: '2.0.*' - os-image: macos-12 os-name: mac - arch: x86_64 + python-arch: x86_64 macos-min-version: '10.9' python-version: '3.12' numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac - arch: arm64 + python-arch: arm64 macos-min-version: '11.0' python-version: '3.10' numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac - arch: arm64 + python-arch: arm64 macos-min-version: '11.0' python-version: '3.11' numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac - arch: arm64 + python-arch: arm64 macos-min-version: '11.0' python-version: '3.12' numpy-version: '2.0.*' @@ -105,22 +109,22 @@ jobs: - os-image: windows-latest os-name: windows python-version: '3.9' - python-arch: '64' + python-arch: 'x86_64' numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.10' - python-arch: '64' + python-arch: 'x86_64' numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.11' - python-arch: '64' + python-arch: 'x86_64' numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.12' - python-arch: '64' + python-arch: 'x86_64' numpy-version: '2.0.*' permissions: @@ -171,7 +175,7 @@ jobs: if: matrix.config.os-name == 'mac' run: .github/scripts/build-macos.sh env: - ARCH: ${{ matrix.config.arch }} + PYTHON_ARCH: ${{ matrix.config.python-arch }} MACOS_MIN_VERSION: ${{ matrix.config.macos-min-version }} PYTHON_VERSION: ${{ matrix.config.python-version }} NUMPY_VERSION: ${{ matrix.config.numpy-version }} @@ -179,7 +183,7 @@ jobs: - name: Store wheel as artifact uses: actions/upload-artifact@v4 with: - name: wheels + name: wheel-${{ matrix.config.os-name }}-${{ matrix.config.python-arch }}-${{ matrix.config.python-version }} path: dist # - name: Perform CodeQL Analysis @@ -198,64 +202,68 @@ jobs: - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 + python-arch: 'x86_64' python-version: '3.9' numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 + python-arch: 'x86_64' python-version: '3.10' numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 + python-arch: 'x86_64' python-version: '3.11' numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 + python-arch: 'x86_64' python-version: '3.12' numpy-version: '2.0.*' - os-image: macos-12 os-name: mac - arch: x86_64 + python-arch: x86_64 macos-min-version: '10.9' python-version: '3.9' numpy-version: '2.0.*' - os-image: macos-12 os-name: mac - arch: x86_64 + python-arch: x86_64 macos-min-version: '10.9' python-version: '3.10' numpy-version: '2.0.*' - os-image: macos-12 os-name: mac - arch: x86_64 + python-arch: x86_64 macos-min-version: '10.9' python-version: '3.11' numpy-version: '2.0.*' - os-image: macos-12 os-name: mac - arch: x86_64 + python-arch: x86_64 macos-min-version: '10.9' python-version: '3.12' numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac - arch: arm64 + python-arch: arm64 macos-min-version: '11.0' python-version: '3.10' numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac - arch: arm64 + python-arch: arm64 macos-min-version: '11.0' python-version: '3.11' numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac - arch: arm64 + python-arch: arm64 macos-min-version: '11.0' python-version: '3.12' numpy-version: '2.0.*' @@ -263,22 +271,22 @@ jobs: - os-image: windows-latest os-name: windows python-version: '3.9' - python-arch: '64' + python-arch: 'x86_64' numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.10' - python-arch: '64' + python-arch: 'x86_64' numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.11' - python-arch: '64' + python-arch: 'x86_64' numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.12' - python-arch: '64' + python-arch: 'x86_64' numpy-version: '2.0.*' runs-on: ${{ matrix.config.os-image }} @@ -291,10 +299,10 @@ jobs: with: submodules: true - - name: Download wheels from artifact storage + - name: Download wheel from artifact storage uses: actions/download-artifact@v4 with: - name: wheels + name: wheel-${{ matrix.config.os-name }}-${{ matrix.config.python-arch }}-${{ matrix.config.python-version }} path: dist - name: Test wheel (Linux) @@ -333,14 +341,14 @@ jobs: .github/scripts/install-macos-obs-virtual-cam.sh .github/scripts/test-macos.sh env: - ARCH: ${{ matrix.config.arch }} + PYTHON_ARCH: ${{ matrix.config.python-arch }} PYTHON_VERSION: ${{ matrix.config.python-version }} - name: Store test captures as artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: - name: test_captures + name: test_captures-${{ matrix.config.os-name }}-${{ matrix.config.python-arch }}-${{ matrix.config.python-version }} path: 'tmp_for_test/*.png' if-no-files-found: ignore @@ -360,7 +368,8 @@ jobs: - name: Download wheels from artifact storage uses: actions/download-artifact@v4 with: - name: wheels + pattern: wheel-* + merge-multiple: true path: dist - name: Install from wheel @@ -372,9 +381,8 @@ jobs: run: sphinx-build -b html docs dist-docs - name: Store docs HTML as artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-pages-artifact@v3 with: - name: docs path: dist-docs publish-wheels: @@ -388,7 +396,8 @@ jobs: - name: Download wheels from artifact storage uses: actions/download-artifact@v4 with: - name: wheels + pattern: wheel-* + merge-multiple: true path: dist - name: Setup Python @@ -407,19 +416,14 @@ jobs: needs: [publish-wheels] permissions: - contents: write + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source - steps: - - name: Download docs HTML from artifact storage - uses: actions/download-artifact@v4 - with: - name: docs - path: dist-docs + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} - # TODO replace with https://github.com/actions/deploy-pages once out of beta - - name: Upload docs to GitHub Pages - uses: peaceiris/actions-gh-pages@47a6d63ea8b47b19328e258563aa1fbe224c0a23 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PUBLISH_BRANCH: gh-pages - PUBLISH_DIR: ./dist-docs + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4