Skip to content

Commit aab662b

Browse files
committed
update CI to use tox
1 parent e1037bd commit aab662b

File tree

2 files changed

+159
-75
lines changed

2 files changed

+159
-75
lines changed

.travis.yml

Lines changed: 90 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,93 @@
1-
dist: xenial
1+
# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
24
language: python
3-
cache: pip
4-
python:
5-
- '2.7'
6-
- '3.4'
7-
- '3.5'
8-
- '3.7'
9-
env:
10-
- PYTHONPATH=$PYTHONPATH:./src
5+
6+
dist: xenial
7+
8+
9+
stages:
10+
- flake8
11+
- test
12+
- name: create release
13+
if: tag IS present
14+
- name: upload documentation
15+
if: tag IS present
16+
- name: deploy to pypi
17+
if: tag IS present
18+
19+
20+
matrix:
21+
22+
allow_failures:
23+
- env: TOXENV=py36-flake8
24+
25+
include:
26+
- python: 2.7
27+
env: TOXENV=py27-tests-codecov TOX_SKIP_MISSING_INTERPRETERS=False
28+
- python: 3.4
29+
dist: trusty
30+
env: TOXENV=py34-tests-codecov TOX_SKIP_MISSING_INTERPRETERS=False
31+
- python: 3.5
32+
env: TOXENV=py35-tests-codecov TOX_SKIP_MISSING_INTERPRETERS=False
33+
- python: 3.6
34+
env: TOXENV=py36-tests-codecov TOX_SKIP_MISSING_INTERPRETERS=False
35+
- python: 3.7
36+
env: TOXENV=py37-tests-codecov TOX_SKIP_MISSING_INTERPRETERS=False
37+
38+
39+
- stage: flake8
40+
python: 3.6
41+
env: TOXENV=py36-flake8
42+
43+
44+
- stage: create release
45+
python: 3.6
46+
install: pip install sphinx
47+
script:
48+
- sphinx-build -Ean -b html -j auto -D todo_include_todos=0 ./doc ./doc/_build/html
49+
- pushd ./doc/_build/html ; zip -r ../../../${TRAVIS_TAG}-doc.zip . ; popd
50+
deploy:
51+
provider: releases
52+
skip_cleanup: true
53+
api_key: "$GITHUB_TOKEN"
54+
file: "${TRAVIS_TAG}-doc.zip"
55+
draft: true
56+
57+
58+
- stage: upload documentation
59+
python: 3.6
60+
install: pip install sphinx
61+
script:
62+
- sphinx-build -Ean -b html -j auto -D todo_include_todos=0 ./doc ./doc/_build/html
63+
- touch ./doc/_build/html/.nojekyll
64+
deploy:
65+
provider: pages
66+
skip_cleanup: true
67+
github_token: "$GITHUB_TOKEN"
68+
keep_history: false
69+
local_dir: "./doc/_build/html"
70+
on:
71+
tags: true
72+
73+
74+
- stage: deploy to pypi
75+
script:
76+
-
77+
deploy:
78+
provider: pypi
79+
user:
80+
secure: BkSk3YOVq/wb10zg6ceI7NdymLWhuexH8WH2KHHVIBaZDeoo1Hfzm6bSwxIPlngN5737ubBgVXnCM7oSElPh9oQYhX6PyNPR2X9DshQCoM1iShIhdo3Wb9XYT0V/MZ6/yf9pqbirx1mQ7rM+xTs9lrw7OCgi1/fJXPmXc7Qv8DGfhT0y9SbsktIJoAPg4qjWuGbo/2Jm5l8UNmTp6N5brJO+C1cRp65fZ1LcJ6PeWK+0iIi+oLyMz74TYrVAh+eqIlbnB6ss7WBHw7Bh3Cr7QjyaH5dDBGkouPPUbkSy9tNDcLUERSKPPPAOtY53tADI6ap+2hLFMKFz1wuOBwrabbsxkbdTPNbd9sS6bMrdHajRwuE7WyFkKe4yd9JzmafrBzUsR+hjyjCDIBT9lwn9EIeWaKtbm2zOmh7EbQBhK2q71hc+8ZiDx42uWIpEZnCSkWJYyGHdHiy1kgPsqWnUOMxReIRSfqdrdkVBfA6F68nh5k9w06chSj81Tb/mAnf3xGI8r3EwqMlXfyo+bBCYK3NibaBYMy4xhUiH566cQ+1Rt6JdAaVZIgK6Euu7zas0szZKddXUelaLlc2VHUyoJR8gazVdK6V8hDJykZb85KYp0lWhd78v4ANsDzSjjxoO8YT43iwiFgHarjXN1Vnd9fixWinT3r3BCdUryetOQ1g=
81+
password:
82+
secure: UOnKL5rBTgv8ubh/0l+4BKEO1C89h/PF3y+Y6cq40881yQLkLItTDxYkWCf36m6L/IyOnACwn5kJziQuTUSgyzfN58TRBvjVagjdkDQtwObLZVoU5PX+aMLRF+D7djdIekiOvhvQ476UDUR8jL3FwcQU4QJ72KQJqNn/UohdQquDP91qlcr+XLN/rvLeJAdQ8brOjpansX5qbHuJey+9oGgl9cwAVapvGVzvxk46oDb8hSrWJXZZU5PeEkoOdtGnOUdmWTtjuPjjYA6Fk/jyk+3fSgolHqa4vjFLu2PfDK+hDSZY1JIAxqUGKRzj+O4J2cm5ChMOwB4FwkA+7ZUBptHKnAD+qD4Z2iDRvkVTGgOUsmwS25DAcoEM6t9j5bjozW1vgCiIjf51v6GplQC0rY/QpxVkDnNlLC9Ov+paj+3KgG+BI2S+gjb9XD9tgnsHXpgc0i3dZSmjaO4eA9jetm9bG32irDdQGSifF27vv0m3X1GlgeIYtK2kZnUmxFBYadiGCGBk3+V78VKCLiTsB/G5b/9L70AaQmodPjYiOqmi2K5k6rMJ0lpP52ho3njN2oIvH7Ot4vNdc75qXlsHFX1VQfQlenxuzWszmlQQQAfQ+uj26rhftaKiYfPETPTztRHoRIeyYxqCnpNU5oGw3EcWQklxyNDVH0FqQ7H5iZw=
83+
distributions: sdist bdist_wheel
84+
on:
85+
tags: true
86+
87+
1188
install:
12-
- pip install -r test_requirements.txt
89+
- pip install tox
90+
91+
1392
script:
14-
- pytest
15-
jobs:
16-
include:
17-
- stage: upload codecov results
18-
python: 3.6
19-
install:
20-
- pip install pytest pytest-cov codecov
21-
- pip install -r test_requirements.txt
22-
script:
23-
- pytest --cov=./
24-
- codecov
25-
- stage: create release
26-
if: tag is present
27-
python: 3.6
28-
install: pip install sphinx
29-
script:
30-
- sphinx-build -Ean -b html -j auto -D todo_include_todos=0 ./doc ./doc/_build/html
31-
- pushd ./doc/_build/html ; zip -r ../../../${TRAVIS_TAG}-doc.zip . ; popd
32-
deploy:
33-
provider: releases
34-
skip_cleanup: true
35-
api_key: "$GITHUB_TOKEN"
36-
file: "${TRAVIS_TAG}-doc.zip"
37-
draft: true
38-
on:
39-
tags: true
40-
- stage: upload documentation
41-
if: tag is present
42-
python: 3.6
43-
install: pip install sphinx
44-
script:
45-
- sphinx-build -Ean -b html -j auto -D todo_include_todos=0 ./doc ./doc/_build/html
46-
- touch ./doc/_build/html/.nojekyll
47-
deploy:
48-
provider: pages
49-
skip_cleanup: true
50-
github_token: "$GITHUB_TOKEN"
51-
keep_history: false
52-
local_dir: "./doc/_build/html"
53-
on:
54-
tags: true
55-
- stage: deploy to pypi
56-
if: tag is present
57-
script:
58-
-
59-
deploy:
60-
provider: pypi
61-
user:
62-
secure: BkSk3YOVq/wb10zg6ceI7NdymLWhuexH8WH2KHHVIBaZDeoo1Hfzm6bSwxIPlngN5737ubBgVXnCM7oSElPh9oQYhX6PyNPR2X9DshQCoM1iShIhdo3Wb9XYT0V/MZ6/yf9pqbirx1mQ7rM+xTs9lrw7OCgi1/fJXPmXc7Qv8DGfhT0y9SbsktIJoAPg4qjWuGbo/2Jm5l8UNmTp6N5brJO+C1cRp65fZ1LcJ6PeWK+0iIi+oLyMz74TYrVAh+eqIlbnB6ss7WBHw7Bh3Cr7QjyaH5dDBGkouPPUbkSy9tNDcLUERSKPPPAOtY53tADI6ap+2hLFMKFz1wuOBwrabbsxkbdTPNbd9sS6bMrdHajRwuE7WyFkKe4yd9JzmafrBzUsR+hjyjCDIBT9lwn9EIeWaKtbm2zOmh7EbQBhK2q71hc+8ZiDx42uWIpEZnCSkWJYyGHdHiy1kgPsqWnUOMxReIRSfqdrdkVBfA6F68nh5k9w06chSj81Tb/mAnf3xGI8r3EwqMlXfyo+bBCYK3NibaBYMy4xhUiH566cQ+1Rt6JdAaVZIgK6Euu7zas0szZKddXUelaLlc2VHUyoJR8gazVdK6V8hDJykZb85KYp0lWhd78v4ANsDzSjjxoO8YT43iwiFgHarjXN1Vnd9fixWinT3r3BCdUryetOQ1g=
63-
password:
64-
secure: UOnKL5rBTgv8ubh/0l+4BKEO1C89h/PF3y+Y6cq40881yQLkLItTDxYkWCf36m6L/IyOnACwn5kJziQuTUSgyzfN58TRBvjVagjdkDQtwObLZVoU5PX+aMLRF+D7djdIekiOvhvQ476UDUR8jL3FwcQU4QJ72KQJqNn/UohdQquDP91qlcr+XLN/rvLeJAdQ8brOjpansX5qbHuJey+9oGgl9cwAVapvGVzvxk46oDb8hSrWJXZZU5PeEkoOdtGnOUdmWTtjuPjjYA6Fk/jyk+3fSgolHqa4vjFLu2PfDK+hDSZY1JIAxqUGKRzj+O4J2cm5ChMOwB4FwkA+7ZUBptHKnAD+qD4Z2iDRvkVTGgOUsmwS25DAcoEM6t9j5bjozW1vgCiIjf51v6GplQC0rY/QpxVkDnNlLC9Ov+paj+3KgG+BI2S+gjb9XD9tgnsHXpgc0i3dZSmjaO4eA9jetm9bG32irDdQGSifF27vv0m3X1GlgeIYtK2kZnUmxFBYadiGCGBk3+V78VKCLiTsB/G5b/9L70AaQmodPjYiOqmi2K5k6rMJ0lpP52ho3njN2oIvH7Ot4vNdc75qXlsHFX1VQfQlenxuzWszmlQQQAfQ+uj26rhftaKiYfPETPTztRHoRIeyYxqCnpNU5oGw3EcWQklxyNDVH0FqQ7H5iZw=
65-
distributions: sdist bdist_wheel
66-
on:
67-
tags: true
93+
- tox

tox.ini

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,78 @@
11
# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
# Tox (https://tox.readthedocs.io/) is a tool for running tests
5+
# in multiple virtualenvs. This configuration file will run the
6+
# test suite on all supported python versions. To use it, "pip install tox"
7+
# and then run "tox" from this directory.
8+
#
9+
# See also https://tox.readthedocs.io/en/latest/config.html for more
10+
# configuration options.
11+
12+
13+
414
[tox]
5-
envlist = py27, py30, py36
15+
envlist = py36-clean
16+
17+
py36-flake8
18+
19+
py{27,34,35,36,37}-tests
20+
21+
# Allow execution even if all Python versions are not present
22+
skip_missing_interpreters = {env:TOX_SKIP_MISSING_INTERPRETERS:True}
23+
24+
625

726
[testenv]
8-
# install pytest in the virtualenv where commands will be executed
9-
deps =
10-
-rtest_requirements.txt
27+
skip_install =
28+
clean: true
29+
flake8: true
30+
doc: true
1131

12-
commands =
13-
# NOTE: you can run any command line tool here - not just tests
14-
- py.test -vv
32+
basepython =
33+
py27: python2.7
34+
py34: python3.4
35+
py35: python3.5
36+
py36: python3.6
37+
py37: python3.7
38+
39+
deps =
40+
clean: coverage
41+
flake8: flake8==3.7.7
42+
flake8: flake8-bugbear
43+
flake8: flake8-docstrings
44+
flake8: flake8-rst-docstrings
45+
flake8: flake8-import-order
46+
flake8: flake8-logging-format
47+
tests: pytest >= 4.4.1
48+
tests: pytest-cov
49+
tests: betamax >= 0.8.1
50+
tests: betamax_serializers >= 0.2.0
51+
tests: mock; python_version < '3.3'
52+
tests: sklearn
53+
tests: pandas
54+
tests: swat
55+
tests: kerberos ; platform_system != "Windows"
56+
flake8: flake8==3.7.7
57+
codecov: codecov >= 1.4.0
58+
doc: sphinx == 1.8
1559

1660
setenv =
17-
SASCTL_USER_NAME=dummy
18-
SASCTL_PASSWORD=dummy
19-
SASCTL_TEST_SERVERS=dummy
20-
REQUESTS_CA_BUNDLE=
61+
tests: SASCTL_USER_NAME=dummy
62+
tests: SASCTL_PASSWORD=dummy
63+
tests: SASCTL_TEST_SERVERS=example.com
64+
tests: REQUESTS_CA_BUNDLE=
65+
66+
passenv =
67+
codecov: TOXENV
68+
codecov: CI
69+
codecov: TRAVIS
70+
codecov: TRAVIS_*
71+
codecov: CODEVOC_*
72+
73+
commands =
74+
clean: coverage erase
75+
flake8: flake8 src/sasctl
76+
tests: {posargs:py.test --cov={envsitepackagesdir}/sasctl --cov-report= }
77+
codecov: codecov -e TOXENV
78+
doc: sphinx-build -Ean -b html -j auto ./doc ./doc/_build/html

0 commit comments

Comments
 (0)