Skip to content

Commit 3d552d7

Browse files
author
Mathieu Bernard
committed
Merge branch 'travis' into 'master'
Travis CI See merge request mbernard/abx!2
2 parents 8a63272 + b71979d commit 3d552d7

File tree

5 files changed

+39
-18
lines changed

5 files changed

+39
-18
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ pip-delete-this-directory.txt
3838
htmlcov/
3939
.tox/
4040
.coverage*
41+
coverage.xml
4142
.cache
4243
nosetests.xml
43-
coverage.xml
4444

4545
# Translations
4646
*.mo

.travis.yml

+32-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
dist: xenial # required for python-3.7
2+
13
language: python
4+
25
python:
36
- "2.7"
47
- "3.6"
@@ -16,36 +19,48 @@ branches:
1619
only:
1720
- master
1821

22+
# conda installation is cached to avoid redowloading again and again
23+
# miniconda and Python dependencies
24+
cache:
25+
directories:
26+
- $HOME/miniconda
27+
28+
# exclude some directories from cache (packaged archives and temp
29+
# directories)
30+
before_cache:
31+
- rm -rf $HOME/miniconda/locks
32+
- rm -rf $HOME/miniconda/pkgs
33+
- rm -rf $HOME/miniconda/var
34+
- rm -rf $HOME/miniconda/conda-meta/history
35+
1936
before_install:
20-
# Setup anaconda
37+
# setup Python version
2138
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
22-
export PYTHON_MAJOR=2
39+
export PYTHON_MAJOR=2;
2340
else
24-
export PYTHON_MAJOR=3
41+
export PYTHON_MAJOR=3;
42+
fi
43+
# setup conda (if not already cached)
44+
- if test -e $HOME/miniconda/bin; then
45+
echo "miniconda already installed.";
46+
else
47+
wget https://repo.continuum.io/miniconda/Miniconda${PYTHON_MAJOR}-latest-Linux-x86_64.sh -O miniconda.sh;
48+
bash miniconda.sh -b -u -p $HOME/miniconda;
2549
fi
26-
- wget https://repo.continuum.io/miniconda/Miniconda${PYTHON_MAJOR}-latest-Linux-x86_64.sh -O miniconda.sh
27-
- bash miniconda.sh -b -p $HOME/miniconda
2850
- export PATH="$HOME/miniconda/bin:$PATH"
2951
- conda update -q --yes conda
3052

31-
# Useful for debugging any issues with conda
32-
- conda info -a
33-
34-
# The next line fix a crash with multiprocessing on Travis
35-
# and are not specific to using Miniconda
36-
- sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm
37-
3853
install:
3954
- if [[ "$PYTHON_MAJOR" == 2 ]]; then
40-
sed -i -r 's/python.+/python=2.7/' environment.yml
55+
sed -i -r 's/python.+/python=2.7/' environment.yml;
4156
fi
42-
- conda env create -n test-environment --yes -f environment.yml
43-
- source activate test-environment
57+
- conda env create -n test -f environment.yml
58+
- source activate test
4459
- pip install codecov
45-
- make install
60+
- python setup.py install
4661

4762
script:
48-
- make test
63+
- python setup.py test
4964

5065
after_success:
5166
- codecov

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ clean:
3030
find . -name __pycache__ -exec rm -rf {} +
3131
rm -rf .eggs *.egg-info
3232
rm -rf ABXpy/distances/metrics/dtw/*.c
33+
rm -rf build dist htmlcov .coverage*

setup.py

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ def finalize_options(self):
2323

2424
packages=setuptools.find_packages(exclude='test'),
2525

26+
# needed for cython/setuptools, see
27+
# http://docs.cython.org/en/latest/src/quickstart/build.html
28+
zip_safe=False,
29+
2630
setup_requires=[
2731
'cython',
2832
'setuptools>=18.0',

test/test_dtw.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
def test_small():
88
res = dtw._dtw(1, 1, np.ones((1, 1)), normalized=False)
99
assert res == 1
10+
1011
res = dtw._dtw(1, 1, np.ones((1, 1)), normalized=True)
1112
assert res == 1
1213

0 commit comments

Comments
 (0)