forked from bids-standard/pybids
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
127 lines (119 loc) · 3.91 KB
/
.travis.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
dist: xenial
sudo: true
language: python
cache: false
# python and global.matrix are crossed to create the base build matrix
python:
- 2.7
- 3.5
- 3.6
- 3.7
env:
global:
- INSTALL_TYPE="pip"
- SETUP_REQUIRES="--upgrade pip setuptools wheel"
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
- CHECK_TYPE="travis_tests"
matrix:
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
- EXTRA_PIP_FLAGS="--pre --find-links=$EXTRA_WHEELS --find-links $PRE_WHEELS"
# Add OSX entries to the build matrix
matrix:
include:
- os: osx
language: generic
env:
- PYTHON_VERSION=2.7.16=h97142e2_0
- MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh"
- os: osx
language: generic
env:
- PYTHON_VERSION=3.5
- MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh"
- os: osx
language: generic
env:
- PYTHON_VERSION=3.6
- MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh"
- os: osx
language: generic
env:
- PYTHON_VERSION=3.7
- MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh"
- python: 3.6
env: CHECK_TYPE=tutorial
- python: 3.6
env: INSTALL_TYPE=sdist
- python: 3.6
env: INSTALL_TYPE=wheel
# Minimal setup requirements
- python: 3.6
env:
- SETUP_REQUIRES="pip==10.0.1 setuptools==30.4.0"
- CHECK_TYPE=skiptests
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export MINICONDA=$HOME/miniconda;
export PATH="$MINICONDA/bin:$PATH";
hash -r;
echo $MINICONDA_URL;
wget $MINICONDA_URL -O miniconda.sh;
bash miniconda.sh -b -s -f -p $MINICONDA;
conda config --set always_yes yes;
conda info -a;
conda install --quiet python=$PYTHON_VERSION;
hash -r;
fi
- travis_retry pip install --upgrade pip virtualenv
- virtualenv --python=python venv
- source venv/bin/activate
- python --version # just to check
- travis_retry pip install $SETUP_REQUIRES
# Build package
- |
if [ "$INSTALL_TYPE" == "sdist" ]; then
python setup.py egg_info # check egg_info while we're here
python setup.py sdist
export ARCHIVE=$( ls dist/*.tar.gz )
elif [ "$INSTALL_TYPE" == "wheel" ]; then
python setup.py bdist_wheel
export ARCHIVE=$( ls dist/*.whl )
elif [ "$INSTALL_TYPE" = "pip" ]; then
export ARCHIVE="."
fi
- |
if [ "${ARCHIVE:0:5}" = "dist/" ]; then
pip install twine
twine check $ARCHIVE
fi
install:
# analysis extra existed and people may have it in their dependencies, so
# install it to make sure we don't remove it (unintentionally)
- travis_retry pip install $EXTRA_PIP_FLAGS "$ARCHIVE[analysis]"
# Basic import check; ensures import doesn't depend on any extras
- python -c 'import bids; print(bids.__version__)'
- if [ "$CHECK_TYPE" == "skiptests" ]; then exit 0; fi
before_script:
# Because pybids is already installed, will just look up the extra
- travis_retry pip install $EXTRA_PIP_FLAGS "pybids[$CHECK_TYPE]"
script:
- |
if [ "$CHECK_TYPE" = "travis_tests" ]; then
py.test -n 2 -v --cov bids --cov-config .coveragerc --cov-report xml:cov.xml bids
elif [ "$CHECK_TYPE" = "tutorial" ]; then
jupyter nbconvert --execute examples/pybids_tutorial.ipynb
else
false
fi
after_script:
- codecov --file cov.xml --flags unittests
deploy:
provider: pypi
user: $PYPI_USER
password: $PYPI_PASS
skip_cleanup: true
distributions: "sdist bdist_wheel"
skip_existing: true
on:
tags: true