Skip to content

Commit 3d72896

Browse files
committed
Merge branch 'release-4.1.1'
2 parents 109c88e + 1d2af3a commit 3d72896

File tree

12 files changed

+199
-26
lines changed

12 files changed

+199
-26
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: circleci/python:3.7.4
5+
- image: cimg/python:3.8.11
66

77
working_directory: ~/gensim
88

@@ -18,12 +18,12 @@ jobs:
1818
sudo apt-get -yq update
1919
sudo apt-get -yq remove texlive-binaries --purge
2020
sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install dvipng texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended latexmk
21-
sudo apt-get -yq install build-essential python3.7-dev
21+
sudo apt-get -yq install build-essential python3.8-dev
2222
2323
- run:
2424
name: Basic installation (tox)
2525
command: |
26-
python3.7 -m virtualenv venv
26+
python3.8 -m virtualenv venv
2727
source venv/bin/activate
2828
pip install tox --progress-bar off
2929

.github/workflows/build-wheels.yml

+133-12
Original file line numberDiff line numberDiff line change
@@ -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
@@ -50,6 +131,7 @@ jobs:
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}"
@@ -62,7 +144,8 @@ jobs:
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

.travis.yml

+22-7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ branches:
44
- travis
55
language: python
66
arch: arm64-graviton2
7+
#
8+
# https://docs.travis-ci.com/user/reference/focal/
9+
#
710
dist: focal
811
virt: vm
912
group: edge
@@ -17,13 +20,30 @@ env:
1720
- MB_ML_VER=2014
1821
- SKIP_NETWORK_TESTS=1
1922
- DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8
20-
- BUILD_DEPENDS="numpy==1.19.2 scipy==1.5.3"
23+
#
24+
# Build wheels with the oldest possible numpy version to avoid
25+
# the problem encountered by:
26+
#
27+
# https://github.com/RaRe-Technologies/gensim/issues/3085
28+
#
29+
- BUILD_DEPENDS="oldest-supported-numpy scipy==1.7.0"
30+
#
31+
# The contents of this file mirror the linux_testenv list
32+
# in gensim's setup.py. I can't think of a better way to include
33+
# them here for now. They'll get picked up by the multibuild stuff
34+
# running in multibuild/common_utils.sh.
35+
#
2136
- TEST_DEPENDS="pytest mock cython nmslib pyemd testfixtures Morfessor==2.0.2a4 python-levenshtein==0.12.0 visdom==0.1.8.9 scikit-learn"
2237

2338
matrix:
2439
- os: linux
2540
env:
2641
- MB_PYTHON_VERSION=3.6
42+
#
43+
# scipy 1.7.0 wheels not available for Py3.6, so we have to build using
44+
# an older version.
45+
#
46+
- BUILD_DEPENDS="oldest-supported-numpy scipy==1.5.3"
2747
- os: linux
2848
env:
2949
- MB_PYTHON_VERSION=3.7
@@ -33,6 +53,7 @@ matrix:
3353
- os: linux
3454
env:
3555
- MB_PYTHON_VERSION=3.9
56+
3657
before_install:
3758
- source multibuild/common_utils.sh
3859
- source multibuild/travis_steps.sh
@@ -45,9 +66,3 @@ after_script:
4566
- ls -laht ${TRAVIS_BUILD_DIR}/wheelhouse/
4667
- pip install wheelhouse-uploader
4768
- python -m wheelhouse_uploader upload --local-folder ${TRAVIS_BUILD_DIR}/wheelhouse/ --no-ssl-check gensim-wheels --provider S3 --no-enable-cdn
48-
49-
notifications:
50-
email:
51-
52-
on_success: always
53-
on_failure: always

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Changes
33

44
## Unreleased
55

6+
## 4.1.1, 2021-09-14
7+
8+
This is a bugfix release that addresses compatibility issues with older versions of numpy.
9+
610
## 4.1.0, 2021-08-15
711

812
Gensim 4.1 brings two major new functionalities:

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,4 @@ BibTeX entry:
176176
[OpenBLAS]: http://xianyi.github.io/OpenBLAS/
177177
[source tar.gz]: http://pypi.python.org/pypi/gensim
178178
[documentation]: http://radimrehurek.com/gensim/install.html
179+

config.sh

+11
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ function pre_build {
66
:
77
}
88

9+
function pip_opts {
10+
[ -n "$MANYLINUX_URL" ] && echo "--find-links $MANYLINUX_URL"
11+
echo "-v"
12+
}
13+
914
function build_wheel_cmd {
15+
set -x
1016
local cmd=${1:-pip_wheel_cmd}
1117
local wheelhouse=$(abspath ${WHEEL_SDIR:-wheelhouse})
1218
start_spinner
@@ -15,13 +21,18 @@ function build_wheel_cmd {
1521
if [ -n "$BUILD_DEPENDS" ]; then
1622
pip install $(pip_opts) $BUILD_DEPENDS
1723
fi
24+
pip --version
25+
pip freeze
1826
$cmd $wheelhouse
1927
repair_wheelhouse $wheelhouse
28+
set +x
2029
}
2130

2231
function run_tests {
2332
# Runs tests on installed distribution from an empty directory
33+
set -x
2434
python --version
2535
pip freeze
2636
pytest -rfxEXs --durations=20 --disable-warnings --showlocals --pyargs gensim
37+
set +x
2738
}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Install the built wheel for testing under AppVeyor.
2+
3+
Assumes that gensim/dist contains a single wheel to install.
4+
"""
5+
import os
6+
import subprocess
7+
8+
curr_dir = os.path.dirname(__file__)
9+
dist_path = os.path.join(curr_dir, '..', 'dist')
10+
wheels = [
11+
os.path.join(dist_path, f)
12+
for f in os.listdir(dist_path) if f.endswith('.whl')
13+
]
14+
assert len(wheels) == 1, "wheels = %r" % wheels
15+
16+
command = 'pip install --pre --force-reinstall'.split() + [wheels[0]]
17+
subprocess.check_call(command)

docs/src/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
# The short X.Y version.
6464
version = '4.1'
6565
# The full version, including alpha/beta/rc tags.
66-
release = '4.1.0'
66+
release = '4.1.1'
6767

6868
# The language for content autogenerated by Sphinx. Refer to documentation
6969
# for a list of supported languages.

gensim/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
"""
66

7-
__version__ = '4.1.0'
7+
__version__ = '4.1.1'
88

99
import logging
1010

release/push.sh

+4
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
#
44
# Run this after you've verified the results of merge.sh.
55
#
6+
set -euxo pipefail
7+
release=$RELEASE
8+
69
git push --tags upstream master
710
git push upstream develop
11+
git push upstream release-"$release"

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def run(self):
338338

339339
setup(
340340
name='gensim',
341-
version='4.1.0',
341+
version='4.1.1',
342342
description='Python framework for fast Vector Space Modelling',
343343
long_description=LONG_DESCRIPTION,
344344

0 commit comments

Comments
 (0)