This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
252 lines (198 loc) · 6.9 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# TODO: switch to pyctdev and clean up doit/pyct usage; more should
# move to doit so can run on win
language: python
env:
global:
# example tests are run from different directory
- DIR_EXAMPLE="--dir=/tmp/123"
# for package name != example (repo) name
- EXAMPLE_PKGNAME=''
# TODO: add appropriate guards (e.g. only deploy on tag matching
# certain pattern) before merging back to main.
stages:
- lint
- test
- example
- example_pipgit
- conda_example
- check_dirty
- name: conda_package
# if: (branch = main AND type != pull_request) OR (tag IS present)
- name: pypi_package
if: tag IS present
jobs:
fast_finish: true
include:
- stage: lint
python: 3.6
install: pip install tox
script: tox -e lint_checks
- stage: lint
python: 3.6
install: true
# TODO: move into dodo.py
script:
# did you update bundled examples? (note: doesn't catch changes to setup.py)
- diff autover/version.py examples/pkg_bundle/version.py
- diff autover/version.py examples/PkgBundle/version.py
- stage: test
python: 3.6
install: pip install tox
script: tox -e py${TRAVIS_PYTHON_VERSION//./}
- stage: test
python: 2.7
install: pip install tox
script: tox -e py${TRAVIS_PYTHON_VERSION//./}
##############################
# test examples of using autover
#### depend
- &pkg_depend
stage: example
env: EXAMPLE=pkg_depend
python: 3.6
before_install:
# need pip>=10
- pip install --upgrade pip
- mkdir /tmp/123
- if [ $TRAVIS_PYTHON_VERSION == "2.7" ]; then
pip install "doit<0.30";
fi
- pip install "pyct <0.2.1" tox
# until https://github.com/tox-dev/tox/issues/850 resolved (would also be resolved by switching to pyctdev)
- pip install --upgrade --force-reinstall git+https://github.com/ceball/tox.git@pep-518
- doit $DIR_EXAMPLE copy_example_project --example=$EXAMPLE
- doit $DIR_EXAMPLE git_init
install:
# install autover
- pip install -e .
# build autover package so it's available for pip
- python setup.py bdist_wheel
script:
- doit $DIR_EXAMPLE original_script --example=$EXAMPLE --example-pkgname=$EXAMPLE_PKGNAME
- &pkg_depend_pipgit
<<: *pkg_depend
stage: example_pipgit
env: EXAMPLE=pkg_depend
install:
# build autover package so it's available for pip...
- python setup.py bdist_wheel
# ...and install from local dir ONLY (i.e. avoid getting some other version of autover!),
# making sure the other build deps are also available
- pushd ${TRAVIS_BUILD_DIR}/dist && pip download setuptools wheel && popd
- pip install -f file://${TRAVIS_BUILD_DIR}/dist --pre --no-index git+file:///tmp/123
script: doit $DIR_EXAMPLE verify_installed_version --example=$EXAMPLE --example-pkgname=$EXAMPLE_PKGNAME
#### bundle
- &pkg_bundle
<<: *pkg_depend
stage: example
env: EXAMPLE=pkg_bundle
install: true
- &pkg_bundle_pipgit
<<: *pkg_bundle
stage: example_pipgit
env: EXAMPLE=pkg_bundle
install: pip install git+file:///tmp/123
script: doit $DIR_EXAMPLE verify_installed_version --example=$EXAMPLE --example-pkgname=$EXAMPLE_PKGNAME
#### params
- &pkg_params
<<: *pkg_depend
env: EXAMPLE=pkg_params
install: true
- &pkg_params_pipgit
<<: *pkg_params
stage: example_pipgit
env: EXAMPLE=pkg_params
# TODO: need prerelease param just now; update after param release
install: pip install --pre --index-url=https://test.pypi.org/simple/ --extra-index-url=https://pypi.org/simple git+file:///tmp/123
script: doit $DIR_EXAMPLE verify_installed_version --example=$EXAMPLE --example-pkgname=$EXAMPLE_PKGNAME
##############################
# repeat above but with py 2.7
#### depends
- <<: *pkg_depend
python: 2.7
- <<: *pkg_depend_pipgit
python: 2.7
#### bundle
- <<: *pkg_bundle
python: 2.7
- <<: *pkg_bundle_pipgit
python: 2.7
#### params
- <<: *pkg_params
python: 2.7
- <<: *pkg_params_pipgit
python: 2.7
##############################
# test ok with repository name != package name
- <<: *pkg_depend
stage: example
env: EXAMPLE=PkgBundle EXAMPLE_PKGNAME="pkg_bundle"
install: true
##############################
# auto packaging of autover
- &conda_default
stage: conda_package
python: 3.6
before_install:
- pip install "pyct <0.2.1" && doit install_miniconda && rm -f .doit.db
- export PATH="$HOME/miniconda/bin:$PATH"
- conda install -y -c pyviz/label/dev -c conda-forge "pyct <0.2.1"
- doit ci_configure_conda
install: doit build_conda_package
script: true
# - doit upload_conda_package --token=$CONDA_UPLOAD_TOKEN --label=dev
- stage: pypi_package
install: true
script: true
deploy:
provider: pypi
# could instead use real pypi when tag is release style
server: https://test.pypi.org/legacy/
distributions: "sdist bdist_wheel"
user: ${PYPI_USERNAME}
password: ${PYPI_PASSWORD}
skip_cleanup: true
##############################
# test conda packaging of examples
- &conda_example_tests
<<: *conda_default
stage: conda_example
env: EXAMPLE=pkg_bundle
install:
- mkdir /tmp/123
- doit $DIR_EXAMPLE copy_example_project --example=$EXAMPLE
- doit $DIR_EXAMPLE git_init
script: doit $DIR_EXAMPLE build_conda_package
- <<: *conda_example_tests
env: EXAMPLE=pkg_depend
script:
- doit build_conda_package
# autover required for conda-build *before* build time (for templated version)
- conda install -y --use-local autover
- doit $DIR_EXAMPLE build_conda_package
- <<: *conda_example_tests
env: EXAMPLE=pkg_json_fallback
script:
- doit build_conda_package
- doit $DIR_EXAMPLE build_conda_package
- <<: *conda_example_tests
env: EXAMPLE=pkg_params
script: doit $DIR_EXAMPLE build_conda_package -c pyviz/label/dev
##############################
# test that -dirty appears in package name for dirty repo
- <<: *pkg_depend
stage: check_dirty
env: EXAMPLE=pkg_bundle
install: true
script: doit $DIR_EXAMPLE check_dirty_package_name
- <<: *pkg_depend
stage: check_dirty
env: NOTE="0 distance" EXAMPLE=pkg_bundle
install: pushd /tmp/123 && git tag -a v5000.0.0 -m "Final version" && popd
script: doit $DIR_EXAMPLE check_dirty_package_name
# test on autover itself
- <<: *conda_default
stage: check_dirty
env: NOTE="conda"
install: true
script: doit check_dirty_fails_conda_package