9
9
- cron : ' 0 0 * * sun,wed'
10
10
11
11
jobs :
12
+ #
13
+ # The linters job duplicates tests.yml, can't think of a way to avoid this right now.
14
+ #
15
+ linters :
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - uses : actions/checkout@v2
19
+
20
+ - name : Setup up Python ${{ matrix.python }}
21
+ uses : actions/setup-python@v2
22
+ with :
23
+ python-version : ${{ matrix.python }}
24
+
25
+ - name : Update pip
26
+ run : python -m pip install -U pip
27
+
28
+ - name : Install dependencies
29
+ run : python -m pip install flake8 flake8-rst
30
+
31
+ - name : Run flake8 linter (source)
32
+ run : flake8 --ignore E12,W503 --max-line-length 120 --show-source gensim
33
+
34
+ # - name: Run flake8 linter (documentation)
35
+ # run: flake8 --ignore E202,E402,E302,E305,F821 --max-line-length 120 --filename '*.py,*.rst' docs
36
+
37
+ - name : Check Sphinx Gallery cache
38
+ run : python docs/src/check_gallery.py
12
39
build :
40
+ timeout-minutes : 30
13
41
runs-on : ${{ matrix.os }}
14
42
defaults :
15
43
run :
16
44
shell : bash
45
+
46
+ needs : [linters]
47
+
17
48
strategy :
18
49
fail-fast : false
19
50
matrix :
20
- python-version : [3.6, 3.7, 3.8, 3.9 ]
51
+ python-version : ['3.7', '3.8', '3.9', '3.10' ]
21
52
os : [ubuntu-latest, macos-latest, windows-latest]
22
53
platform : [x64]
23
54
include :
43
74
# https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg
44
75
# with the exception that we enforce the minimum version to be 1.17.0.
45
76
#
46
- - os : ubuntu-latest
47
- manylinux-version : 2010
48
- python-version : 3.6
49
- build-depends : numpy==1.17.0
50
-
51
77
- os : ubuntu-latest
52
78
manylinux-version : 2010
53
79
python-version : 3.7
@@ -63,11 +89,10 @@ jobs:
63
89
python-version : 3.9
64
90
build-depends : numpy==1.19.3
65
91
66
- - os : macos-latest
67
- travis-os-name : osx
68
- manylinux-version : 1
69
- python-version : 3.6
70
- build-depends : numpy==1.17.0
92
+ - os : ubuntu-latest
93
+ manylinux-version : 2014
94
+ python-version : " 3.10"
95
+ build-depends : numpy==1.22.2 scipy==1.8.0
71
96
72
97
- os : macos-latest
73
98
travis-os-name : osx
@@ -87,10 +112,11 @@ jobs:
87
112
python-version : 3.9
88
113
build-depends : numpy==1.19.3
89
114
90
- - os : windows-latest
91
- manylinux-version : 2010
92
- python-version : 3.6
93
- build-depends : numpy==1.17.0
115
+ - os : macos-latest
116
+ travis-os-name : osx
117
+ manylinux-version : 1
118
+ python-version : " 3.10"
119
+ build-depends : numpy==1.22.2 scipy==1.8.0
94
120
95
121
- os : windows-latest
96
122
manylinux-version : 2010
@@ -107,14 +133,19 @@ jobs:
107
133
python-version : 3.9
108
134
build-depends : numpy==1.19.3
109
135
136
+ - os : windows-latest
137
+ manylinux-version : 2010
138
+ python-version : " 3.10"
139
+ build-depends : numpy==1.22.2 scipy==1.8.0
140
+
110
141
env :
111
142
PKG_NAME : gensim
112
143
REPO_DIR : gensim
113
144
BUILD_COMMIT : HEAD
114
145
PLAT : x86_64
115
146
UNICODE_WIDTH : 32
116
147
MB_PYTHON_VERSION : ${{ matrix.python-version }} # MB_PYTHON_VERSION is needed by Multibuild
117
- TEST_DEPENDS : Morfessor==2.0.2a4 python-levenshtein==0.12.0 visdom==0.1.8.9 pytest mock cython nmslib pyemd testfixtures scikit-learn pyemd
148
+ TEST_DEPENDS : pytest mock testfixtures
118
149
DOCKER_TEST_IMAGE : multibuild/xenial_x86_64
119
150
TRAVIS_OS_NAME : ${{ matrix.travis-os-name }}
120
151
SKIP_NETWORK_TESTS : 1
@@ -144,7 +175,7 @@ jobs:
144
175
run : |
145
176
python -m pip install --upgrade pip
146
177
pip install virtualenv
147
- - name : Build and Install Wheels (Multibuild)
178
+ - name : Build Wheel (Multibuild)
148
179
if : matrix.os != 'windows-latest'
149
180
run : |
150
181
echo ::group::Set up Multibuild
@@ -156,17 +187,16 @@ jobs:
156
187
before_install
157
188
echo ::endgroup::
158
189
echo ::group::Build wheel
190
+ find . -type f -name "*.egg" -exec rm -v {} \;
159
191
build_wheel $REPO_DIR ${{ matrix.PLAT }}
160
192
echo ::endgroup::
161
- echo ::group::Install run
162
- install_run ${{ matrix.PLAT }}
163
- echo ::endgroup::
193
+
164
194
#
165
195
# We can't use multibuild on Windows, so we have to roll our own build script.
166
196
# Adapted from
167
197
# https://github.com/RaRe-Technologies/gensim-wheels/commit/084b863390edee05bbe15d4ec05d1ab726e52202
168
198
#
169
- - name : Build and Install Wheels (Windows)
199
+ - name : Build Wheel (Windows)
170
200
if : matrix.os == 'windows-latest'
171
201
run : |
172
202
echo ::group::Set up dependencies
@@ -190,6 +220,50 @@ jobs:
190
220
#
191
221
mv dist wheelhouse
192
222
223
+ - name : Prepare for testing
224
+ run : |
225
+ #
226
+ # FIXME: Why are these eggs here?
227
+ #
228
+ # These eggs prevent the wheel from building and running on Py3.10
229
+ #
230
+ find . -type f -name "*.egg" -exec rm -v {} \;
231
+ python -m venv test_environment
232
+
233
+ #
234
+ # Multibuild has a test step but it essentially just installs the wheel
235
+ # and runs the test, and requires a lot of magic to get it working.
236
+ # It also does not work under Windows.
237
+ # So, we create our own simple test step here.
238
+ #
239
+ - name : Install and Test Wheel (Linux, MacOS)
240
+ if : matrix.os != 'windows-latest'
241
+ run : |
242
+ . test_environment/bin/activate
243
+ pip install pytest testfixtures mock
244
+ pip install wheelhouse/*.whl
245
+ cd test_environment
246
+ python -c 'import gensim;print(gensim.__version__)'
247
+ #
248
+ # This part relies on the wheel containing tests and required data.
249
+ # If we remove that from the wheel, we'll need to rewrite this step.
250
+ #
251
+ pytest -rfxEXs --durations=20 --disable-warnings --showlocals --pyargs gensim
252
+
253
+ #
254
+ # We need a separate testing step for windows because the command for
255
+ # activating the virtual environment is slightly different
256
+ #
257
+ - name : Install and Test Wheel (Windows)
258
+ if : matrix.os == 'windows-latest'
259
+ run : |
260
+ test_environment/Scripts/activate.bat
261
+ pip install pytest testfixtures mock
262
+ pip install wheelhouse/*.whl
263
+ cd test_environment
264
+ python -c 'import gensim;print(gensim.__version__)'
265
+ pytest -rfxEXs --durations=20 --disable-warnings --showlocals --pyargs gensim
266
+
193
267
- name : Upload wheels to s3://gensim-wheels
194
268
#
195
269
# Only do this if the credentials are set.
0 commit comments