1
- language : c
1
+ language : python
2
2
3
- # Setting sudo to false opts in to Travis-CI container-based builds.
4
- sudo : false
3
+ # We need a full clone to make sure setuptools_scm works properly
4
+ git :
5
+ depth : false
5
6
6
7
os :
7
8
- linux
@@ -16,8 +17,6 @@ addons:
16
17
- libgsl0-dev
17
18
18
19
19
- stage : Comprehensive tests
20
-
21
20
stages :
22
21
# Do the style check and a single test job, don't proceed if it fails
23
22
- name : Initial tests
@@ -30,99 +29,135 @@ stages:
30
29
31
30
env :
32
31
global :
32
+
33
33
# The following versions are the 'default' for tests, unless
34
- # overidden underneath. They are defined here in order to save having
34
+ # overridden underneath. They are defined here in order to save having
35
35
# to repeat them for all configurations.
36
- - PYTHON_VERSION=3.7
37
- - MAIN_CMD='python setup.py'
38
- - NUMPY_VERSION=stable
39
- - ASTROPY_VERSION=stable
40
- - SETUP_CMD='test'
41
- - CONDA_DEPENDENCIES='cython scipy matplotlib pyyaml h5py sympy numexpr'
42
- - CONDA_DEPENDENCIES_DOC="${CONDA_DEPENDENCIES} jinja2 ipython jupyter notebook ipykernel"
43
- - PIP_DEPENDENCIES=''
44
- - PIP_DEPENDENCIES_DOC="${PIP_DEPENDENCIES} nbsphinx tqdm sphinx-astropy"
45
- - CONDA_CHANNELS='astropy-ci-extras astropy'
46
-
47
- # If there are matplotlib or other GUI tests, uncomment the following
48
- # line to use the X virtual framebuffer.
49
- - SETUP_XVFB=True
50
36
51
- # If you want to ignore certain flake8 errors, you can list them
52
- # in FLAKE8_OPT, for example:
53
- # - FLAKE8_OPT='--ignore=E501'
54
- - FLAKE8_OPT=''
37
+ # The following three variables are for tox. TOXENV is a standard
38
+ # variable that tox uses to determine the environment to run,
39
+ # TOXARGS are arguments passed to tox, and TOXPOSARGS are arguments
40
+ # that tox passes through to the {posargs} indicator in tox.ini.
41
+ # The latter can be used for example to pass arguments to pytest.
42
+ - TOXENV='test'
43
+ - TOXARGS='-v'
44
+ - TOXPOSARGS=''
45
+
46
+ # The following is needed to avoid issues if e.g. Matplotlib tries
47
+ # to open a GUI window.
48
+ - SETUP_XVFB=True
55
49
56
50
matrix :
57
51
58
52
# Don't wait for allowed failures
59
53
fast_finish : true
60
54
61
55
include :
62
- # Make sure that egg_info works without dependencies
63
- - stage : Initial tests
64
- env : PYTHON_VERSION=3.7 SETUP_CMD='egg_info'
65
56
66
57
# Try MacOS X, usually enough only to run from cron as hardly there are
67
- # issues that are not picked up by a linux worker
58
+ # issues that are not picked up by a linux worker. We set language to
59
+ # 'c' since 'python' doesn't work on non-Linux platforms.
68
60
- os : osx
61
+ language : c
62
+ name : Python 3.7 with required dependencies
69
63
stage : Cron tests
70
- env : SETUP_CMD='test' EVENT_TYPE='cron'
64
+ env : PYTHON_VERSION=3.7 TOXENV=py37-test
71
65
72
- # Do a coverage test.
66
+ # Do a regular build on Linux with Python 3.8, with cov
67
+ # For Linux we use language: python to avoid using conda.
73
68
- os : linux
69
+ python : 3.8
70
+ name : Python 3.8 with required dependencies and measure coverage
74
71
stage : Initial tests
75
- env : SETUP_CMD='test --coverage'
72
+ env : TOXENV=py38-test-cov
73
+
74
+ # Check for sphinx doc build warnings
75
+ - os : linux
76
+ python : 3.8
77
+ name : Documentation build
78
+ stage : Comprehensive tests
79
+ env : TOXENV=build_docs
76
80
77
- # Check for sphinx doc build warnings - we do this first because it
78
- # may run for a long time
81
+ # Now try Astropy dev with the latest Python
79
82
- os : linux
80
- env : SETUP_CMD='install build_docs -w'
81
- CONDA_DEPENDENCIES=$CONDA_DEPENDENCIES_DOC
82
- PIP_DEPENDENCIES=$PIP_DEPENDENCIES_DOC
83
+ python : 3.8
84
+ name : Python 3.8 with developer version of astropy
85
+ stage : Comprehensive tests
86
+ env : TOXENV=py38-test-devdeps
83
87
84
- # Now try Astropy dev with the latest Python and LTS with and 3.x.
88
+ # And with an older Python, Astropy LTS, and the oldest supported Numpy
85
89
- os : linux
86
- env : ASTROPY_VERSION=development
87
- EVENT_TYPE='pull_request push cron'
90
+ python : 3.6
91
+ name : Python 3.6 astropy LTS and Numpy 1.16
92
+ stage : Comprehensive tests
93
+ env : TOXENV=py36-test-astropylts-numpy116
88
94
89
95
# Add a job that runs from cron only and tests against astropy dev and
90
96
# numpy dev to give a change for early discovery of issues and feedback
91
97
# for both developer teams.
92
98
- os : linux
99
+ python : 3.8
100
+ name : Python 3.8 latest developer version of key dependencies
93
101
stage : Cron tests
94
- env : ASTROPY_VERSION=development NUMPY_VERSION=development
95
- EVENT_TYPE='cron'
102
+ env : TOXENV=py38-test-devdeps
96
103
97
- - os : linux
98
- env : PYTHON_VERSION=3.6
104
+ # Try on Windows.
105
+ - os : windows
106
+ language : c
107
+ name : Python 3.8 with required dependencies
108
+ stage : Comprehensive tests
109
+ env : PYTHON_VERSION=3.8 TOXENV=py38-test
110
+
111
+ # Try other python versions and Numpy versions. Since we can assume that
112
+ # the Numpy developers have taken care of testing Numpy with different
113
+ # versions of Python, we can vary Python and Numpy versions at the same
114
+ # time.
99
115
100
116
- os : linux
101
- env : SETUP_CMD='build --nogsl test'
117
+ python : 3.7
118
+ name : Python 3.7 with astropy 3.0 and Numpy 1.17
119
+ stage : Comprehensive tests
120
+ env : TOXENV=py37-test-astropy30-numpy117
102
121
122
+ # Do a code style check
103
123
- os : linux
104
- env : CONDA_DEPENDENCIES+=" galpy"
124
+ python : 3.8
125
+ name : Code style checks
126
+ stage : Initial tests
127
+ env : TOXENV=codestyle
105
128
106
- # Do a PEP8 test with flake8
107
- # - os: linux
108
- # stage: Initial tests
109
- # env: MAIN_CMD='flake8 gala --count --show-source --statistics $FLAKE8_OPT' SETUP_CMD=''
129
+ # Try installing without gsl:
130
+ - os : osx
131
+ language : c
132
+ name : Python 3.7 with required dependencies, without GSL
133
+ stage : Comprehensive tests
134
+ env : PYTHON_VERSION=3.7 TOXENV=py37-test GALA_NOGSL=1
110
135
111
136
allow_failures :
112
137
# Do a PEP8 test with flake8
113
138
# (do allow to fail unless your code completely compliant)
114
- - os : linux
115
- stage : Initial tests
116
- env : MAIN_CMD='flake8 gala --count --show-source --statistics $FLAKE8_OPT' SETUP_CMD=''
139
+ # - os: linux
140
+ # python: 3.8
141
+ # name: Code style checks
142
+ # stage: Initial tests
143
+ # env: TOXENV=codestyle
117
144
118
145
install :
119
- - git clone --depth 1 git://github.com/astropy/ci-helpers.git
120
- - source ci-helpers/travis/setup_conda.sh
146
+
147
+ # We now use the ci-helpers package to set up our Python environment
148
+ # on Windows and MacOS X but we don't set up any other dependencies,
149
+ # instead using tox to do this. See https://github.com/astropy/ci-helpers
150
+ # for more information about ci-helpers.
151
+
152
+ - if [[ $TRAVIS_OS_NAME != linux ]]; then
153
+ git clone --depth 1 git://github.com/astropy/ci-helpers.git;
154
+ source ci-helpers/travis/setup_conda.sh;
155
+ fi
121
156
122
157
script :
123
- - $MAIN_CMD $SETUP_CMD
158
+ - pip install tox
159
+ - tox $TOXARGS -- $TOXPOSARGS
124
160
125
161
after_success :
126
- - if [[ $SETUP_CMD == 'test --coverage' ]]; then
127
- coveralls --rcfile='gala/tests/coveragerc';
128
- fi
162
+ pip install coveralls
163
+ coveralls
0 commit comments