Skip to content

Commit f7ce7a8

Browse files
authored
trying to fix travis (#126)
using docker for linux, anaconda for OSX
1 parent 8ae6114 commit f7ce7a8

File tree

7 files changed

+90
-62
lines changed

7 files changed

+90
-62
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.venv*/
3+
.virtualenv*/
4+
build/
5+
*.egg-info/

.travis.yml

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,21 @@
1-
language: python
1+
language: generic
22
sudo: required
33
dist: trusty
44

5-
matrix:
6-
include:
7-
- os: linux
8-
python: "2.7"
9-
10-
- os: linux
11-
python: "3.5"
12-
13-
- os: linux
14-
python: "3.6"
15-
16-
# Use generic language for osx
17-
- os: osx
18-
language: generic
19-
python: "2.7"
20-
env: TRAVIS_PYTHON_VERSION=2.7
5+
os:
6+
- linux
7+
- osx
218

22-
- os: osx
23-
language: generic
24-
python: "3.5"
25-
env: TRAVIS_PYTHON_VERSION=3.5
26-
27-
- os: osx
28-
language: generic
29-
python: "3.6"
30-
env: TRAVIS_PYTHON_VERSION=3.6
31-
32-
allow_failures:
9+
matrix:
10+
allow_failures:
3311
- os: osx
3412

35-
3613
before_install:
3714
- .travis/before_install.sh
38-
- mkdir $HOME/data
39-
- echo $PWD
40-
- cd $HOME/data && wget ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar && tar xf WSRT_Measures.ztar && cd -
41-
- echo $PWD
4215
install:
43-
- export PATH="$HOME/miniconda/bin:$PATH"
44-
- source activate testenv
45-
- export CPATH="$HOME/miniconda/envs/testenv/include:$CPATH"
46-
- echo $CPATH
47-
- python setup.py develop
48-
- pip install -r tests/requirements.txt
49-
- pip install coveralls travis-sphinx
16+
- .travis/install.sh
5017
script:
51-
- nosetests --with-coverage
52-
- travis-sphinx --nowarn -s doc build
18+
- .travis/script.sh
5319
deploy:
5420
provider: pypi
5521
user: gijzelaerr

.travis/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM kernsuite/base:3
2+
3+
RUN apt-get update && apt-get install -y casacore-data casacore-dev \
4+
libboost-python-dev libcasa-python3-2 libcfitsio3-dev python-dev \
5+
python-numpy python-setuptools python-six python3-all python3-dev \
6+
python3-numpy python3-setuptools python3-six wcslib-dev python-pip \
7+
python3-pip python-nose python3-nose
8+
9+
ADD . /code
10+
WORKDIR /code
11+
12+
RUN pip install -e .
13+
RUN pip3 install -e .
14+
15+
RUN pip install -r tests/requirements.txt
16+
RUN pip3 install -r tests/requirements.txt
17+
18+
RUN nosetests --with-coverage
19+
RUN nosetests3 --with-coverage

.travis/before_install.sh

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
#!/usr/bin/env bash
22

3-
# Inspired by https://conda.io/docs/travis.html
43
set -e
54
set -v
65

76

87
if [ "$TRAVIS_OS_NAME" = linux ]; then
9-
sudo apt-get update
10-
MINICONDAVERSION="Linux"
11-
else
12-
MINICONDAVERSION="MacOSX"
8+
true
139
fi
1410

15-
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
16-
wget https://repo.continuum.io/miniconda/Miniconda2-latest-$MINICONDAVERSION-x86_64.sh -O miniconda.sh;
17-
else
18-
wget https://repo.continuum.io/miniconda/Miniconda3-latest-$MINICONDAVERSION-x86_64.sh -O miniconda.sh;
19-
fi
11+
if [ "$TRAVIS_OS_NAME" = osx ]; then
12+
# isntall and configure miniconda
13+
wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh;
14+
bash miniconda.sh -b -p $HOME/miniconda
15+
export PATH="$HOME/miniconda/bin:$PATH"
16+
hash -r
17+
conda config --set always_yes yes --set changeps1 no
18+
conda update -q conda
19+
conda config --add channels conda-forge
2020

21-
bash miniconda.sh -b -p $HOME/miniconda
22-
export PATH="$HOME/miniconda/bin:$PATH"
23-
hash -r
24-
conda config --set always_yes yes --set changeps1 no
25-
conda update -q conda
26-
conda config --add channels conda-forge
27-
# Useful for debugging any issues with conda
28-
conda info -a
29-
conda create -q -n testenv python=$TRAVIS_PYTHON_VERSION casacore=2.3.0
21+
# Useful for debugging any issues with conda
22+
conda info -a
23+
conda create -q -n testenv python=2.7 casacore=2.3.0
24+
source activate testenv
3025

31-
echo "measures.directory: $HOME/data" > $HOME/.casarc
26+
# setup casacore data
27+
mkdir $HOME/data
28+
cd $HOME/data
29+
wget ftp://ftp.astron.nl/outgoing/Measures/WSRT_Measures.ztar && tar xf WSRT_Measures.ztar &&
30+
cd $HOME
31+
echo "measures.directory: $HOME/data" > $HOME/.casarc
32+
fi

.travis/install.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -v
5+
6+
7+
if [ "$TRAVIS_OS_NAME" = linux ]; then
8+
true
9+
fi
10+
11+
if [ "$TRAVIS_OS_NAME" = osx ]; then
12+
cd $TRAVIS_BUILD_DIR
13+
python setup.py build_ext \
14+
-L$HOME/miniconda/envs/testenv/lib \
15+
-I$HOME/miniconda/envs/testenv/include
16+
pip install -e .
17+
pip install -r tests/requirements.txt
18+
fi
19+

.travis/script.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -v
5+
6+
if [ "$TRAVIS_OS_NAME" = linux ]; then
7+
cd $TRAVIS_BUILD_DIR
8+
docker build -f .travis/Dockerfile .
9+
fi
10+
11+
if [ "$TRAVIS_OS_NAME" = osx ]; then
12+
export DYLD_LIBRARY_PATH=$HOME/miniconda/envs/testenv/lib
13+
export LD_LIBRARY_PATH=$HOME/miniconda/envs/testenv/lib
14+
nosetests --with-coverage
15+
travis-sphinx --nowarn -s doc build
16+
fi

tests/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
nose
22
unittest2
33
coverage
4+
coveralls
5+
travis-sphinx
46

0 commit comments

Comments
 (0)