forked from opencobra/cobrapy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.sh
61 lines (57 loc) · 2.06 KB
/
config.sh
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
# Define custom utilities
# Test for OSX with [ -n "$IS_OSX" ]
function pre_build {
# Any stuff that you need to do before you start building the wheels
# Runs in the root directory of this repository.
if [ -n "$IS_OSX" ]; then
export CC=clang
export CXX=clang++
export CFLAGS="-fPIC -O3 -arch i386 -arch x86_64 -g -DNDEBUG -mmacosx-version-min=10.6"
else
yum install -y libxslt libxml2 libxml2-devel libxslt-devel
fi
curl -O http://ftp.gnu.org/gnu/glpk/glpk-4.61.tar.gz
tar xzf glpk-4.61.tar.gz
(cd glpk-4.61 \
&& ./configure --disable-reentrant \
&& make \
&& make install)
pip install cython
cython -a cobra/solvers/cglpk.pyx
export PATH="$PATH:/usr/local/bin"
}
function build_wheel {
# Set default building method to pip
build_bdist_wheel $@
# since swiglpk doesn't have wheels, we currently must keep glpk
# installed for testing
# (cd glpk-4.60 && make uninstall)
}
function run_tests_in_repo {
# Run tests from within source repo
# trick is to run the /installed/ package
# coverage run --source=cobra setup.py test
if [ -n "$IS_OSX" ]; then
echo -e " testing for mac... "
else
wget --no-check-certificate \
https://opencobra.github.io/pypi_cobrapy_travis/esolver.gz
gzip -f -d esolver.gz
chmod +x esolver
export PATH=$PWD:$PATH
# which pkg-config
# pip install matplotlib
fi
mkdir -p $HOME/.config/matplotlib
echo 'backend: Agg' >> $HOME/.config/matplotlib/matplotlibrc
COVERAGEXML=`python -c "import os,sys; print(os.path.realpath('coverage.xml'))"`
COVERAGERC=`python -c "import os,sys; print(os.path.realpath('../.coveragerc'))"`
(pytest --pyargs -v -rsx --cov=cobra --cov-report=xml:${COVERAGEXML} \
--cov-config=${COVERAGERC} --benchmark-skip cobra &&
mv ${COVERAGEXML} ..)
}
function run_tests {
# Runs tests on installed distribution from an empty directory
pip install python-libsbml==5.12.1 -f https://s3.eu-central-1.amazonaws.com/moonlight-science/wheelhouse/index.html --no-cache-dir
run_tests_in_repo
}