-
Notifications
You must be signed in to change notification settings - Fork 15
244 lines (240 loc) · 8.51 KB
/
Copy pathmy_github_action.yml
File metadata and controls
244 lines (240 loc) · 8.51 KB
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
name: my_github_actions
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *' # every day at midnight
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
# Support for Python 2.7 removed - https://github.com/actions/setup-python/issues/672
# - '2.7'
# - '3.0.1'
# - '3.1.4'
# - '3.2.5'
# - '3.3.7'
# - '3.4.10'
# - '3.5' - not available on ubuntu-latest for x64
# - '3.6' - not available on ubuntu-latest for x64
# - '3.7' - not available on ubuntu-latest for x64
- '3.8'
- '3.9'
# - '3.9.0' - not available on ubuntu-latest for x64
# - '3.9.1' - not available on ubuntu-latest for x64
# - '3.9.2' - not available on ubuntu-latest for x64
# - '3.9.3' - not available on ubuntu-latest for x64
# - '3.9.4' - not available on ubuntu-latest for x64
# - '3.9.5' - not available on ubuntu-latest for x64
# - '3.9.6' - not available on ubuntu-latest for x64
# - '3.9.7' - not available on ubuntu-latest for x64
# - '3.9.8' - not available on ubuntu-latest for x64
# - '3.9.9' - not available on ubuntu-latest for x64
# - '3.9.10' - not available on ubuntu-latest for x64
# - '3.9.11' - not available on ubuntu-latest for x64
- '3.9.12'
- '3.9.13'
- '3.9.14'
- '3.9.15'
- '3.9.16'
- '3.9.17'
- '3.9-dev'
# Disabled because of issue #61
# - '3.10.0-alpha.1'
# - '3.10.0-alpha.2'
# - '3.10.0-alpha.3'
# - '3.10.0-alpha.4'
# - '3.10.0-alpha.5'
# - '3.10.0-alpha.6'
# - '3.10.0-alpha.7'
# Disabled because of issue #66
# - '3.10.0-beta.1'
# - '3.10.0-beta.2'
# - '3.10.0-beta.3'
# - '3.10.0-beta.4'
# - '3.10.0-rc.1' - not available on ubuntu-latest for x64
# - '3.10.0-rc.2' - not available on ubuntu-latest for x64
# - '3.10.0' - not available on ubuntu-latest for x64
# - '3.10.1' - not available on ubuntu-latest for x64
# - '3.10.2' - not available on ubuntu-latest for x64
# - '3.10.3' - not available on ubuntu-latest for x64
- '3.10.4'
- '3.10.5'
- '3.10.6'
- '3.10.7'
- '3.10.8'
- '3.10.9'
- '3.10.10'
- '3.10.11'
- '3.10.12'
- '3.10.13'
- '3.10.14'
- '3.10-dev'
# Disabled because of issue #66
# - '3.11.0-alpha.1'
# - '3.11.0-alpha.2'
# - '3.11.0-alpha.3'
# - '3.11.0-alpha.4'
# - '3.11.0-alpha.5'
# - '3.11.0-alpha.6'
# - '3.11.0-alpha.7' - not available on ubuntu-latest for x64
# - '3.11.0-beta.1' - not available on ubuntu-latest for x64
# - '3.11.0-beta.2' - not available on ubuntu-latest for x64
# - '3.11.0-beta.3' - not available on ubuntu-latest for x64
# - '3.11.0-beta.4' - not available on ubuntu-latest for x64
# - '3.11.0-beta.5' - not available on ubuntu-latest for x64
# - '3.11.0-rc.1' - not available on ubuntu-latest for x64
# - '3.11.0-rc.2' - not available on ubuntu-latest for x64
- '3.11.0'
- '3.11.1'
- '3.11.2'
- '3.11.3'
- '3.11.4'
- '3.11.5'
- '3.11.6'
- '3.11.7'
- '3.11.8'
- '3.11.9'
- '3.11.10'
- '3.11.11'
- '3.11.12'
- '3.11.13'
- '3.11-dev'
- '3.11'
# Disabled because of issue #62 - https://github.com/nedbat/coveragepy/issues/1634
# - '3.12.0-alpha.1'
# - '3.12.0-alpha.2'
# - '3.12.0-alpha.3'
# - '3.12.0-alpha.4'
# - '3.12.0-alpha.5'
# - '3.12.0-alpha.6'
# - '3.12.0-alpha.7'
# - '3.12.0-beta.1' - not available on ubuntu-latest for x64
# - '3.12.0-beta.2' - not available on ubuntu-latest for x64
# - '3.12.0-beta.3' - not available on ubuntu-latest for x64
# - '3.12.0-beta.4' - not available on ubuntu-latest for x64
# - '3.12.0-rc.1' - not available on ubuntu-latest for x64
# - '3.12.0-rc.2' - not available on ubuntu-latest for x64
# - '3.12.0-rc.3' - not available on ubuntu-latest for x64
- '3.12-dev'
- '3.12.0'
- '3.12.1'
- '3.12.2'
- '3.12.3'
- '3.12.4'
- '3.12.5'
- '3.12.6'
- '3.12.7'
- '3.12.8'
- '3.12.9'
- '3.12.10'
- '3.12.11'
# - '3.13.0-alpha.1' - not available on ubuntu-latest for x64
# - '3.13.0-alpha.2' - not available on ubuntu-latest for x64
# - '3.13.0-alpha.3' - not available on ubuntu-latest for x64
# - '3.13.0-alpha.4' - not available on ubuntu-latest for x64
# - '3.13.0-alpha.5' - not available on ubuntu-latest for x64
# - '3.13.0-alpha.6' - not available on ubuntu-latest for x64
- '3.13.0-beta.1'
- '3.13.0-beta.2'
- '3.13.0-beta.3'
- '3.13.0-beta.4'
- '3.13.0-rc.1'
- '3.13.0-rc.2'
- '3.13.0-rc.3'
- '3.13.0'
- '3.13.1'
- '3.13.2'
- '3.13.3'
- '3.13.4'
- '3.13.5'
- '3.13.6'
- '3.13.7'
# Disables becaused of a pycodestyle issue - see https://github.com/PyCQA/pycodestyle/pull/1287
# - '3.14.0-alpha.0'
# - '3.14.0-alpha.1'
# - '3.14.0-alpha.2'
# - '3.14.0-alpha.3'
# - '3.14.0-alpha.4'
# - '3.14.0-alpha.5'
# - '3.14.0-alpha.6'
# - '3.14.0-alpha.7'
- '3.14.0-beta.1'
- '3.14.0-beta.2'
- '3.14.0-beta.3'
- '3.14.0-beta.4'
- '3.14.0-rc.1'
- '3.14.0-rc.2'
- '3.14.0-rc.3'
- 'pypy-2.7'
- 'pypy-2.7-nightly'
- 'pypy-3.6' # the latest available version of PyPy that supports Python 3.6
- 'pypy-3.6-nightly'
- 'pypy-3.7' # the latest available version of PyPy that supports Python 3.7
- 'pypy-3.7-v7.3.3' # Python 3.7 and PyPy 7.3.3
- 'pypy-3.7-nightly' # Python 3.7 and nightly PyPy
- 'pypy-3.8-nightly'
- 'pypy-3.9-nightly'
- 'pypy-3.10-nightly'
# TODO: Add nightly somehow
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
env: # Temporary workaround for Python 3.5 failures - May 2024
PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org"
- name: Show Python version information
run: |
# Information about Python version
python -VV
python -c "import sys; print(sys.version_info)" || true
python -c "import sys; print(sys._git)" || true
# Information about pip version
pip --version
# Information about Python builtins/keywords
python -c "import sys; import keyword; print({sys.version_info: {'kword': set(keyword.kwlist), 'builtins': set(dir(__builtins__))}})" || true
python -c "import sysconfig; print(dir(sysconfig))" || true
- name: Install dependencies
run: |
pip install --upgrade pip
pip --version
pip install --upgrade pycodestyle
pip install pep257
pip install pydocstyle
pip install --upgrade pyflakes || true
pip install coverage
pip install unittest2
- name: Check codestyle
run: |
# W391, E122 temporarily disabled - https://github.com/PyCQA/pycodestyle/issues/1142
pycodestyle --ignore=W391,E122,E501,E231,W503,E126,E123 *.py */*.py
pycodestyle --select=W391,E122,E501,E231,W503,E126,E123 *.py */*.py || true
pep257 *.py */*.py || true
pydocstyle *.py */*.py || true
pyflakes . || true
- name: Run examples (from unit tests)
run: |
python didyoumean/didyoumean_sugg_tests.py
- name: Run examples (from Readme)
run: |
python didyoumean/readme_examples.py
- name: Run unit-tests without coverage
run: |
python -m unittest discover --start-directory=didyoumean --pattern=*.py
python -m unittest2 discover --start-directory=didyoumean --pattern=*.py || true
- name: Run unit-tests with coverage
run: |
coverage run -m unittest discover --start-directory=didyoumean --pattern=*.py || true
coverage run -m unittest2 discover --start-directory=didyoumean --pattern=*.py || true
- name: Install locally
run: |
pip install . --use-pep517
- name: Run coverage tools
run: |
coveralls || true