88
99env :
1010 - MYUSEMC=true MYPYTHON_VERSION=2.7
11+ - MYUSEMC=true MYPYTHON_VERSION=3.4
12+ - MYUSEMC=true MYPYTHON_VERSION=3.5
13+ - MYUSEMC=true MYPYTHON_VERSION=3.6
1114 - MYUSEMC=false
1215
13- matrix :
14- exclude :
15- - os : osx
16- env : MYUSEMC=false
17-
1816git :
1917 depth : 999999
2018
@@ -26,10 +24,17 @@ before_install:
2624 - MYNAME=diffpy.srreal
2725 - umask 022
2826 - git fetch origin --tags
27+ - MYPYTHON=python; MYPIP=pip
28+ - NOSYS=true; NOAPT=true; NOBREW=true; NOMC=true
2929 - if ${MYUSEMC}; then
30- NOAPT=true; NOMC=false;
31- else
32- NOAPT=false; NOMC=true;
30+ NOMC=false;
31+ elif [[ ${TRAVIS_OS_NAME} == linux ]]; then
32+ NOAPT=false; NOSYS=false;
33+ MYPIPFLAGS="--user";
34+ elif [[ ${TRAVIS_OS_NAME} == osx ]]; then
35+ NOBREW=false; NOSYS=false;
36+ MYPYTHON=python3;
37+ MYPIP=pip3;
3338 MYPIPFLAGS="--user";
3439 fi
3540 - MYMCREPO=https://repo.continuum.io/miniconda
@@ -54,23 +59,36 @@ before_install:
5459 - $NOMC || popd
5560 - $NOMC || source ~/mc/bin/activate root
5661 - $NOMC || conda update --yes conda
57- - $NOMC || conda install --yes conda-build jinja2
62+ - $NOMC || conda install --yes conda-build jinja2 scons numpy
63+ # Make scons available globally.
64+ - $NOMC || mkdir -p ~/bin
65+ - $NOMC || cp ~/mc/bin/scons ~/bin/
5866 - $NOMC || conda create --name=testenv --yes python=${MYPYTHON_VERSION} coverage
5967 - $NOMC || conda config --add channels diffpy
68+ # FIXME - keep just the "diffpy" channel for public release.
69+ - $NOMC || conda config --add channels diffpy/channel/dev
6070
6171 - $NOAPT || test "${TRAVIS_OS_NAME}" = "linux" || exit $?
6272 - $NOAPT || sudo apt-get update -qq
6373 - $NOAPT || sudo apt-get install -y
6474 libgsl0-dev libboost-all-dev python-dev
6575 python-setuptools python-numpy python-pyparsing
6676 python-lxml python-pip build-essential scons
67- - $NOAPT || devutils/makesdist
68- - $NOAPT || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)"
69- - $NOAPT || pushd ~/pkgs
70- - $NOAPT || git clone https://github.com/diffpy/libObjCryst.git
71- - $NOAPT || git clone https://github.com/diffpy/libdiffpy.git
72- - $NOAPT || popd
7377
78+ - $NOBREW || test "${TRAVIS_OS_NAME}" = "osx" || exit $?
79+ - $NOBREW || brew update
80+ - $NOBREW || brew install gsl
81+ - $NOBREW || brew install scons
82+ - $NOBREW || brew install python3
83+ - $NOBREW || brew install boost-python --with-python3
84+ - $NOBREW || brew install numpy --without-python --with-python3
85+
86+ - $NOSYS || devutils/makesdist
87+ - $NOSYS || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)"
88+ - $NOSYS || pushd ~/pkgs
89+ - $NOSYS || git clone https://github.com/diffpy/libObjCryst.git
90+ - $NOSYS || git clone https://github.com/diffpy/libdiffpy.git
91+ - $NOSYS || popd
7492
7593install :
7694 - $NOMC || conda build --python=${MYPYTHON_VERSION} --dirty conda-recipe
@@ -80,25 +98,40 @@ install:
8098 - $NOMC || source activate testenv
8199 - $NOMC || conda install --yes --use-local --file=/tmp/mypackage.txt
82100
83- - $NOAPT || pip install $MYPIPFLAGS coverage
84- - $NOAPT || pip install $MYPIPFLAGS periodictable
85- - $NOAPT || easy_install --user "pycifrw==4.2.1"
86- - $NOAPT || easy_install --user diffpy.Structure
101+ - $NOAPT || $MYPIP install $MYPIPFLAGS coverage
102+ - $NOAPT || $MYPIP install $MYPIPFLAGS periodictable
103+ - $NOAPT || $MYPIP install $MYPIPFLAGS "pycifrw==4.2.1"
104+ - $NOAPT || $MYPIP install $MYPIPFLAGS diffpy.structure
87105 - $NOAPT || sudo scons -C ~/pkgs/libObjCryst install
88- - $NOAPT || easy_install --user pyobjcryst
106+ - $NOAPT || $MYPIP install $MYPIPFLAGS pyobjcryst
89107 - $NOAPT || sudo scons -C ~/pkgs/libdiffpy install
90- - $NOAPT || easy_install --user "${MYTARBUNDLE}"
108+ - $NOAPT || $MYPIP install $MYPIPFLAGS "${MYTARBUNDLE}"
109+
110+ - $NOBREW || $MYPIP install $MYPIPFLAGS coverage
111+ - $NOBREW || $MYPIP install $MYPIPFLAGS periodictable
112+ - $NOBREW || $MYPIP install $MYPIPFLAGS pycifrw
113+ # install diffpy.structure from the python3 development branch.
114+ # TODO - replace with PyPI version later.
115+ - $NOBREW || $MYPIP install $MYPIPFLAGS https://github.com/diffpy/diffpy.structure/archive/python3.tar.gz
116+ - $NOBREW || scons -C ~/pkgs/libObjCryst install
117+ - $NOBREW || $MYPIP install $MYPIPFLAGS pyobjcryst
118+ - $NOBREW || scons -C ~/pkgs/libdiffpy install
119+ - $NOBREW || $MYPIP install $MYPIPFLAGS "${MYTARBUNDLE}"
91120
92121 - cd ${MYRUNDIR}
93- - MYGIT_REV=$(python -c "import ${MYNAME}.version as v; print(v.__gitsha__)")
122+ - MYGIT_REV=$($MYPYTHON -c "import ${MYNAME}.version as v; print(v.__gitsha__)")
94123 - if [[ "${TRAVIS_COMMIT}" != "${MYGIT_REV}" ]]; then
95124 echo "Version mismatch ${TRAVIS_COMMIT} vs ${MYGIT_REV}.";
96125 exit 1;
97126 fi
98127
128+ before_script :
129+ - $NOBREW || USER_BASE="$(python3 -c 'import site; print(site.USER_BASE)')"
130+ - $NOBREW || PATH="${USER_BASE}/bin:${PATH}"
131+
99132script :
100133 - coverage run --source ${MYNAME} -m ${MYNAME}.tests.run
101134
102135after_success :
103- - pip install $MYPIPFLAGS codecov
136+ - $MYPIP install $MYPIPFLAGS codecov
104137 - codecov
0 commit comments