Skip to content

Commit

Permalink
Merge branch 'release-4.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
piskvorky committed May 1, 2022
2 parents b76108e + 239792e commit acbba2f
Show file tree
Hide file tree
Showing 80 changed files with 2,017 additions and 1,242 deletions.
48 changes: 0 additions & 48 deletions .circleci/config.yml

This file was deleted.

116 changes: 95 additions & 21 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,46 @@ on:
- cron: '0 0 * * sun,wed'

jobs:
#
# The linters job duplicates tests.yml, can't think of a way to avoid this right now.
#
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

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

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

- name: Install dependencies
run: python -m pip install flake8 flake8-rst

- name: Run flake8 linter (source)
run: flake8 --ignore E12,W503 --max-line-length 120 --show-source gensim

# - name: Run flake8 linter (documentation)
# run: flake8 --ignore E202,E402,E302,E305,F821 --max-line-length 120 --filename '*.py,*.rst' docs

- name: Check Sphinx Gallery cache
run: python docs/src/check_gallery.py
build:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash

needs: [linters]

strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [ubuntu-latest, macos-latest, windows-latest]
platform: [x64]
include:
Expand All @@ -43,11 +74,6 @@ jobs:
# https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg
# with the exception that we enforce the minimum version to be 1.17.0.
#
- os: ubuntu-latest
manylinux-version: 2010
python-version: 3.6
build-depends: numpy==1.17.0

- os: ubuntu-latest
manylinux-version: 2010
python-version: 3.7
Expand All @@ -63,11 +89,10 @@ jobs:
python-version: 3.9
build-depends: numpy==1.19.3

- os: macos-latest
travis-os-name: osx
manylinux-version: 1
python-version: 3.6
build-depends: numpy==1.17.0
- os: ubuntu-latest
manylinux-version: 2014
python-version: "3.10"
build-depends: numpy==1.22.2 scipy==1.8.0

- os: macos-latest
travis-os-name: osx
Expand All @@ -87,10 +112,11 @@ jobs:
python-version: 3.9
build-depends: numpy==1.19.3

- os: windows-latest
manylinux-version: 2010
python-version: 3.6
build-depends: numpy==1.17.0
- os: macos-latest
travis-os-name: osx
manylinux-version: 1
python-version: "3.10"
build-depends: numpy==1.22.2 scipy==1.8.0

- os: windows-latest
manylinux-version: 2010
Expand All @@ -107,14 +133,19 @@ jobs:
python-version: 3.9
build-depends: numpy==1.19.3

- os: windows-latest
manylinux-version: 2010
python-version: "3.10"
build-depends: numpy==1.22.2 scipy==1.8.0

env:
PKG_NAME: gensim
REPO_DIR: gensim
BUILD_COMMIT: HEAD
PLAT: x86_64
UNICODE_WIDTH: 32
MB_PYTHON_VERSION: ${{ matrix.python-version }} # MB_PYTHON_VERSION is needed by Multibuild
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
TEST_DEPENDS: pytest mock testfixtures
DOCKER_TEST_IMAGE: multibuild/xenial_x86_64
TRAVIS_OS_NAME: ${{ matrix.travis-os-name }}
SKIP_NETWORK_TESTS: 1
Expand Down Expand Up @@ -144,7 +175,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install virtualenv
- name: Build and Install Wheels (Multibuild)
- name: Build Wheel (Multibuild)
if: matrix.os != 'windows-latest'
run: |
echo ::group::Set up Multibuild
Expand All @@ -156,17 +187,16 @@ jobs:
before_install
echo ::endgroup::
echo ::group::Build wheel
find . -type f -name "*.egg" -exec rm -v {} \;
build_wheel $REPO_DIR ${{ matrix.PLAT }}
echo ::endgroup::
echo ::group::Install run
install_run ${{ matrix.PLAT }}
echo ::endgroup::
#
# We can't use multibuild on Windows, so we have to roll our own build script.
# Adapted from
# https://github.com/RaRe-Technologies/gensim-wheels/commit/084b863390edee05bbe15d4ec05d1ab726e52202
#
- name: Build and Install Wheels (Windows)
- name: Build Wheel (Windows)
if: matrix.os == 'windows-latest'
run: |
echo ::group::Set up dependencies
Expand All @@ -190,6 +220,50 @@ jobs:
#
mv dist wheelhouse
- name: Prepare for testing
run: |
#
# FIXME: Why are these eggs here?
#
# These eggs prevent the wheel from building and running on Py3.10
#
find . -type f -name "*.egg" -exec rm -v {} \;
python -m venv test_environment
#
# Multibuild has a test step but it essentially just installs the wheel
# and runs the test, and requires a lot of magic to get it working.
# It also does not work under Windows.
# So, we create our own simple test step here.
#
- name: Install and Test Wheel (Linux, MacOS)
if: matrix.os != 'windows-latest'
run: |
. test_environment/bin/activate
pip install pytest testfixtures mock
pip install wheelhouse/*.whl
cd test_environment
python -c 'import gensim;print(gensim.__version__)'
#
# This part relies on the wheel containing tests and required data.
# If we remove that from the wheel, we'll need to rewrite this step.
#
pytest -rfxEXs --durations=20 --disable-warnings --showlocals --pyargs gensim
#
# We need a separate testing step for windows because the command for
# activating the virtual environment is slightly different
#
- name: Install and Test Wheel (Windows)
if: matrix.os == 'windows-latest'
run: |
test_environment/Scripts/activate.bat
pip install pytest testfixtures mock
pip install wheelhouse/*.whl
cd test_environment
python -c 'import gensim;print(gensim.__version__)'
pytest -rfxEXs --durations=20 --disable-warnings --showlocals --pyargs gensim
- name: Upload wheels to s3://gensim-wheels
#
# Only do this if the credentials are set.
Expand Down
Loading

0 comments on commit acbba2f

Please sign in to comment.