diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 529caaa1..6b4898cf 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -34,18 +34,9 @@ jobs: with: python-version: '3.11' - - name: Setup - run: pip install wheel - - uses: ilammy/msvc-dev-cmd@v1 if: startsWith(matrix.os, 'windows') - - name: Run Windows Preinstall Build - if: startsWith(matrix.os, 'windows') - run: | - choco install vcpython27 -f -y - ci\install_libspatialindex.bat - - name: Build wheels uses: pypa/cibuildwheel@v2.19.2 diff --git a/pyproject.toml b/pyproject.toml index 8c78e209..cd32a1bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,7 @@ rtree = ["py.typed"] [tool.cibuildwheel] build = "cp39-*" build-verbosity = 3 +before-all = "pip install wheel" repair-wheel-command = "python scripts/repair_wheel.py -w {dest_dir} {wheel}" test-requires = "tox" test-command = "tox --conf {project} --installpkg {wheel}" @@ -62,14 +63,14 @@ test-skip = [ archs = ["auto", "aarch64"] before-build = [ "yum install -y cmake libffi-devel", - "bash {project}/ci/install_libspatialindex.bash", + "sh {project}/scripts/install_libspatialindex.sh", ] [[tool.cibuildwheel.overrides]] select = "*-musllinux*" before-build = [ "apk add cmake libffi-dev", - "bash {project}/ci/install_libspatialindex.bash", + "sh {project}/scripts/install_libspatialindex.sh", ] [tool.cibuildwheel.macos] @@ -77,11 +78,14 @@ archs = ["x86_64", "arm64"] environment = { MACOSX_DEPLOYMENT_TARGET="10.9" } before-build = [ "brew install coreutils cmake", - "bash {project}/ci/install_libspatialindex.bash", + "sh {project}/scripts/install_libspatialindex.sh", ] [tool.cibuildwheel.windows] archs = ["AMD64"] +before-build = [ + "call {project}\\scripts\\install_libspatialindex.bat", +] [tool.coverage.report] # Ignore warnings for overloads diff --git a/ci/install_libspatialindex.bat b/scripts/install_libspatialindex.bat old mode 100755 new mode 100644 similarity index 100% rename from ci/install_libspatialindex.bat rename to scripts/install_libspatialindex.bat diff --git a/ci/install_libspatialindex.bash b/scripts/install_libspatialindex.sh similarity index 87% rename from ci/install_libspatialindex.bash rename to scripts/install_libspatialindex.sh index 50084035..e4fd4c7c 100755 --- a/ci/install_libspatialindex.bash +++ b/scripts/install_libspatialindex.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -xe # A simple script to install libspatialindex from a Github Release @@ -32,7 +32,12 @@ rm -f $VERSION.zip curl -LOs --retry 5 --retry-max-time 120 https://github.com/libspatialindex/libspatialindex/archive/${VERSION}.zip # check the file hash -echo "${SHA256} ${VERSION}.zip" | sha256sum -c - +if [ "$(uname)" = "Darwin" ] +then + echo "${SHA256} ${VERSION}.zip" | shasum -a 256 -c - +else + echo "${SHA256} ${VERSION}.zip" | sha256sum -c - +fi rm -rf "libspatialindex-${VERSION}" unzip -q $VERSION @@ -43,7 +48,7 @@ cd build printenv -if [ "$(uname)" == "Darwin" ]; then +if [ "$(uname)" = "Darwin" ]; then CMAKE_ARGS="-D CMAKE_OSX_ARCHITECTURES=${ARCHFLAGS##* } \ -D CMAKE_INSTALL_RPATH=@loader_path" fi