Skip to content

Commit

Permalink
Run py310 build on Big Sur and everything else on MacOS-latest. Bring…
Browse files Browse the repository at this point in the history
… back py36.
  • Loading branch information
nvictus committed Dec 27, 2021
1 parent e5add3b commit 83dcb22
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 5 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/buildwheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

buildwheel-macos:
name: Build wheels for MacOS
runs-on: macos-11
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- run: mkdir wheels
Expand All @@ -32,3 +32,15 @@ jobs:
with:
name: macos-wheels
path: wheels

buildwheel-macos11:
name: Build wheels supported only on MacOS 11 Big Sur
runs-on: macos-11
steps:
- uses: actions/checkout@v1
- run: mkdir wheels
- run: bash ci/buildwheel_macos11.sh; mv /tmp/wheelhouse/*.whl wheels;
- uses: actions/upload-artifact@v1
with:
name: macos11-wheels
path: wheels
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This provides read-level access to local and remote bigWig and bigBed files but

## Installation ##

Wheels for `pybbi` are available on PyPI for Python 3.7, 3.8, 3.9, 3.10 on Linux and Mac OSX platforms under x86-64 architecture.
Wheels for `pybbi` are available on PyPI for Python 3.6, 3.7, 3.8, 3.9, 3.10 on Linux and Mac OSX platforms under x86-64 architecture.

```
$ pip install pybbi
Expand Down
4 changes: 2 additions & 2 deletions ci/buildwheel_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ curl -L -o /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py

export C_INCLUDE_PATH="/usr/local/include/libpng:/usr/local/opt/openssl/include:$C_INCLUDE_PATH"

PY_VERSIONS=("3.7" "3.8" "3.9" "3.10")
PY_VERSIONS=("3.6" "3.7" "3.8" "3.9")
PKG_URLS=(
"https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.6.pkg"
"https://www.python.org/ftp/python/3.7.5/python-3.7.5-macosx10.6.pkg"
"https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg"
"https://www.python.org/ftp/python/3.9.9/python-3.9.9-macosx10.9.pkg"
"https://www.python.org/ftp/python/3.10.1/python-3.10.1-macos11.pkg"
)
len=${#PKG_URLS[@]}

Expand Down
58 changes: 58 additions & 0 deletions ci/buildwheel_macos11.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
# This bash script is based on https://github.com/joerick/cibuildwheel
set -o errexit
set -o xtrace

mkdir -p /tmp/located
mkdir -p /tmp/delocated
mkdir -p /tmp/wheelhouse

brew install pkg-config openssl libpng

curl -L -o /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py

export C_INCLUDE_PATH="/usr/local/include/libpng:/usr/local/opt/openssl/include:$C_INCLUDE_PATH"

PY_VERSIONS=("3.10")
PKG_URLS=(
"https://www.python.org/ftp/python/3.10.1/python-3.10.1-macos11.pkg"
)
len=${#PKG_URLS[@]}

for (( i=0; i<$len; i++ )); do
PY_VERSION=${PY_VERSIONS[$i]}
PKG_URL=${PKG_URLS[$i]}
PY_BIN="/Library/Frameworks/Python.framework/Versions/$PY_VERSION/bin"

rm -rf /tmp/located* /tmp/delocated/*

# Install python
curl -L -o /tmp/Python.pkg $PKG_URL
sudo installer -pkg /tmp/Python.pkg -target /

# Install pip
PYTHON=$PY_BIN/python3
$PYTHON /tmp/get-pip.py --no-setuptools --no-wheel

# Install wheel, delocate
PIP=$PY_BIN/pip3
$PIP install --upgrade setuptools wheel delocate

# Build the package in-place
$PIP install numpy cython
$PIP install -v -e .

# Quick test
$PYTHON -c "import bbi"

# Build the wheel
$PIP wheel -v -w /tmp/located --no-deps .

# Repair the wheel
built_wheel=(/tmp/located/*.whl)
$PY_BIN/delocate-listdeps $built_wheel && $PY_BIN/delocate-wheel -w /tmp/delocated $built_wheel

# Move it to output
repaired_wheels=(/tmp/delocated/*.whl)
mv ${repaired_wheels[@]} /tmp/wheelhouse
done
2 changes: 1 addition & 1 deletion ci/buildwheel_manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ git clone https://github.com/nvictus/patchelf.git /patchelf
cd /patchelf && ./bootstrap.sh && ./configure && make && make install

# let's go
PY_VERSIONS='cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
PY_VERSIONS='cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'

cd /project

Expand Down

0 comments on commit 83dcb22

Please sign in to comment.