-
-
Notifications
You must be signed in to change notification settings - Fork 382
221 lines (177 loc) · 6.55 KB
/
python-package.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
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
name: Test
on: [push, pull_request]
jobs:
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup up Python 3.11
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Update pip
run: python -m pip install -U pip
- name: Install dependencies
run: python -m pip install flake8
- name: Run flake8 linter (source)
run: flake8 --show-source smart_open
unit_tests:
needs: [linters]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- {python: '3.8', os: ubuntu-20.04}
- {python: '3.9', os: ubuntu-20.04}
- {python: '3.10', os: ubuntu-20.04}
- {python: '3.11', os: ubuntu-20.04}
- {python: '3.8', os: windows-2019}
- {python: '3.9', os: windows-2019}
- {python: '3.10', os: windows-2019}
- {python: '3.11', os: windows-2019}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install -U pip
#
# https://askubuntu.com/questions/1428181/module-lib-has-no-attribute-x509-v-flag-cb-issuer-check
#
- name: Upgrade PyOpenSSL
run: python -m pip install pyOpenSSL --upgrade
- name: Install smart_open without dependencies
run: pip install -e .
- name: Check that smart_open imports without dependencies
run: python -c 'import smart_open'
- name: Install smart_open and its dependencies
run: pip install -e .[test]
- name: Run unit tests
run: pytest smart_open -v -rfxECs --durations=20
doctest:
needs: [linters,unit_tests]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- {python: '3.8', os: ubuntu-20.04}
- {python: '3.9', os: ubuntu-20.04}
- {python: '3.10', os: ubuntu-20.04}
- {python: '3.11', os: ubuntu-20.04}
#
# Some of the doctests don't pass on Windows because of Windows-specific
# character encoding issues.
#
# - {python: '3.7', os: windows-2019}
# - {python: '3.8', os: windows-2019}
# - {python: '3.9', os: windows-2019}
# - {python: '3.10', os: windows-2019}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install -U pip
- name: Upgrade PyOpenSSL
run: python -m pip install pyOpenSSL --upgrade
- name: Install smart_open and its dependencies
run: pip install -e .[test]
- name: Run doctests
run: python ci_helpers/doctest.py
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
integration:
needs: [linters,unit_tests]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- {python: '3.8', os: ubuntu-20.04}
- {python: '3.9', os: ubuntu-20.04}
- {python: '3.10', os: ubuntu-20.04}
- {python: '3.11', os: ubuntu-20.04}
# Not sure why we exclude these, perhaps for historical reasons?
#
# - {python: '3.7', os: windows-2019}
# - {python: '3.8', os: windows-2019}
# - {python: '3.9', os: windows-2019}
# - {python: '3.10', os: windows-2019}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install -U pip
- name: Upgrade PyOpenSSL
run: python -m pip install pyOpenSSL --upgrade
- run: python -m pip install numpy
- name: Install smart_open and its dependencies
run: pip install -e .[test]
- run: bash ci_helpers/helpers.sh enable_moto_server
if: ${{ matrix.moto_server }}
- run: |
sudo apt-get install vsftpd
sudo bash ci_helpers/helpers.sh create_ftp_ftps_servers
- name: Run integration tests
run: python ci_helpers/run_integration_tests.py
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- run: bash ci_helpers/helpers.sh disable_moto_server
if: ${{ matrix.moto_server }}
- run: sudo bash ci_helpers/helpers.sh delete_ftp_ftps_servers
benchmarks:
needs: [linters,unit_tests]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- {python: '3.8', os: ubuntu-20.04}
- {python: '3.9', os: ubuntu-20.04}
- {python: '3.10', os: ubuntu-20.04}
- {python: '3.11', os: ubuntu-20.04}
# - {python: '3.7', os: windows-2019}
# - {python: '3.8', os: windows-2019}
# - {python: '3.9', os: windows-2019}
# - {python: '3.10', os: windows-2019}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install -U pip
- name: Upgrade PyOpenSSL
run: python -m pip install pyOpenSSL --upgrade
- name: Install smart_open and its dependencies
run: pip install -e .[test]
- run: pip install awscli pytest_benchmark
- name: Run benchmarks
run: python ci_helpers/run_benchmarks.py
env:
SO_BUCKET: smart-open
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
#
# The test_coverage environment in tox.ini generates coverage data and
# saves it to disk. This step uploads that data. We do it
# separately from the tox env because the upload can fail for various
# reasons (e.g. https://github.com/lemurheavy/coveralls-public/issues/1392)
# and we don't want it to break the build.
#
# Looks like there's a github action for this
# (https://github.com/coverallsapp/github-action/issues/30) but it does
# not work with pytest output.
#
# - name: Upload code coverage to coveralls.io
# if: ${{ matrix.coveralls }}
# continue-on-error: true
# env:
# GITHUB_TOKEN: ${{ github.token }}
# run: |
# pip install coveralls
# coveralls