Skip to content

Commit 67409c7

Browse files
committed
DEV: add NOSYS guard variable to travis script.
NOSYS is `true` when building for Anaconda and `false` when building with native Linux packages or with homebrew system on Mac OS X. The `$NOSYS || cmd` prefix is thus used for commands relevant to either of native Linux or homebrew builds.
1 parent 9650f18 commit 67409c7

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

.travis.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ before_install:
2626
- umask 022
2727
- git fetch origin --tags
2828
- MYPYTHON=python; MYPIP=pip
29-
- NOAPT=true; NOBREW=true; NOMC=true
29+
- NOSYS=true; NOAPT=true; NOBREW=true; NOMC=true
3030
- if ${MYUSEMC}; then
3131
NOMC=false;
3232
elif [[ ${TRAVIS_OS_NAME} == linux ]]; then
33-
NOAPT=false;
33+
NOAPT=false; NOSYS=false;
3434
MYPIPFLAGS="--user";
3535
elif [[ ${TRAVIS_OS_NAME} == osx ]]; then
36-
NOBREW=false;
36+
NOBREW=false; NOSYS=false;
3737
MYPYTHON=python3;
3838
MYPIP=pip3;
3939
MYPIPFLAGS="--user";
@@ -78,11 +78,6 @@ before_install:
7878
python-setuptools python-numpy scons
7979
build-essential python-dev libboost-all-dev
8080
python-pip
81-
- $NOAPT || devutils/makesdist
82-
- $NOAPT || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)"
83-
- $NOAPT || pushd ~/pkgs
84-
- $NOAPT || git clone https://github.com/diffpy/libobjcryst.git
85-
- $NOAPT || popd
8681

8782
- $NOBREW || test "${TRAVIS_OS_NAME}" = "osx" || exit $?
8883
- $NOBREW || brew update
@@ -91,11 +86,12 @@ before_install:
9186
- $NOBREW || brew install boost-python --with-python3
9287
- $NOBREW || brew tap homebrew/python
9388
- $NOBREW || brew install numpy --without-python --with-python3
94-
- $NOBREW || devutils/makesdist
95-
- $NOBREW || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)"
96-
- $NOBREW || pushd ~/pkgs
97-
- $NOBREW || git clone https://github.com/diffpy/libobjcryst.git
98-
- $NOBREW || popd
89+
90+
- $NOSYS || devutils/makesdist
91+
- $NOSYS || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)"
92+
- $NOSYS || pushd ~/pkgs
93+
- $NOSYS || git clone https://github.com/diffpy/libobjcryst.git
94+
- $NOSYS || popd
9995

10096
install:
10197
- $NOMC || conda build --python=${MYPYTHON_VERSION} conda-recipe
@@ -104,13 +100,11 @@ install:
104100
- $NOMC || source activate testenv
105101
- $NOMC || conda install --yes --use-local --file=/tmp/mypackage.txt
106102

107-
- $NOAPT || $MYPIP install $MYPIPFLAGS coverage
108-
- $NOAPT || sudo scons -C ~/pkgs/libobjcryst install
109-
- $NOAPT || $MYPIP install $MYPIPFLAGS --user "${MYTARBUNDLE}"
110-
111-
- $NOBREW || $MYPIP install $MYPIPFLAGS coverage
112-
- $NOBREW || scons -C ~/pkgs/libobjcryst install
113-
- $NOBREW || $MYPIP install $MYPIPFLAGS "${MYTARBUNDLE}"
103+
- MYSUDO=
104+
- $NOAPT || MYSUDO=sudo
105+
- $NOSYS || $MYPIP install $MYPIPFLAGS coverage
106+
- $NOSYS || $MYSUDO scons -C ~/pkgs/libobjcryst install
107+
- $NOSYS || $MYPIP install $MYPIPFLAGS "${MYTARBUNDLE}"
114108

115109
- cd ${MYRUNDIR}
116110
- MYGIT_REV=$($MYPYTHON -c "import ${MYNAME}.version as v; print(v.__gitsha__)")

0 commit comments

Comments
 (0)