Skip to content

Commit e9ee434

Browse files
committed
Merge branch 'release-4.3.3'
2 parents 30179c8 + ea7b162 commit e9ee434

20 files changed

+157
-83
lines changed

.github/workflows/build-docs.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
shell: bash
1919

2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
- name: Setup up Python ${{ matrix.python }}
23-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v5
2424
with:
2525
#
2626
# We use Py3.8 here for historical reasons.
@@ -55,12 +55,12 @@ jobs:
5555
git format-patch @^
5656
git bundle create prebuilt-docs-changes.bundle @^...@
5757
git reset --mixed @^
58-
git diff --exit-code --stat @
58+
git diff --stat @
5959
fi
6060
6161
- name: Upload prebuilt docs changes
6262
if: always()
63-
uses: actions/upload-artifact@v3
63+
uses: actions/upload-artifact@v4
6464
with:
6565
name: prebuilt-docs-changes
6666
path: |

.github/workflows/build-wheels.yml

+45-30
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ jobs:
1515

1616
build_wheels:
1717
needs: linters
18-
name: Build wheels on ${{ matrix.os }}
18+
name: Build ${{ matrix.os }}
1919
runs-on: ${{ matrix.os }}
2020
defaults:
2121
run:
2222
shell: bash
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
os: [ubuntu-20.04, windows-2019, macos-11]
26+
os: [ubuntu-20.04, windows-2019, macos-12]
2727
steps:
2828

2929
- name: Checkout
30-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
3131

3232
- name: Set up QEMU
3333
if: runner.os == 'Linux'
34-
uses: docker/setup-qemu-action@v2
34+
uses: docker/setup-qemu-action@v3
3535
with:
3636
platforms: all
3737

3838
- name: Build wheels
39-
uses: pypa/cibuildwheel@v2.13.1
39+
uses: pypa/cibuildwheel@v2.18.1
4040
env:
4141
CIBW_ARCHS_LINUX: x86_64 aarch64
4242
CIBW_ARCHS_MACOS: x86_64 arm64
@@ -49,49 +49,46 @@ jobs:
4949

5050
- name: Upload wheels as artifacts
5151
if: always()
52-
uses: actions/upload-artifact@v3
52+
uses: actions/upload-artifact@v4
5353
with:
5454
name: wheels-${{ matrix.os }}
5555
path: wheelhouse/*.whl
5656

5757
test:
58-
name: Test wheel for ${{ matrix.os }} Python ${{ matrix.python }}
58+
name: Test ${{ matrix.os }} Py${{ matrix.python }}
5959
needs: build_wheels
6060
strategy:
6161
fail-fast: false
6262
matrix:
6363
include:
64-
- {python: '3.8', os: macos-11}
65-
- {python: '3.9', os: macos-11}
66-
- {python: '3.10', os: macos-11}
67-
- {python: '3.11', os: macos-11}
64+
- {python: '3.8', os: macos-12}
65+
- {python: '3.9', os: macos-12}
66+
- {python: '3.10', os: macos-12}
67+
- {python: '3.11', os: macos-12}
68+
- {python: '3.12', os: macos-12}
6869

6970
- {python: '3.8', os: ubuntu-20.04}
7071
- {python: '3.9', os: ubuntu-20.04}
7172
- {python: '3.10', os: ubuntu-20.04}
7273
- {python: '3.11', os: ubuntu-20.04}
74+
- {python: '3.12', os: ubuntu-20.04}
7375

7476
- {python: '3.8', os: windows-2019}
7577
- {python: '3.9', os: windows-2019}
7678

77-
#
78-
# We know that the Windows Py3.10 wheels are broken. Don't test them,
79-
# because it will fail the entire workflow.
80-
#
81-
# https://github.com/RaRe-Technologies/gensim/issues/3489
82-
#
83-
# - {python: '3.10', os: windows-2019}
79+
- {python: '3.10', os: windows-2019}
8480
- {python: '3.11', os: windows-2019}
81+
- {python: '3.12', os: windows-2019}
8582

8683
runs-on: ${{ matrix.os }}
8784
steps:
8885
- name: Setup up Python ${{ matrix.python }}
89-
uses: actions/setup-python@v4
86+
uses: actions/setup-python@v5
9087
with:
9188
python-version: ${{ matrix.python }}
9289

9390
- name: Downloads build artifacts
94-
uses: actions/download-artifact@v3
91+
uses: actions/download-artifact@v4
9592
with:
9693
path: artifacts/
9794

@@ -101,6 +98,19 @@ jobs:
10198
- name: Install oldest-supported-numpy
10299
run: python -m pip install oldest-supported-numpy
103100

101+
#
102+
# We know that the Windows Py3.10 wheels are broken: they won't work
103+
# with older numpy versions. We still want to test the wheel somehow,
104+
# so we use a newer numpy version.
105+
#
106+
# https://github.com/RaRe-Technologies/gensim/issues/3489
107+
#
108+
- name: Install newest numpy (windows py3.10 only)
109+
if: ${{ (matrix.os == 'windows-2019') && (matrix.python == '3.10') }}
110+
run: |
111+
python -m pip uninstall --yes oldest-supported-numpy
112+
python -m pip install --upgrade numpy
113+
104114
#
105115
# Avoid checking out the entire gensim repo to get just one file
106116
#
@@ -129,29 +139,34 @@ jobs:
129139
needs: build_wheels
130140
runs-on: ubuntu-latest
131141
steps:
132-
133-
- name: Install wheel uploading tool
134-
run: python -m pip install wheelhouse-uploader
142+
- run: python -m pip install awscli boto3
135143

136144
- name: Downloads build artifacts
137-
uses: actions/download-artifact@v3
145+
uses: actions/download-artifact@v4
138146
with:
139147
path: artifacts/
140148

141149
- name: Check files
142150
run: tree artifacts/
143151

144-
- name: Move all wheels into one folder
145-
run: mkdir wheelhouse ; find artifacts/ -name '*.whl' -exec mv -v {} wheelhouse/ \;
152+
#
153+
# Avoid checking out the entire gensim repo to get just one file
154+
#
155+
- name: Download installwheel.py
156+
run: curl "https://raw.githubusercontent.com/RaRe-Technologies/gensim/develop/.github/workflows/update_index.py" --output update_index.py --silent
146157

147158
- name: Upload wheels to s3://gensim-wheels
148159
#
149160
# Only do this if the credentials are set.
150161
# This means that PRs will still build wheels, but not upload them.
151162
# (PRs do not have access to secrets).
152163
#
153-
if: ${{ env.WHEELHOUSE_UPLOADER_USERNAME && env.WHEELHOUSE_UPLOADER_SECRET }}
154-
run: python -m wheelhouse_uploader upload --local-folder wheelhouse/ --no-ssl-check gensim-wheels --provider S3 --no-enable-cdn
164+
if: ${{ env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY }}
165+
run: |
166+
find artifacts/ -name '*.whl' -print -exec aws s3 cp --no-progress {} s3://gensim-wheels/ \;
167+
python update_index.py gensim-wheels "" > index.html
168+
aws s3 cp --no-progress index.html s3://gensim-wheels/index.html
155169
env:
156-
WHEELHOUSE_UPLOADER_USERNAME: ${{ secrets.AWS_ACCESS_KEY_ID }}
157-
WHEELHOUSE_UPLOADER_SECRET: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
170+
AWS_REGION: us-east-1
171+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
172+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

.github/workflows/linters.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111

12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313

1414
- name: Setup up Python ${{ matrix.python }}
15-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
1616
with:
17-
python-version: ${{ matrix.python }}
17+
python-version: 3.11
1818

1919
- name: Update pip
2020
run: python -m pip install -U pip

.github/workflows/tests.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
needs: [linters]
2727

2828
steps:
29-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3030
- name: Setup up Python ${{ matrix.python }}
31-
uses: actions/setup-python@v4
31+
uses: actions/setup-python@v5
3232
with:
3333
#
3434
# We use Py3.8 here for historical reasons.
@@ -67,11 +67,13 @@ jobs:
6767
- {python: '3.9', os: ubuntu-20.04}
6868
- {python: '3.10', os: ubuntu-20.04}
6969
- {python: '3.11', os: ubuntu-20.04}
70+
- {python: '3.12', os: ubuntu-20.04}
7071

7172
- {python: '3.8', os: windows-2019}
7273
- {python: '3.9', os: windows-2019}
7374
- {python: '3.10', os: windows-2019}
7475
- {python: '3.11', os: windows-2019}
76+
- {python: '3.12', os: windows-2019}
7577

7678
#
7779
# Don't run this job unless the linters have succeeded.
@@ -81,9 +83,9 @@ jobs:
8183
needs: [linters]
8284

8385
steps:
84-
- uses: actions/checkout@v3
86+
- uses: actions/checkout@v4
8587
- name: Setup up Python ${{ matrix.python }}
86-
uses: actions/setup-python@v4
88+
uses: actions/setup-python@v5
8789
with:
8890
python-version: ${{ matrix.python }}
8991
- name: Update pip
@@ -159,7 +161,7 @@ jobs:
159161

160162
- name: Upload coverage to Codecov
161163
if: matrix.coverage == true
162-
uses: codecov/codecov-action@v3
164+
uses: codecov/codecov-action@v4
163165
with:
164166
fail_ci_if_error: true
165167
files: ./coverage.xml

.github/workflows/update_index.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""Update index.html for the bucket listing
2+
3+
http://gensim-wheels.s3-website-us-east-1.amazonaws.com/
4+
5+
We do this ourselves as opposed to using wheelhouse_uploader because it's
6+
much faster this way (seconds as compared to nearly an hour).
7+
"""
8+
9+
import sys
10+
import boto3
11+
12+
13+
def main():
14+
bucket = sys.argv[1]
15+
prefix = sys.argv[2]
16+
17+
client = boto3.client('s3')
18+
19+
print("<html><body><ul>")
20+
paginator = client.get_paginator('list_objects_v2')
21+
for page in paginator.paginate(Bucket=bucket, Delimiter='/', Prefix=prefix):
22+
for content in page.get('Contents', []):
23+
key = content['Key']
24+
print(f"<li><a href='{key}'>{key}</a></li>")
25+
print("</ul></body></html>")
26+
27+
28+
if __name__ == '__main__':
29+
main()

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
Changes
22
=======
3+
4+
## 4.3.3, 2024-07-19
5+
6+
### :star2: New Features
7+
8+
### :red_circle: Bug fixes
9+
10+
* Correct file argument name in KeyedVectors.save docstring (__[hammad7](https://github.com/hammad7)__, [#3532](https://github.com/piskvorky/gensim/pull/3532))
11+
* Import deprecated scipy.linalg.triu from numpy.triu instead (__[Luffy610](https://github.com/Luffy610)__, [#3524](https://github.com/piskvorky/gensim/pull/3524))
12+
13+
### :books: Tutorial and doc improvements
14+
15+
* Updated the broken Documentation Link on the README.md (__[wittyicon29](https://github.com/wittyicon29)__, [#3505](https://github.com/piskvorky/gensim/pull/3505))
16+
17+
### :+1: Improvements
18+
19+
* Add support for python3.12 wheels (__[YoungMind1](https://github.com/YoungMind1)__, [#3531](https://github.com/piskvorky/gensim/pull/3531))
20+
* Removed scipy from build-only dependencies (__[filip-komarzyniec](https://github.com/filip-komarzyniec)__, [#3538](https://github.com/piskvorky/gensim/pull/3538))
21+
* Use newer unittest.mock everwhere (__[a-detiste](https://github.com/a-detiste)__, [#3529](https://github.com/piskvorky/gensim/pull/3529))
22+
* Handle optional parameters without implicit bool cast (__[nk-fouque](https://github.com/nk-fouque)__, [#3502](https://github.com/piskvorky/gensim/pull/3502))
23+
324
## 4.3.2, 2023-08-23
425

526
### :red_circle: Bug fixes

README.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,12 @@ on Wikipedia.
4949
Installation
5050
------------
5151

52-
This software depends on [NumPy and Scipy], two Python packages for
53-
scientific computing. You must have them installed prior to installing
54-
gensim.
55-
56-
It is also recommended you install a fast BLAS library before installing
57-
NumPy. This is optional, but using an optimized BLAS such as MKL, [ATLAS] or
58-
[OpenBLAS] is known to improve performance by as much as an order of
52+
This software depends on [NumPy], a Python package for
53+
scientific computing. Please bear in mind that building NumPy from source
54+
(e.g. by installing gensim on a platform which lacks NumPy .whl distribution)
55+
is a non-trivial task involving [linking NumPy to a BLAS library].
56+
It is recommended to provide a fast one (such as MKL, [ATLAS] or
57+
[OpenBLAS]) which can improve performance by as much as an order of
5958
magnitude. On OSX, NumPy picks up its vecLib BLAS automatically,
6059
so you don’t need to do anything special.
6160

@@ -69,7 +68,9 @@ Or, if you have instead downloaded and unzipped the [source tar.gz]
6968
package:
7069

7170
```bash
72-
python setup.py install
71+
tar -xvzf gensim-X.X.X.tar.gz
72+
cd gensim-X.X.X/
73+
pip install .
7374
```
7475

7576
For alternative modes of installation, see the [documentation].
@@ -103,7 +104,7 @@ Documentation
103104
[QuickStart]: https://radimrehurek.com/gensim/auto_examples/core/run_core_concepts.html
104105
[Tutorials]: https://radimrehurek.com/gensim/auto_examples/
105106
[Official Documentation and Walkthrough]: https://radimrehurek.com/gensim/
106-
[Official API Documentation]: https://radimrehurek.com/gensim/apiref.html
107+
[Official API Documentation]: https://radimrehurek.com/gensim/auto_examples/index.html#documentation
107108

108109
Support
109110
-------
@@ -172,8 +173,10 @@ BibTeX entry:
172173
[documentation and Jupyter Notebook tutorials]: https://github.com/RaRe-Technologies/gensim/#documentation
173174
[Vector Space Model]: https://en.wikipedia.org/wiki/Vector_space_model
174175
[unsupervised document analysis]: https://en.wikipedia.org/wiki/Latent_semantic_indexing
175-
[NumPy and Scipy]: https://scipy.org/install/
176+
[NumPy]: https://numpy.org/install/
177+
[linking NumPy to a BLAS library]: https://numpy.org/devdocs/building/blas_lapack.html
176178
[ATLAS]: https://math-atlas.sourceforge.net/
177179
[OpenBLAS]: https://xianyi.github.io/OpenBLAS/
178180
[source tar.gz]: https://pypi.org/project/gensim/
179181
[documentation]: https://radimrehurek.com/gensim/#install
182+

docs/src/auto_examples/core/run_core_concepts.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
},
196196
"outputs": [],
197197
"source": [
198-
"from gensim import similarities\n\nindex = similarities.SparseMatrixSimilarity(tfidf[bow_corpus], num_features=12)"
198+
"from gensim import similarities\n\nindex = similarities.SparseMatrixSimilarity(tfidf[bow_corpus], num_features=max(tfidf.dfs) + 1)"
199199
]
200200
},
201201
{
@@ -274,4 +274,4 @@
274274
},
275275
"nbformat": 4,
276276
"nbformat_minor": 0
277-
}
277+
}

docs/src/check_gallery.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ def different(path1, path2):
6363
stale = '\n'.join(stale)
6464
print(f"""The gallery cache appears stale.
6565
66-
Rebuild the documentation using the following commands from the gensim root subdirectory:
66+
Use Github Actions to rebuild the documentation. See the following links for more info:
67+
68+
https://github.com/RaRe-Technologies/gensim/actions/workflows/build-docs.yml
69+
https://github.com/RaRe-Technologies/gensim/wiki/Rebuilding-documentation
70+
71+
Alternatively, rebuild the documentation locally using the following commands from the gensim root subdirectory:
6772
6873
pip install -e .[docs]
6974
make -C docs/src html

0 commit comments

Comments
 (0)