forked from deshaw/pyflyby
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
116 lines (111 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
language: python
python:
- 2.7
matrix:
include:
- python: 2.7
env:
- TESTS="true"
- python: 3.7
dist: xenial
env:
- TESTS="true"
- python: 3.8
dist: xenial
env:
- TESTS="true"
- python: 3.8
dist: xenial
env:
- LINT="true"
- os: osx
language: generic
python: 3.7
env: TRAVIS_PYTHON_VERSION=3.7
- python: 3.9-dev
dist: xenial
sudo: true
env:
- TESTS="true"
- python: 3.7
env:
- DOCS="true"
# Doctr deploy key for deshaw/pyflyby
- secure: "HMHUdqYOkqhIYDEocBhoshKJNSiuOUbTrQk8veCXEkOQJmiNSTmRUP6x0QIRnW+r1DgwU/LoEyMrOdTAmi4zBCaGofl7oaooy4CxOJ1snA69sU75esD3trq8XMTh4bxHAIoqSsA78QeqqIK1jDSlIvuZ5MWWAgbn6HKzQ24cP/lOZ1kpgUKWTdZ20aKorPI+8YhG3ey3Zag9OkPwNnyCFZGpXpP9BC3ng+ohWdlwAjGezW4eqpX1wjp1zbF98DUIXVOFJ7IYxfJondn7P+51GnjVvRxVO5szSWIW92z6ybwUxu+NzJL0PSUx8Bz36OcghD7ssOCe/NbKBoNLiSIrZ11xCAj5Ms5TRDe+JFVrPfNByRW48R5Q/VAXv8AvSShgO1XvcIrVABUxcWwHoszFt1cV7waZduYQu13PrW5Uh/wLScq67YQ9SxK79jdXryBWTJOeH/86AJtTLdoZPPuhheAZgyGwKi7XkfBwXyTbIrghpUjuNJQw3OeQ3SBgIorCfL0IlQrF3qza9ugJmP03J5KopXXJ+o12LS8e8zjpSifIsHnf6RkROKME4MgBjERVzDftZts/n9z2dDQpbJBpuxgQSG0RocDoOiMzA8cbVKLpV4sNNX0fwfiDDgKIaiEP3xdSNtHdpa5Lx+np8h2vX+/p14rFl5kA1ygdsIEIUxg="
before_install:
- |
# install Python on macOS
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
env | sort
if ! which python$TRAVIS_PYTHON_VERSION; then
HOMEBREW_NO_AUTO_UPDATE=1 brew tap minrk/homebrew-python-frameworks
HOMEBREW_NO_AUTO_UPDATE=1 brew cask install python-framework-${TRAVIS_PYTHON_VERSION/./}
fi
python3 -m pip install virtualenv
python3 -m virtualenv -p $(which python$TRAVIS_PYTHON_VERSION) ~/travis-env
source ~/travis-env/bin/activate
fi
- python --version
install:
- set -e
- pip install -U pip
# Install prompt-toolkit from git until a release is made with
# PROMPT_TOOLKIT_NO_CPR environment variable support.
# Install jupyter_console from
# https://github.com/jupyter/jupyter_console/pull/187 until it is included
# in a release.
# Install ipykernel from master until a version after 5.1.2 is released.
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
pip install -U "pexpect>=3.3" pyflakes pytest epydoc rlipython requests jupyter flaky flake8 wheel;
else
pip install -U "pexpect>=3.3" pyflakes pytest rlipython ipykernel==5.4.3 requests jupyter flaky flake8 'notebook<6.1' 'prompt_toolkit<3.0.15' wheel 'jupyter_console>=6.2';
fi
- if [[ "${DOCS}" == "true" ]]; then
pip install sphinx sphinx_rtd_theme sphinx-autodoc-typehints;
fi
- pip list
script:
# - set -x
- |
# install Python on macOS
if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then
set -e
shopt -s extglob globstar
fi
- python setup.py sdist bdist_wheel
# pyflakes all files except for known_imports/*, etc/*, and __init__.py,
# which are all unused imports. We use flake8 so we can use noqa if
# necessary.
- |
if [[ "${LINT}" == "true" ]]; then
flake8 --exclude known_imports,etc,__init__.py --select=F;
fi
# Test for invalid escape sequences (will be syntax errors in a future
# Python version)
- |
if [[ "${TESTS}" == "true" ]]; then
python -We:invalid -m compileall -f -q lib/ etc/;
fi
- |
if [[ "${TESTS}" == "true" ]]; then
export DEBUG_TEST_PYFLYBY=1;
fi
- |
if [[ "${TESTS}" == "true" ]]; then
pytest -x --doctest-modules lib tests;
fi
# Smoke test tidy-imports on the codebase. This only fails if there is an
# exception from a bug, but we could also make it fail if there are imports
# that need to be tidied.
- |
if [[ "${TESTS}" == "true" ]]; then
./bin/tidy-imports -d lib/python/ tests/;
fi
- |
if [ "${DOCS}" = "true" ]; then
cd doc;
make html;
cd ..;
pip install doctr;
doctr deploy .;
fi