forked from pyinvoke/invoke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
103 lines (103 loc) · 4.17 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
language: python
sudo: required
# travis changes on 2017.06.21 appear to have broken pypy, causing attemtped
# downloads of "-.tar.bz2" (resulting in 'bzip2: (stdin) is not a bzip2 file.')
# (same changes MIGHT also have gotten a version of CPython 3.6 exhibiting
# https://bugs.python.org/issue29167; at least, that bug is definitely
# appearing.)
# Pinning to previous travis image for now.
group: deprecated-2017Q2
dist: trusty
cache:
directories:
- $HOME/.cache/pip
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7-dev"
- "nightly"
- "pypy"
- "pypy3"
matrix:
# pypy3 (as of 2.4.0) has a wacky arity issue in its source loader. Allow it
# to fail until we can test on, and require, PyPy3.3+. See #358.
# Additionally, -dev/-nightly builds may be unstable; we do not want them
# marking our own tests as outright failures.
allow_failures:
- python: "pypy3"
- python: "3.7-dev"
- python: "nightly"
fast_finish: true
install:
# For some reason Travis' build envs have wildly different pip/setuptools
# versions between minor Python versions, and this can cause many hilarious
# corner packaging cases. So...
- pip install -U pip
# Setuptools 34+ seems to get less stable
- pip install 'setuptools>33,<34'
# Pre-requirements sanity test (again, resembles pure, non-dev install
# environment.) Avoids e.g. spec's 'six' from gumming up our attempts to
# import our vendorized 'six'.
- pip install -r tasks-requirements.txt
- inv --list
# Install remaining dev requirements (test runner, etc)
- pip install -r dev-requirements.txt
- pip list --format=columns
# Also create a workable alt-interpreter venv for testing dual package builds
# Python 3 is nicely namespaced, globally. Python 2 is masked by Travis'
# default venv, so we gotta hardcode it.
- "virtualenv alt_env --python=$([[ $TRAVIS_PYTHON_VERSION == 2* ]] && echo python3 || echo /usr/bin/python)"
- alt_env/bin/pip install wheel
before_script:
# Create passworded sudoable user for sudo autoresponse testing. Put it in
# the Travis user's group so it can read /home/travis for virtualenv etc.
- sudo useradd sudouser -G travis
- "echo sudouser:mypass | sudo chpasswd"
- "sudo sh -c \"echo 'sudouser ALL=(ALL:ALL) PASSWD:ALL' > /etc/sudoers.d/passworded\""
# Make sure sudouser can write to travis' homedir (used for some config
# tests)
- sudo chmod g+w /home/travis
script:
# Run unit and integration tests, generating coverage report (skipping html).
# NOTE: Using the above-created passworded sudo-capable user so that
# sudo-related integration tests work as expected. (Otherwise, sudo prompt
# response will not be properly tested!)
# NOTE: This command will fail if the tests fail.
- "sudo -u sudouser bash -c \"source $VIRTUAL_ENV/bin/activate && inv coverage --no-html\""
# Websites build OK? (Not on PyPy3, Sphinx is all "who the hell are you?" =/
- "[[ $TRAVIS_PYTHON_VERSION != 'pypy3' ]] && inv sites"
# Doctests in websites OK?
- inv www.doctest
# Did we break setup.py?
- pip uninstall -y invoke # To undo the implicit -e install from above
- pip install . # NO -e!
- inv -l # Sanity check
# I have this in my git pre-push hook, but contributors probably don't
- flake8
# Test distribution builds.
# Have to use env var to override our normal config defaults. Ho hum.
# Also specify the virtualenv we made for the 'alternate' Python version, for
# the dual wheel build step.
- "INVOKE_PACKAGING_SIGN=0 inv release.publish --dry-run --directory=tmp --alt-python=alt_env/bin/python"
# Interpreter-specific wheel
- pip uninstall -y invoke
- "if [[ $TRAVIS_PYTHON_VERSION == 3* || $TRAVIS_PYTHON_VERSION == pypy3 ]]; then pip install tmp/dist/*py3*.whl; fi"
- "if [[ $TRAVIS_PYTHON_VERSION == 2* || $TRAVIS_PYTHON_VERSION == pypy ]]; then pip install tmp/dist/*py2*.whl; fi"
- inv -l
# Source distribution
- pip uninstall -y invoke
- "pip install tmp/dist/*.tar.gz"
- inv -l
after_success:
# Upload coverage data to codecov
- codecov
notifications:
irc:
channels: "irc.freenode.org#invoke"
template:
- "%{repository}@%{branch}: %{message} (%{build_url})"
on_success: change
on_failure: change
email: false