@@ -17,19 +17,96 @@ jobs:
1717 strategy :
1818 fail-fast : false
1919 matrix :
20- python-version : [3.6, 3.7, 3.8]
21- os : [ubuntu-latest, macos-latest]
20+ python-version : [3.6, 3.7, 3.8, 3.9 ]
21+ os : [ubuntu-latest, macos-latest, windows-latest ]
2222 platform : [x64]
2323 include :
24+ #
25+ # We want the _oldest_ possible manylinux version to ensure our
26+ # wheels work on the widest possible range of distros. Version 1
27+ # seems to break for certain Python versions under Linux and Windows,
28+ # so we use 2010, which is the next oldest.
29+ #
30+ # When selecting the numpy version to build against, we need to satisfy
31+ # two conditions. First, we want the wheel to be available for the
32+ # version of Python we're building against, because building numpy
33+ # wheels on our own is too much work.
34+ #
35+ # Second, in order to guarantee compatibility with the greatest range
36+ # of numpy versions, we want to build against the oldest possible numpy
37+ # version, as long as it's 1.17.0 or newer. Building versions earlier
38+ # than 1.17.0 yields wheels that are incompatible with some newer
39+ # versions of numpy. See https://github.com/RaRe-Technologies/gensim/issues/3226
40+ # for details.
41+ #
42+ # The logic for numpy version selection is based on
43+ # https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg
44+ # with the exception that we enforce the minimum version to be 1.17.0.
45+ #
2446 - os : ubuntu-latest
47+ manylinux-version : 2010
48+ python-version : 3.6
49+ build-depends : numpy==1.17.0
50+
51+ - os : ubuntu-latest
52+ manylinux-version : 2010
2553 python-version : 3.7
26- skip-network-tests : 1
54+ build-depends : numpy==1.17.0
55+
56+ - os : ubuntu-latest
57+ manylinux-version : 2010
58+ python-version : 3.8
59+ build-depends : numpy==1.17.3
60+
2761 - os : ubuntu-latest
62+ manylinux-version : 2010
63+ python-version : 3.9
64+ build-depends : numpy==1.19.3
65+
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
71+
72+ - os : macos-latest
73+ travis-os-name : osx
74+ manylinux-version : 1
75+ python-version : 3.7
76+ build-depends : numpy==1.17.0
77+
78+ - os : macos-latest
79+ travis-os-name : osx
80+ manylinux-version : 1
2881 python-version : 3.8
29- skip-network-tests : 1
82+ build-depends : numpy==1.21.0
83+
3084 - os : macos-latest
31- travis-os-name : osx # For multibuild
32- skip-network-tests : 1
85+ travis-os-name : osx
86+ manylinux-version : 1
87+ python-version : 3.9
88+ build-depends : numpy==1.21.0
89+
90+ - os : windows-latest
91+ manylinux-version : 2010
92+ python-version : 3.6
93+ build-depends : numpy==1.17.0
94+
95+ - os : windows-latest
96+ manylinux-version : 2010
97+ python-version : 3.7
98+ build-depends : numpy==1.17.0
99+
100+ - os : windows-latest
101+ manylinux-version : 2010
102+ python-version : 3.8
103+ build-depends : numpy==1.17.3
104+
105+ - os : windows-latest
106+ manylinux-version : 2010
107+ python-version : 3.9
108+ build-depends : numpy==1.19.3
109+
33110 env :
34111 PKG_NAME : gensim
35112 REPO_DIR : gensim
@@ -40,7 +117,11 @@ jobs:
40117 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
41118 DOCKER_TEST_IMAGE : multibuild/xenial_x86_64
42119 TRAVIS_OS_NAME : ${{ matrix.travis-os-name }}
43- SKIP_NETWORK_TESTS : ${{ matrix.skip-network-tests }}
120+ SKIP_NETWORK_TESTS : 1
121+ MB_ML_VER : ${{ matrix.manylinux-version }}
122+ WHEELHOUSE_UPLOADER_USERNAME : ${{ secrets.AWS_ACCESS_KEY_ID }}
123+ WHEELHOUSE_UPLOADER_SECRET : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
124+ BUILD_DEPENDS : ${{ matrix.build-depends }}
44125
45126 steps :
46127 - uses : actions/checkout@v2
50131 - name : Print environment variables
51132 run : |
52133 echo "PLAT: ${PLAT}"
134+ echo "MB_ML_VER: ${MB_ML_VER}"
53135 echo "DOCKER_TEST_IMAGE: ${DOCKER_TEST_IMAGE}"
54136 echo "TEST_DEPENDS: ${TEST_DEPENDS}"
55137 echo "TRAVIS_OS_NAME: ${TRAVIS_OS_NAME}"
62144 run : |
63145 python -m pip install --upgrade pip
64146 pip install virtualenv
65- - name : Build and Install Wheels
147+ - name : Build and Install Wheels (Multibuild)
148+ if : matrix.os != 'windows-latest'
66149 run : |
67150 echo ::group::Set up Multibuild
68151 source multibuild/common_utils.sh
@@ -78,9 +161,47 @@ jobs:
78161 echo ::group::Install run
79162 install_run ${{ matrix.PLAT }}
80163 echo ::endgroup::
164+ #
165+ # We can't use multibuild on Windows, so we have to roll our own build script.
166+ # Adapted from
167+ # https://github.com/RaRe-Technologies/gensim-wheels/commit/084b863390edee05bbe15d4ec05d1ab726e52202
168+ #
169+ - name : Build and Install Wheels (Windows)
170+ if : matrix.os == 'windows-latest'
171+ run : |
172+ echo ::group::Set up dependencies
173+ python --version
174+ python -c "import struct; print(struct.calcsize('P') * 8)"
175+
176+ python -m pip install -U pip setuptools wheel wheelhouse_uploader ${{ env.BUILD_DEPENDS }}
177+ echo ::endgroup::
178+
179+ echo ::group::Build wheel
180+ python setup.py bdist_wheel
181+ echo ::endgroup
182+
183+ echo ::group::Install run
184+ ls dist
185+ python continuous_integration/install_wheel.py
186+ echo ::endgroup::
187+
188+ #
189+ # For consistency with the multibuild step.
190+ #
191+ mv dist wheelhouse
192+
81193 - name : Upload wheels to s3://gensim-wheels
82- if : always()
194+ #
195+ # Only do this if the credentials are set.
196+ # This means that PRs will still build wheels, but not upload them.
197+ # (PRs do not have access to secrets).
198+ #
199+ # The always() ensures this step runs even if a previous step fails.
200+ # We want to upload wheels whenever possible (even if e.g. tests failed)
201+ # because we don't want an innocuous test failure from blocking a release.
202+ #
203+ if : ${{ always() && env.WHEELHOUSE_UPLOADER_USERNAME && env.WHEELHOUSE_UPLOADER_SECRET }}
83204 run : |
84- pip install wheelhouse-uploader
85- ls wheelhouse/*.whl
86- python -m wheelhouse_uploader upload --local-folder wheelhouse/ --no-ssl-check gensim-wheels --provider S3 --no-enable-cdn
205+ pip install wheelhouse-uploader
206+ ls wheelhouse/*.whl
207+ python -m wheelhouse_uploader upload --local-folder wheelhouse/ --no-ssl-check gensim-wheels --provider S3 --no-enable-cdn
0 commit comments