Skip to content

Commit

Permalink
CI/BLD: move CIBW commands to pyproject.toml, move scripts (#328)
Browse files Browse the repository at this point in the history
* CI/BLD: move CIBW commands to pyproject.toml, move scripts

* Use shasum on macOS, use = for POSIX compliance

---------

Co-authored-by: Adam J. Stewart <[email protected]>
  • Loading branch information
mwtoews and adamjstewart authored Jul 13, 2024
1 parent 45e1aaf commit 184270d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]

Expand Down
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -62,26 +63,29 @@ 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]
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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -xe

# A simple script to install libspatialindex from a Github Release
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 184270d

Please sign in to comment.