-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild_wheels_osx.sh
More file actions
executable file
·66 lines (51 loc) · 1.99 KB
/
build_wheels_osx.sh
File metadata and controls
executable file
·66 lines (51 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
set -e
set -x
BRANCH=$(cat ./BRANCH)
# Just to be sure on homebrew.
export PATH=/usr/local/bin:$PATH
brew update || echo "Failed to update brew"
brew install gsl || brew upgrade gsl
brew install python@3 || echo "Failed to install python3"
brew install python@2 || echo "Failed to install python2"
# Following are to remove numpy; It is breaking the build on Xcode9.4.
# brew uninstall gdal postgis || echo "Failed to uninstall gdal/postgis"
# brew uninstall numpy || echo "Failed to uninstall numpy"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
MOOSE_SOURCE_DIR=`pwd`/moose-core
if [ ! -d $MOOSE_SOURCE_DIR ]; then
git clone https://github.com/dilawar/moose-core -b $BRANCH --depth 10
fi
cd moose-core && git pull
WHEELHOUSE=$HOME/wheelhouse
rm -rf $WHEELHOUSE && mkdir -p $WHEELHOUSE
# Current version 0.7.4 seems to be broken with python3.7 .
# See https://travis-ci.org/BhallaLab/deploy/jobs/435219820
/usr/local/bin/python3 -m pip install delocate
DELOCATE_WHEEL=/usr/local/bin/delocate-wheel
# Always prefer brew version.
for _py in 3 2; do
PYTHON=/usr/local/bin/python$_py
if [ ! -f $PYTHON ]; then
echo "Not found $PYTHON"
continue
fi
$PYTHON -m pip install setuptools --upgrade --user
$PYTHON -m pip install wheel --upgrade --user
$PYTHON -m pip install numpy --upgrade --user
$PYTHON -m pip install twine --upgrade --user
PLATFORM=$($PYTHON -c "import distutils.util; print(distutils.util.get_platform())")
(
cd $MOOSE_SOURCE_DIR
$PYTHON setup.py build_ext
export GSL_USE_STATIC_LIBRARIES=1
$PYTHON setup.py bdist_wheel --skip-build
$DELOCATE_WHEEL -v dist/*.whl -w $WHEELHOUSE
rm -rf dist/*.whl
)
if [ ! -z "$PYMOOSE_PYPI_PASSWORD" ]; then
echo "Did you test the wheels? I am uploading anyway ..."
$PYTHON -m twine upload -u bhallalab -p $PYMOOSE_PYPI_PASSWORD \
$WHEELHOUSE/pymoose*.whl || echo "Failed to upload to PyPi"
fi
done