99 - cron : ' 0 0 * * sun,wed'
1010
1111jobs :
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
1239 build :
40+ timeout-minutes : 30
1341 runs-on : ${{ matrix.os }}
1442 defaults :
1543 run :
1644 shell : bash
45+
46+ needs : [linters]
47+
1748 strategy :
1849 fail-fast : false
1950 matrix :
20- python-version : [3.6, 3.7, 3.8, 3.9 ]
51+ python-version : ['3.7', '3.8', '3.9', '3.10' ]
2152 os : [ubuntu-latest, macos-latest, windows-latest]
2253 platform : [x64]
2354 include :
4374 # https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg
4475 # with the exception that we enforce the minimum version to be 1.17.0.
4576 #
46- - os : ubuntu-latest
47- manylinux-version : 2010
48- python-version : 3.6
49- build-depends : numpy==1.17.0
50-
5177 - os : ubuntu-latest
5278 manylinux-version : 2010
5379 python-version : 3.7
@@ -63,11 +89,10 @@ jobs:
6389 python-version : 3.9
6490 build-depends : numpy==1.19.3
6591
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
7196
7297 - os : macos-latest
7398 travis-os-name : osx
@@ -87,10 +112,11 @@ jobs:
87112 python-version : 3.9
88113 build-depends : numpy==1.19.3
89114
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
94120
95121 - os : windows-latest
96122 manylinux-version : 2010
@@ -107,14 +133,19 @@ jobs:
107133 python-version : 3.9
108134 build-depends : numpy==1.19.3
109135
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+
110141 env :
111142 PKG_NAME : gensim
112143 REPO_DIR : gensim
113144 BUILD_COMMIT : HEAD
114145 PLAT : x86_64
115146 UNICODE_WIDTH : 32
116147 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
118149 DOCKER_TEST_IMAGE : multibuild/xenial_x86_64
119150 TRAVIS_OS_NAME : ${{ matrix.travis-os-name }}
120151 SKIP_NETWORK_TESTS : 1
@@ -144,7 +175,7 @@ jobs:
144175 run : |
145176 python -m pip install --upgrade pip
146177 pip install virtualenv
147- - name : Build and Install Wheels (Multibuild)
178+ - name : Build Wheel (Multibuild)
148179 if : matrix.os != 'windows-latest'
149180 run : |
150181 echo ::group::Set up Multibuild
@@ -156,17 +187,16 @@ jobs:
156187 before_install
157188 echo ::endgroup::
158189 echo ::group::Build wheel
190+ find . -type f -name "*.egg" -exec rm -v {} \;
159191 build_wheel $REPO_DIR ${{ matrix.PLAT }}
160192 echo ::endgroup::
161- echo ::group::Install run
162- install_run ${{ matrix.PLAT }}
163- echo ::endgroup::
193+
164194 #
165195 # We can't use multibuild on Windows, so we have to roll our own build script.
166196 # Adapted from
167197 # https://github.com/RaRe-Technologies/gensim-wheels/commit/084b863390edee05bbe15d4ec05d1ab726e52202
168198 #
169- - name : Build and Install Wheels (Windows)
199+ - name : Build Wheel (Windows)
170200 if : matrix.os == 'windows-latest'
171201 run : |
172202 echo ::group::Set up dependencies
@@ -190,6 +220,50 @@ jobs:
190220 #
191221 mv dist wheelhouse
192222
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+
193267 - name : Upload wheels to s3://gensim-wheels
194268 #
195269 # Only do this if the credentials are set.
0 commit comments