Skip to content

Commit

Permalink
Merge branch 'release-4.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenkov committed Jul 19, 2024
2 parents 30179c8 + ea7b162 commit e9ee434
Show file tree
Hide file tree
Showing 20 changed files with 157 additions and 83 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
#
# We use Py3.8 here for historical reasons.
Expand Down Expand Up @@ -55,12 +55,12 @@ jobs:
git format-patch @^
git bundle create prebuilt-docs-changes.bundle @^...@
git reset --mixed @^
git diff --exit-code --stat @
git diff --stat @
fi
- name: Upload prebuilt docs changes
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: prebuilt-docs-changes
path: |
Expand Down
75 changes: 45 additions & 30 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ jobs:

build_wheels:
needs: linters
name: Build wheels on ${{ matrix.os }}
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
os: [ubuntu-20.04, windows-2019, macos-12]
steps:

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.13.1
uses: pypa/cibuildwheel@v2.18.1
env:
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_MACOS: x86_64 arm64
Expand All @@ -49,49 +49,46 @@ jobs:

- name: Upload wheels as artifacts
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: wheelhouse/*.whl

test:
name: Test wheel for ${{ matrix.os }} Python ${{ matrix.python }}
name: Test ${{ matrix.os }} Py${{ matrix.python }}
needs: build_wheels
strategy:
fail-fast: false
matrix:
include:
- {python: '3.8', os: macos-11}
- {python: '3.9', os: macos-11}
- {python: '3.10', os: macos-11}
- {python: '3.11', os: macos-11}
- {python: '3.8', os: macos-12}
- {python: '3.9', os: macos-12}
- {python: '3.10', os: macos-12}
- {python: '3.11', os: macos-12}
- {python: '3.12', os: macos-12}

- {python: '3.8', os: ubuntu-20.04}
- {python: '3.9', os: ubuntu-20.04}
- {python: '3.10', os: ubuntu-20.04}
- {python: '3.11', os: ubuntu-20.04}
- {python: '3.12', os: ubuntu-20.04}

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

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

runs-on: ${{ matrix.os }}
steps:
- name: Setup up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Downloads build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts/

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

#
# We know that the Windows Py3.10 wheels are broken: they won't work
# with older numpy versions. We still want to test the wheel somehow,
# so we use a newer numpy version.
#
# https://github.com/RaRe-Technologies/gensim/issues/3489
#
- name: Install newest numpy (windows py3.10 only)
if: ${{ (matrix.os == 'windows-2019') && (matrix.python == '3.10') }}
run: |
python -m pip uninstall --yes oldest-supported-numpy
python -m pip install --upgrade numpy
#
# Avoid checking out the entire gensim repo to get just one file
#
Expand Down Expand Up @@ -129,29 +139,34 @@ jobs:
needs: build_wheels
runs-on: ubuntu-latest
steps:

- name: Install wheel uploading tool
run: python -m pip install wheelhouse-uploader
- run: python -m pip install awscli boto3

- name: Downloads build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts/

- name: Check files
run: tree artifacts/

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

- name: Upload wheels to s3://gensim-wheels
#
# Only do this if the credentials are set.
# This means that PRs will still build wheels, but not upload them.
# (PRs do not have access to secrets).
#
if: ${{ env.WHEELHOUSE_UPLOADER_USERNAME && env.WHEELHOUSE_UPLOADER_SECRET }}
run: python -m wheelhouse_uploader upload --local-folder wheelhouse/ --no-ssl-check gensim-wheels --provider S3 --no-enable-cdn
if: ${{ env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY }}
run: |
find artifacts/ -name '*.whl' -print -exec aws s3 cp --no-progress {} s3://gensim-wheels/ \;
python update_index.py gensim-wheels "" > index.html
aws s3 cp --no-progress index.html s3://gensim-wheels/index.html
env:
WHEELHOUSE_UPLOADER_USERNAME: ${{ secrets.AWS_ACCESS_KEY_ID }}
WHEELHOUSE_UPLOADER_SECRET: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6 changes: 3 additions & 3 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
python-version: 3.11

- name: Update pip
run: python -m pip install -U pip
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
needs: [linters]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
#
# We use Py3.8 here for historical reasons.
Expand Down Expand Up @@ -67,11 +67,13 @@ jobs:
- {python: '3.9', os: ubuntu-20.04}
- {python: '3.10', os: ubuntu-20.04}
- {python: '3.11', os: ubuntu-20.04}
- {python: '3.12', os: ubuntu-20.04}

- {python: '3.8', os: windows-2019}
- {python: '3.9', os: windows-2019}
- {python: '3.10', os: windows-2019}
- {python: '3.11', os: windows-2019}
- {python: '3.12', os: windows-2019}

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

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Update pip
Expand Down Expand Up @@ -159,7 +161,7 @@ jobs:

- name: Upload coverage to Codecov
if: matrix.coverage == true
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./coverage.xml
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/update_index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Update index.html for the bucket listing
http://gensim-wheels.s3-website-us-east-1.amazonaws.com/
We do this ourselves as opposed to using wheelhouse_uploader because it's
much faster this way (seconds as compared to nearly an hour).
"""

import sys
import boto3


def main():
bucket = sys.argv[1]
prefix = sys.argv[2]

client = boto3.client('s3')

print("<html><body><ul>")
paginator = client.get_paginator('list_objects_v2')
for page in paginator.paginate(Bucket=bucket, Delimiter='/', Prefix=prefix):
for content in page.get('Contents', []):
key = content['Key']
print(f"<li><a href='{key}'>{key}</a></li>")
print("</ul></body></html>")


if __name__ == '__main__':
main()
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
Changes
=======

## 4.3.3, 2024-07-19

### :star2: New Features

### :red_circle: Bug fixes

* Correct file argument name in KeyedVectors.save docstring (__[hammad7](https://github.com/hammad7)__, [#3532](https://github.com/piskvorky/gensim/pull/3532))
* Import deprecated scipy.linalg.triu from numpy.triu instead (__[Luffy610](https://github.com/Luffy610)__, [#3524](https://github.com/piskvorky/gensim/pull/3524))

### :books: Tutorial and doc improvements

* Updated the broken Documentation Link on the README.md (__[wittyicon29](https://github.com/wittyicon29)__, [#3505](https://github.com/piskvorky/gensim/pull/3505))

### :+1: Improvements

* Add support for python3.12 wheels (__[YoungMind1](https://github.com/YoungMind1)__, [#3531](https://github.com/piskvorky/gensim/pull/3531))
* Removed scipy from build-only dependencies (__[filip-komarzyniec](https://github.com/filip-komarzyniec)__, [#3538](https://github.com/piskvorky/gensim/pull/3538))
* Use newer unittest.mock everwhere (__[a-detiste](https://github.com/a-detiste)__, [#3529](https://github.com/piskvorky/gensim/pull/3529))
* Handle optional parameters without implicit bool cast (__[nk-fouque](https://github.com/nk-fouque)__, [#3502](https://github.com/piskvorky/gensim/pull/3502))

## 4.3.2, 2023-08-23

### :red_circle: Bug fixes
Expand Down
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ on Wikipedia.
Installation
------------

This software depends on [NumPy and Scipy], two Python packages for
scientific computing. You must have them installed prior to installing
gensim.

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

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

```bash
python setup.py install
tar -xvzf gensim-X.X.X.tar.gz
cd gensim-X.X.X/
pip install .
```

For alternative modes of installation, see the [documentation].
Expand Down Expand Up @@ -103,7 +104,7 @@ Documentation
[QuickStart]: https://radimrehurek.com/gensim/auto_examples/core/run_core_concepts.html
[Tutorials]: https://radimrehurek.com/gensim/auto_examples/
[Official Documentation and Walkthrough]: https://radimrehurek.com/gensim/
[Official API Documentation]: https://radimrehurek.com/gensim/apiref.html
[Official API Documentation]: https://radimrehurek.com/gensim/auto_examples/index.html#documentation

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

4 changes: 2 additions & 2 deletions docs/src/auto_examples/core/run_core_concepts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
},
"outputs": [],
"source": [
"from gensim import similarities\n\nindex = similarities.SparseMatrixSimilarity(tfidf[bow_corpus], num_features=12)"
"from gensim import similarities\n\nindex = similarities.SparseMatrixSimilarity(tfidf[bow_corpus], num_features=max(tfidf.dfs) + 1)"
]
},
{
Expand Down Expand Up @@ -274,4 +274,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
7 changes: 6 additions & 1 deletion docs/src/check_gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ def different(path1, path2):
stale = '\n'.join(stale)
print(f"""The gallery cache appears stale.
Rebuild the documentation using the following commands from the gensim root subdirectory:
Use Github Actions to rebuild the documentation. See the following links for more info:
https://github.com/RaRe-Technologies/gensim/actions/workflows/build-docs.yml
https://github.com/RaRe-Technologies/gensim/wiki/Rebuilding-documentation
Alternatively, rebuild the documentation locally using the following commands from the gensim root subdirectory:
pip install -e .[docs]
make -C docs/src html
Expand Down
Loading

0 comments on commit e9ee434

Please sign in to comment.