forked from python-attrs/attrs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
135 lines (115 loc) · 3.51 KB
/
azure-pipelines.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
---
trigger:
- master
jobs:
- job: 'Test'
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Typing:
python.version: '3.7'
tox.env: typing
Lint:
python.version: '3.7'
tox.env: lint
py27:
python.version: '2.7'
tox.env: py27
py35:
python.version: '3.5'
tox.env: py35
py36:
python.version: '3.6'
tox.env: py36
py37:
python.version: '3.7'
tox.env: py37
py38:
python.version: '3.8'
tox.env: py38
pypy2:
python.version: 'pypy2'
tox.env: pypy
pypy3:
python.version: 'pypy3'
tox.env: pypy3
Docs:
python.version: '3.7'
tox.env: docs
PyPI-Description:
python.version: '3.7'
tox.env: pypi-description
Changelog:
python.version: '3.7'
tox.env: changelog
steps:
- task: UsePythonVersion@0
displayName: Get Python for Python tools.
inputs:
versionSpec: '3.7'
addToPath: false
name: pyTools
- script: $(pyTools.pythonLocation)/bin/pip install --upgrade tox
displayName: Install Python-based tools.
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
# condition: not(in(variables['python.version'], '3.8'))
displayName: Use cached Python $(python.version) for tests.
# - script: |
# sudo add-apt-repository ppa:deadsnakes
# sudo apt-get update
# sudo apt-get install -y --no-install-recommends python$(python.version)-dev python$(python.version)-distutils
# condition: in(variables['python.version'], '3.8')
# displayName: Install Python $(python.version) from the deadsnakes PPA for tests.
- script: $(pyTools.pythonLocation)/bin/tox -e $(tox.env)
env:
TOX_AP_TEST_EXTRAS: azure-pipelines
displayName: run tox -e $(tox.env)
- script: |
if [ ! -f .coverage.* ]; then
echo No coverage data found.
exit 0
fi
# codecov shells out to "coverage" and avoiding 'sudo pip' allows for
# package caching.
PATH=$HOME/.local/bin:$PATH
case "$(python.version)" in
"pypy2") PY=pypy ;;
"pypy3") PY=pypy3 ;;
*) PY=python$(python.version) ;;
esac
# Python 3.8 needs an up-to-date pip.
if [ "$(python.version)" = "3.8" ]; then
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$PY get-pip.py --user
fi
$PY -m pip install --user 'coverage[toml]' codecov
coverage combine
codecov
env:
CODECOV_TOKEN: $(codecov.token)
displayName: Report Coverage
condition: succeeded()
# Make sure contributors can use Windows.
- job: 'Windows'
pool:
vmImage: 'windows-latest'
strategy:
matrix:
py27:
python.version: '2.7'
py37:
python.version: '3.7'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
displayName: Use cached Python $(python.version) for tests.
- script: python -m pip install -e .[dev]
displayName: Install package in dev mode.
- script: python -m pytest
displayName: Run tests.