@@ -15,10 +15,10 @@ jobs:
1515 linters :
1616 runs-on : ubuntu-latest
1717 steps :
18- - uses : actions/checkout@v2
18+ - uses : actions/checkout@v3
1919
2020 - name : Setup up Python ${{ matrix.python }}
21- uses : actions/setup-python@v2
21+ uses : actions/setup-python@v4
2222 with :
2323 python-version : ${{ matrix.python }}
2424
3636
3737 - name : Check Sphinx Gallery cache
3838 run : python docs/src/check_gallery.py
39- build :
40- timeout-minutes : 30
39+
40+ multibuild :
41+ timeout-minutes : 35
4142 runs-on : ${{ matrix.os }}
4243 defaults :
4344 run :
4849 strategy :
4950 fail-fast : false
5051 matrix :
51- python-version : ['3.7', '3.8', '3.9', '3.10']
52- os : [ubuntu-latest, macos-latest, windows-latest]
53- platform : [x64]
5452 include :
5553 #
5654 # We want the _oldest_ possible manylinux version to ensure our
@@ -76,86 +74,68 @@ jobs:
7674 #
7775 - os : ubuntu-latest
7876 manylinux-version : 2010
79- python-version : 3.7
80- build-depends : numpy==1.17.0
81-
82- - os : ubuntu-latest
83- manylinux-version : 2010
84- python-version : 3.8
77+ python-version : " 3.8"
8578 build-depends : numpy==1.17.3
8679
8780 - os : ubuntu-latest
8881 manylinux-version : 2010
89- python-version : 3.9
82+ python-version : " 3.9"
9083 build-depends : numpy==1.19.3
9184
9285 - os : ubuntu-latest
9386 manylinux-version : 2014
9487 python-version : " 3.10"
9588 build-depends : numpy==1.22.2 scipy==1.8.0
89+
90+ - os : ubuntu-latest
91+ manylinux-version : 2014
92+ python-version : " 3.11"
93+ build-depends : numpy==1.23.2 scipy==1.9.2
9694
9795 - os : macos-latest
9896 travis-os-name : osx
9997 manylinux-version : 1
100- python-version : 3.7
101- build-depends : numpy==1.17.0
102-
103- - os : macos-latest
104- travis-os-name : osx
105- manylinux-version : 1
106- python-version : 3.8
98+ python-version : " 3.8"
10799 build-depends : numpy==1.17.3
108100
109101 - os : macos-latest
110102 travis-os-name : osx
111103 manylinux-version : 1
112- python-version : 3.9
104+ python-version : " 3.9"
113105 build-depends : numpy==1.19.3
114106
115107 - os : macos-latest
116108 travis-os-name : osx
117109 manylinux-version : 1
118110 python-version : " 3.10"
119111 build-depends : numpy==1.22.2 scipy==1.8.0
120-
121- - os : windows-latest
122- manylinux-version : 2010
123- python-version : 3.7
124- build-depends : numpy==1.17.0
125-
126- - os : windows-latest
127- manylinux-version : 2010
128- python-version : 3.8
129- build-depends : numpy==1.17.3
130-
131- - os : windows-latest
132- manylinux-version : 2010
133- python-version : 3.9
134- build-depends : numpy==1.19.3
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
112+
113+ - os : macos-latest
114+ travis-os-name : osx
115+ manylinux-version : 1
116+ python-version : " 3.11"
117+ build-depends : numpy==1.23.2 scipy==1.9.2
140118
141119 env :
142- PKG_NAME : gensim
143- REPO_DIR : gensim
144- BUILD_COMMIT : HEAD
145- PLAT : x86_64
146- UNICODE_WIDTH : 32
147- MB_PYTHON_VERSION : ${{ matrix.python-version }} # MB_PYTHON_VERSION is needed by Multibuild
120+ SKIP_NETWORK_TESTS : 1
148121 TEST_DEPENDS : pytest mock testfixtures
122+ BUILD_DEPENDS : ${{ matrix.build-depends }}
123+
124+ #
125+ # For multibuild
126+ #
127+ BUILD_COMMIT : HEAD
149128 DOCKER_TEST_IMAGE : multibuild/xenial_x86_64
150- TRAVIS_OS_NAME : ${{ matrix.travis-os-name }}
151- SKIP_NETWORK_TESTS : 1
152129 MB_ML_VER : ${{ matrix.manylinux-version }}
153- WHEELHOUSE_UPLOADER_USERNAME : ${{ secrets.AWS_ACCESS_KEY_ID }}
154- WHEELHOUSE_UPLOADER_SECRET : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
155- BUILD_DEPENDS : ${{ matrix.build-depends }}
130+ MB_PYTHON_VERSION : ${{ matrix.python-version }} # MB_PYTHON_VERSION is needed by Multibuild
131+ PKG_NAME : gensim
132+ PLAT : x86_64
133+ REPO_DIR : gensim
134+ TRAVIS_OS_NAME : ${{ matrix.travis-os-name }}
135+ UNICODE_WIDTH : 32
156136
157137 steps :
158- - uses : actions/checkout@v2
138+ - uses : actions/checkout@v3
159139 with :
160140 submodules : recursive
161141 fetch-depth : 0
@@ -168,15 +148,14 @@ jobs:
168148 echo "TRAVIS_OS_NAME: ${TRAVIS_OS_NAME}"
169149 echo "SKIP_NETWORK_TESTS: ${SKIP_NETWORK_TESTS}"
170150 - name : Set up Python ${{ matrix.python-version }}
171- uses : actions/setup-python@v2
151+ uses : actions/setup-python@v4
172152 with :
173153 python-version : ${{ matrix.python-version }}
174154 - name : Install dependencies
175155 run : |
176156 python -m pip install --upgrade pip
177157 pip install virtualenv
178- - name : Build Wheel (Multibuild)
179- if : matrix.os != 'windows-latest'
158+ - name : Build Wheel
180159 run : |
181160 echo ::group::Set up Multibuild
182161 source multibuild/common_utils.sh
@@ -191,32 +170,125 @@ jobs:
191170 build_wheel $REPO_DIR ${{ matrix.PLAT }}
192171 echo ::endgroup::
193172
173+ - name : Prepare for testing
174+ run : |
175+ #
176+ # FIXME: Why are these eggs here?
177+ #
178+ # These eggs prevent the wheel from building and running on Py3.10
179+ #
180+ find . -type f -name "*.egg" -exec rm -v {} \;
181+ python -m venv test_environment
182+
194183 #
195- # We can't use multibuild on Windows, so we have to roll our own build script.
196- # Adapted from
197- # https://github.com/RaRe-Technologies/gensim-wheels/commit/084b863390edee05bbe15d4ec05d1ab726e52202
184+ # Multibuild has a test step but it essentially just installs the wheel
185+ # and runs the test, and requires a lot of magic to get it working.
186+ # It also does not work under Windows.
187+ # So, we create our own simple test step here.
198188 #
199- - name : Build Wheel (Windows)
200- if : matrix.os == 'windows-latest'
189+ - name : Install and Test Wheel
190+ run : |
191+ . test_environment/bin/activate
192+ python -m pip install --upgrade pip
193+ pip install pytest testfixtures mock
194+ pip install wheelhouse/*.whl
195+ cd test_environment
196+ python -c 'import gensim;print(gensim.__version__)'
197+ #
198+ # This part relies on the wheel containing tests and required data.
199+ # If we remove that from the wheel, we'll need to rewrite this step.
200+ #
201+ pytest -rfxEXs --durations=20 --disable-warnings --showlocals --pyargs gensim
202+
203+ - name : Upload wheels to s3://gensim-wheels
204+ #
205+ # Only do this if the credentials are set.
206+ # This means that PRs will still build wheels, but not upload them.
207+ # (PRs do not have access to secrets).
208+ #
209+ # The always() ensures this step runs even if a previous step fails.
210+ # We want to upload wheels whenever possible (even if e.g. tests failed)
211+ # because we don't want an innocuous test failure from blocking a release.
212+ #
213+ if : ${{ always() && env.WHEELHOUSE_UPLOADER_USERNAME && env.WHEELHOUSE_UPLOADER_SECRET }}
214+ run : |
215+ python -m pip install wheelhouse-uploader
216+ ls wheelhouse/*.whl
217+ python -m wheelhouse_uploader upload --local-folder wheelhouse/ --no-ssl-check gensim-wheels --provider S3 --no-enable-cdn
218+ env :
219+ WHEELHOUSE_UPLOADER_USERNAME : ${{ secrets.AWS_ACCESS_KEY_ID }}
220+ WHEELHOUSE_UPLOADER_SECRET : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
221+
222+
223+ #
224+ # The build process for windows is different to that of Linux and MacOS.
225+ # First, we cannot use multibuild (it does not support Windows).
226+ # This means we have to write our own building and testing steps, but in a
227+ # way it's simpler, because we don't need to care about configuring
228+ # multibuild ourselves.
229+ # Second, the syntax to enable virtual environments, etc. is different.
230+ #
231+ build_windows :
232+ timeout-minutes : 35
233+ runs-on : windows-latest
234+ defaults :
235+ run :
236+ shell : bash
237+
238+ needs : [linters]
239+
240+ strategy :
241+ fail-fast : false
242+ matrix :
243+ include :
244+ - python-version : " 3.8"
245+ build-depends : numpy==1.17.3
246+
247+ - python-version : " 3.9"
248+ build-depends : numpy==1.19.3
249+
250+ - python-version : " 3.10"
251+ build-depends : numpy==1.22.2 scipy==1.8.0
252+
253+ - python-version : " 3.11"
254+ build-depends : numpy==1.23.2 scipy==1.9.2
255+
256+ env :
257+ SKIP_NETWORK_TESTS : 1
258+ TEST_DEPENDS : pytest mock testfixtures
259+ BUILD_DEPENDS : ${{ matrix.build-depends }}
260+
261+ steps :
262+ - uses : actions/checkout@v3
263+ with :
264+ submodules : recursive
265+ fetch-depth : 0
266+ - name : Set up Python ${{ matrix.python-version }}
267+ uses : actions/setup-python@v4
268+ with :
269+ python-version : ${{ matrix.python-version }}
270+ - name : Install dependencies
271+ run : |
272+ python -m pip install --upgrade pip
273+ pip install virtualenv
274+
275+ - name : Build Wheel
201276 run : |
202277 echo ::group::Set up dependencies
203278 python --version
204279 python -c "import struct; print(struct.calcsize('P') * 8)"
205-
206280 python -m pip install -U pip setuptools wheel wheelhouse_uploader ${{ env.BUILD_DEPENDS }}
207281 echo ::endgroup::
208-
209282 echo ::group::Build wheel
210283 python setup.py bdist_wheel
211284 echo ::endgroup
212-
213285 echo ::group::Install run
214286 ls dist
215287 python continuous_integration/install_wheel.py
216288 echo ::endgroup::
217-
218289 #
219- # For consistency with the multibuild step.
290+ # For consistency with the multibuild step. The wheel uploader expects
291+ # the wheels to be under wheelhouse.
220292 #
221293 mv dist wheelhouse
222294
@@ -230,34 +302,14 @@ jobs:
230302 find . -type f -name "*.egg" -exec rm -v {} \;
231303 python -m venv test_environment
232304
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-
253305 #
254306 # We need a separate testing step for windows because the command for
255307 # activating the virtual environment is slightly different
256308 #
257309 - name : Install and Test Wheel (Windows)
258- if : matrix.os == 'windows-latest'
259310 run : |
260311 test_environment/Scripts/activate.bat
312+ python -m pip install --upgrade pip
261313 pip install pytest testfixtures mock
262314 pip install wheelhouse/*.whl
263315 cd test_environment
@@ -276,6 +328,9 @@ jobs:
276328 #
277329 if : ${{ always() && env.WHEELHOUSE_UPLOADER_USERNAME && env.WHEELHOUSE_UPLOADER_SECRET }}
278330 run : |
279- pip install wheelhouse-uploader
331+ python -m pip install wheelhouse-uploader
280332 ls wheelhouse/*.whl
281333 python -m wheelhouse_uploader upload --local-folder wheelhouse/ --no-ssl-check gensim-wheels --provider S3 --no-enable-cdn
334+ env :
335+ WHEELHOUSE_UPLOADER_USERNAME : ${{ secrets.AWS_ACCESS_KEY_ID }}
336+ WHEELHOUSE_UPLOADER_SECRET : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
0 commit comments