From d0859e31c97b7e34856e89af34057d11cb1e7c8d Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sun, 20 Mar 2022 12:08:18 +0900 Subject: [PATCH 01/14] get rid of tox, build things via github actions directly This gets rid of an unnecessary layer of indirection. All the build steps are now defined in the github workflow file. This makes it easier to debug and understand what's going on. --- .github/workflows/build-wheels.yml | 1 + .github/workflows/tests.yml | 55 +++++++---- tox.ini | 154 ----------------------------- 3 files changed, 39 insertions(+), 171 deletions(-) delete mode 100644 tox.ini diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index ff304ea1c7..ba82691e2c 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -9,6 +9,7 @@ on: - cron: '0 0 * * sun,wed' jobs: + if: false build: runs-on: ${{ matrix.os }} defaults: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 530aff2683..dfef220197 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,17 +16,14 @@ jobs: fail-fast: false matrix: include: - - {name: Linux, python: 3.7, os: ubuntu-20.04, tox: 'flake8,flake8-docs'} - - {name: Linux, python: 3.7, os: ubuntu-20.04, tox: 'py37-linux'} - - {name: Linux, python: 3.8, os: ubuntu-20.04, tox: 'py38-linux-cov'} - - {name: Linux, python: 3.9, os: ubuntu-20.04, tox: 'py39-linux'} - - {name: Linux, python: '3.10', os: ubuntu-20.04, tox: 'py310-linux'} - - {name: Windows, python: 3.7, os: windows-2019, tox: 'py37-win'} - - {name: Windows, python: 3.8, os: windows-2019, tox: 'py38-win'} - - {name: Windows, python: 3.9, os: windows-2019, tox: 'py39-win'} - - {name: Windows, python: '3.10', os: windows-2019, tox: 'py310-win'} - env: - TOX_PARALLEL_NO_SPINNER: 1 + # - {name: Linux, python: 3.7, os: ubuntu-20.04} + # - {name: Linux, python: 3.8, os: ubuntu-20.04} + - {name: Linux, python: 3.9, os: ubuntu-20.04} + - {name: Linux, python: '3.10', os: ubuntu-20.04, coverage: true} + # - {name: Windows, python: 3.7, os: windows-2019} + # - {name: Windows, python: 3.8, os: windows-2019} + # - {name: Windows, python: 3.9, os: windows-2019} + - {name: Windows, python: '3.10', os: windows-2019} steps: - uses: actions/checkout@v2 @@ -37,6 +34,13 @@ jobs: - name: Update pip run: python -m pip install -U pip + # Pinned to 3.7.9 because >3.8.0 triggers "AttributeError: 'Namespace' object has no attribute 'output_file'" + # in flake8-rst. Apparently some bug in flake8-rst: + # https://gitlab.com/pycqa/flake8/-/issues/641 + # https://github.com/kataev/flake8-rst/pull/23/files + - name: Install dependencies + run: python -m pip install flake8==3.7.9 flake-rst==0.7.2 + # # Work-around mysterious build problem # https://github.com/RaRe-Technologies/gensim/pull/3078/checks?check_run_id=2117914443 @@ -50,25 +54,42 @@ jobs: curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add sudo apt-get update -y sudo apt-get install -y sbt - - name: Install tox - run: pip install tox + - name: Install GDB & enable core dumps if: matrix.os == 'ubuntu-20.04' run: | sudo apt-get update -y sudo apt-get install -y gdb ulimit -c unlimited -S # enable core dumps - - name: Run tox tests - run: tox -e ${{ matrix.tox }} + + - 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: Build + run: | + python --version + pip --version + python setup.py build_ext --inplace + + - name: Run tests (without coverage) + if: matrix.coverage != true + run: pytest gensim/test + + - name: Run tests (with coverage) + if: matrix.coverage == true + run: pytest gensim/test --cov=gensim/ --cov-report=xml + - name: Upload coverage to Codecov - if: matrix.os == 'ubuntu-20.04' && matrix.python == '3.8' + if: matrix.coverage == true uses: codecov/codecov-action@v2 with: fail_ci_if_error: true files: ./coverage.xml verbose: true - - name: Collect corefile if: ${{ failure() }} && matrix.os == 'ubuntu-20.04' run: | diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 566e331997..0000000000 --- a/tox.ini +++ /dev/null @@ -1,154 +0,0 @@ -[tox] -minversion = 2.0 -envlist = {py37,py38,py39,py310}-{win,linux}, py38-linux-cov, flake8, docs, docs-upload, download-wheels, upload-wheels, test-pypi -skipsdist = True -platform = linux: linux - win: win64 - - -[flake8] -ignore = E12, W503 -max-line-length = 120 -show-source = True - - -[flake8-rst] -filename = *.rst *.py -max-line-length = 120 -ignore = E203, # space before : - E402, # module level import not at top of file - # Classes / functions in a docstring block generate those errors - E302, # expected 2 blank lines, found 0 - E305, # expected 2 blank lines after class or function definition, found 0 - F821, # undefined name; remove once all docstrings are fully executable -exclude = .venv, .git, .tox, dist, doc, build, gensim/models/deprecated - - -[coverage:run] -source=gensim - -[coverage:report] -omit = - gensim/test/* - */__init__.py - -exclude_lines = - pragma: no cover - def __repr__ - def __str__ - raise AssertionError - raise NotImplementedError - if __name__ == .__main__.: - -ignore_errors = True - -# -# Conditional factors https://tox.wiki/en/latest/config.html#factors -# -[pytest] -addopts = -rfxEXs --durations=20 --showlocals - -[testenv] -recreate = True - -install_command = python -m pip install --timeout=60 {env:TOX_PIP_OPTS:} {opts} {packages} - -deps = - pip>=19.1.1 - linux: .[test] - win: .[test-win] - -setenv = - FT_HOME={env:FT_HOME:} - WR_HOME={env:WR_HOME:} - VOWPAL_WABBIT_PATH={env:VOWPAL_WABBIT_PATH:} - DTM_PATH={env:DTM_PATH:} - MALLET_HOME={env:MALLET_HOME:} - SKIP_NETWORK_TESTS={env:SKIP_NETWORK_TESTS:} - BOTO_CONFIG={env:BOTO_CONFIG:} - RUNNER_OS={env:RUNNER_OS:} - PYTHONHASHSEED=1 - TOX_PARALLEL_NO_SPINNER=1 - -commands = - python --version - pip --version - python setup.py build_ext --inplace - cov: pytest {posargs:gensim/test} --cov=gensim/ --cov-report=xml - !cov: pytest {posargs:gensim/test} - - -[testenv:flake8] -recreate = True -deps = - # Pinned to 3.7.9 because >3.8.0 triggers "AttributeError: 'Namespace' object has no attribute 'output_file'" - # in flake8-rst. Apparently some bug in flake8-rst: - # https://gitlab.com/pycqa/flake8/-/issues/641 - # https://github.com/kataev/flake8-rst/pull/23/files - flake8==3.7.9 - -commands = flake8 gensim/ {posargs} - - -[testenv:flake8-docs] -recreate = True -deps = - flake8-rst==0.7.2 - flake8==3.7.9 - -commands = flake8-rst gensim/ docs/ {posargs} - - -[testenv:compile] -basepython = python3 -recreate = True - -deps = numpy -commands = python setup.py build_ext --inplace - - -[testenv:docs] -basepython = python3 -recreate = True -whitelist_externals = make -deps = .[docs] - -commands = - python setup.py build_ext --inplace - make -C docs/src clean html - - -[testenv:docs-upload] -recreate = True -whitelist_externals = make -deps = .[docs] -changedir = docs/src - -commands = make clean html upload - - -[testenv:download-wheels] -deps = wheelhouse_uploader -whitelist_externals = rm -recreate = True - -commands = - rm -rf dist/ - python setup.py sdist fetch_artifacts - - -[testenv:upload-wheels] -deps = twine - -commands = twine upload dist/* - - -[testenv:test-pypi] -deps = twine -whitelist_externals = rm - -commands = - rm -rf dist/ - python setup.py sdist - twine upload --repository-url https://test.pypi.org/legacy/ dist/* - ; Go to https://testpypi.python.org/pypi?name=gensim&:action=display and check result From cd047e9bde7e9e20b76b2343f9c6fca8ccc2306c Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sun, 20 Mar 2022 12:34:31 +0900 Subject: [PATCH 02/14] unpin flake8 and flake8-rst --- .github/workflows/tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dfef220197..6aaaab9584 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,12 +34,8 @@ jobs: - name: Update pip run: python -m pip install -U pip - # Pinned to 3.7.9 because >3.8.0 triggers "AttributeError: 'Namespace' object has no attribute 'output_file'" - # in flake8-rst. Apparently some bug in flake8-rst: - # https://gitlab.com/pycqa/flake8/-/issues/641 - # https://github.com/kataev/flake8-rst/pull/23/files - name: Install dependencies - run: python -m pip install flake8==3.7.9 flake-rst==0.7.2 + run: python -m pip install flake8 flake-rst # # Work-around mysterious build problem From 006c2f5ddc2484faa3815718adb341489ee54fdd Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sun, 20 Mar 2022 12:49:14 +0900 Subject: [PATCH 03/14] fixup --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6aaaab9584..4612a671fb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,7 +35,7 @@ jobs: run: python -m pip install -U pip - name: Install dependencies - run: python -m pip install flake8 flake-rst + run: python -m pip install flake8 flake8-rst # # Work-around mysterious build problem From eba6fa4b47c04826947f82053b5b05ea3991a9df Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sun, 20 Mar 2022 12:54:29 +0900 Subject: [PATCH 04/14] move linters to a separate job --- .github/workflows/tests.yml | 38 ++++++++++++++++++++------ gensim/test/test_translation_matrix.py | 1 - 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4612a671fb..903d56aca9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,28 @@ on: branches: [ develop ] jobs: + 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 + tests: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} @@ -25,6 +47,13 @@ jobs: # - {name: Windows, python: 3.9, os: windows-2019} - {name: Windows, python: '3.10', os: windows-2019} + # + # Don't run this job unless the linters have succeeded. + # It's wasteful to test code that failed to lint, because it'll get + # re-tested once the lint errors are fixed. + # + needs: [linters] + steps: - uses: actions/checkout@v2 - name: Setup up Python ${{ matrix.python }} @@ -34,9 +63,6 @@ jobs: - name: Update pip run: python -m pip install -U pip - - name: Install dependencies - run: python -m pip install flake8 flake8-rst - # # Work-around mysterious build problem # https://github.com/RaRe-Technologies/gensim/pull/3078/checks?check_run_id=2117914443 @@ -58,12 +84,6 @@ jobs: sudo apt-get install -y gdb ulimit -c unlimited -S # enable core dumps - - 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: Build run: | python --version diff --git a/gensim/test/test_translation_matrix.py b/gensim/test/test_translation_matrix.py index 0cb4682013..44ed22855e 100644 --- a/gensim/test/test_translation_matrix.py +++ b/gensim/test/test_translation_matrix.py @@ -1,6 +1,5 @@ #!/usr/bin/env python # encoding: utf-8 -import sys from collections import namedtuple import unittest import logging From 8c49cefd222d1b30bb8c23ff72dcbd0321963b62 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sun, 20 Mar 2022 12:56:11 +0900 Subject: [PATCH 05/14] why does the documentation fail to lint??? --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 903d56aca9..62047118b5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,8 +25,8 @@ jobs: - 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: Run flake8 linter (documentation) + # run: flake8 --ignore E202,E402,E302,E305,F821 --max-line-length 120 --filename '*.py,*.rst' docs tests: name: ${{ matrix.name }} From c731448eb1ebd3f2bb970b4dca06229a89444d89 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Sun, 20 Mar 2022 13:06:26 +0900 Subject: [PATCH 06/14] install pytest --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 62047118b5..136b1448b2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -61,7 +61,7 @@ jobs: with: python-version: ${{ matrix.python }} - name: Update pip - run: python -m pip install -U pip + run: python -m pip install -U pip pytest # # Work-around mysterious build problem From 764088af74ca4474b6ec25415429832add7b3bae Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Mon, 21 Mar 2022 14:08:53 +0900 Subject: [PATCH 07/14] add requirements.txt for github workflow --- .github/workflows/requirements.txt | 34 ++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 5 ++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/requirements.txt diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt new file mode 100644 index 0000000000..91b6deeedf --- /dev/null +++ b/.github/workflows/requirements.txt @@ -0,0 +1,34 @@ +attrs==21.4.0 +certifi==2021.10.8 +charset-normalizer==2.0.12 +coverage==6.3.2 +Cython==0.29.28 +idna==3.3 +iniconfig==1.1.1 +jsonpatch==1.32 +jsonpointer==2.2 +mock==4.0.3 +nmslib==2.1.1 +numpy==1.22.3 +packaging==21.3 +Pillow==9.0.1 +pluggy==1.0.0 +psutil==5.9.0 +py==1.11.0 +pybind11==2.6.1 +pyemd==0.5.1 +pyparsing==3.0.7 +pytest==7.1.1 +pytest-cov==3.0.0 +pyzmq==22.3.0 +requests==2.27.1 +scipy==1.8.0 +six==1.16.0 +smart-open==5.2.1 +testfixtures==6.18.5 +tomli==2.0.1 +torchfile==0.1.0 +tornado==6.1 +urllib3==1.26.9 +visdom==0.1.8.9 +websocket-client==1.3.1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 136b1448b2..a58181307f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -61,7 +61,10 @@ jobs: with: python-version: ${{ matrix.python }} - name: Update pip - run: python -m pip install -U pip pytest + run: python -m pip install -U pip + + - name: Install requirements + run: python -m pip install -r .github/workflows/requirements.txt # # Work-around mysterious build problem From 28b9596c88f95e361f9b0e251429cbffdbcbac93 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Mon, 21 Mar 2022 14:18:29 +0900 Subject: [PATCH 08/14] use setup.py to install dependencies instead --- .github/workflows/requirements.txt | 34 ------------------------------ .github/workflows/tests.yml | 11 +++++++--- 2 files changed, 8 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/requirements.txt diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt deleted file mode 100644 index 91b6deeedf..0000000000 --- a/.github/workflows/requirements.txt +++ /dev/null @@ -1,34 +0,0 @@ -attrs==21.4.0 -certifi==2021.10.8 -charset-normalizer==2.0.12 -coverage==6.3.2 -Cython==0.29.28 -idna==3.3 -iniconfig==1.1.1 -jsonpatch==1.32 -jsonpointer==2.2 -mock==4.0.3 -nmslib==2.1.1 -numpy==1.22.3 -packaging==21.3 -Pillow==9.0.1 -pluggy==1.0.0 -psutil==5.9.0 -py==1.11.0 -pybind11==2.6.1 -pyemd==0.5.1 -pyparsing==3.0.7 -pytest==7.1.1 -pytest-cov==3.0.0 -pyzmq==22.3.0 -requests==2.27.1 -scipy==1.8.0 -six==1.16.0 -smart-open==5.2.1 -testfixtures==6.18.5 -tomli==2.0.1 -torchfile==0.1.0 -tornado==6.1 -urllib3==1.26.9 -visdom==0.1.8.9 -websocket-client==1.3.1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a58181307f..77c166b9be 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,9 +63,6 @@ jobs: - name: Update pip run: python -m pip install -U pip - - name: Install requirements - run: python -m pip install -r .github/workflows/requirements.txt - # # Work-around mysterious build problem # https://github.com/RaRe-Technologies/gensim/pull/3078/checks?check_run_id=2117914443 @@ -87,6 +84,14 @@ jobs: sudo apt-get install -y gdb ulimit -c unlimited -S # enable core dumps + - name: Install gensim and its dependencies + if: matrix.os != 'windows' + run: pip install -e .[test] + + - name: Install gensim and its dependencies (Windows) + if: matrix.os == 'windows' + run: pip install -e .[test-win] + - name: Build run: | python --version From 5969dabf8774325c0d21af47d41607c88f202cb3 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Mon, 21 Mar 2022 14:22:47 +0900 Subject: [PATCH 09/14] simplify coverage step --- .github/workflows/tests.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 77c166b9be..bee90597e4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -98,12 +98,7 @@ jobs: pip --version python setup.py build_ext --inplace - - name: Run tests (without coverage) - if: matrix.coverage != true - run: pytest gensim/test - - - name: Run tests (with coverage) - if: matrix.coverage == true + - name: Run tests run: pytest gensim/test --cov=gensim/ --cov-report=xml - name: Upload coverage to Codecov From c55d63f1b910c10e14be0e631709d4afef0bffc1 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Mon, 21 Mar 2022 14:50:47 +0900 Subject: [PATCH 10/14] re-enable previously disabled jobs --- .github/workflows/build-wheels.yml | 1 - .github/workflows/tests.yml | 19 ++++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index ba82691e2c..ff304ea1c7 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -9,7 +9,6 @@ on: - cron: '0 0 * * sun,wed' jobs: - if: false build: runs-on: ${{ matrix.os }} defaults: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bee90597e4..3e13f2d21a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,7 @@ jobs: # run: flake8 --ignore E202,E402,E302,E305,F821 --max-line-length 120 --filename '*.py,*.rst' docs tests: - name: ${{ matrix.name }} + name: test ${{ matrix.name }} python ${{ matrix.python }} runs-on: ${{ matrix.os }} defaults: run: @@ -38,14 +38,15 @@ jobs: fail-fast: false matrix: include: - # - {name: Linux, python: 3.7, os: ubuntu-20.04} - # - {name: Linux, python: 3.8, os: ubuntu-20.04} - - {name: Linux, python: 3.9, os: ubuntu-20.04} - - {name: Linux, python: '3.10', os: ubuntu-20.04, coverage: true} - # - {name: Windows, python: 3.7, os: windows-2019} - # - {name: Windows, python: 3.8, os: windows-2019} - # - {name: Windows, python: 3.9, os: windows-2019} - - {name: Windows, python: '3.10', os: windows-2019} + - {python: 3.7, os: ubuntu-20.04} + - {python: 3.8, os: ubuntu-20.04} + - {python: 3.9, os: ubuntu-20.04} + - {python: '3.10', os: ubuntu-20.04, coverage: true} + + - {python: 3.7, os: windows-2019} + - {python: 3.8, os: windows-2019} + - {python: 3.9, os: windows-2019} + - {python: '3.10', os: windows-2019} # # Don't run this job unless the linters have succeeded. From ee76122a65d97daa6c66a6a2479dcc39bb433a7d Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Mon, 21 Mar 2022 14:55:09 +0900 Subject: [PATCH 11/14] fix job name in workflow --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e13f2d21a..a1de682ffd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,7 @@ jobs: # run: flake8 --ignore E202,E402,E302,E305,F821 --max-line-length 120 --filename '*.py,*.rst' docs tests: - name: test ${{ matrix.name }} python ${{ matrix.python }} + name: test ${{ matrix.os }} python ${{ matrix.python }} runs-on: ${{ matrix.os }} defaults: run: From 14f43479ff33cad8577e6f89eef35acfbffeeba5 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Mon, 21 Mar 2022 22:22:15 +0900 Subject: [PATCH 12/14] update tests.yml --- .github/workflows/tests.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a1de682ffd..3d88eccf7c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,6 +30,7 @@ jobs: tests: name: test ${{ matrix.os }} python ${{ matrix.python }} + timeout-minutes: 30 runs-on: ${{ matrix.os }} defaults: run: @@ -99,8 +100,17 @@ jobs: pip --version python setup.py build_ext --inplace - - name: Run tests - run: pytest gensim/test --cov=gensim/ --cov-report=xml + # + # Some of our tests are hanging. + # Limit the use of the coverage plugin for pytest to rule it out as a factor. + # + - name: Run tests (without coverage) + if: matrix.coverage != true + run: pytest -v gensim/test + + - name: Run tests (with coverage) + if: matrix.coverage == true + run: pytest -v gensim/test --cov=gensim/ --cov-report=xml - name: Upload coverage to Codecov if: matrix.coverage == true From 29ecd6403d35e99ac09ef4aabd39c8e7cdb8636c Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Mon, 21 Mar 2022 22:22:41 +0900 Subject: [PATCH 13/14] add timeout-minutes to build-wheels.yml --- .github/workflows/build-wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index ff304ea1c7..42f61bb8b2 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -10,6 +10,7 @@ on: jobs: build: + timeout-minutes: 30 runs-on: ${{ matrix.os }} defaults: run: From 6047dff555e5345462df248bb075b7ab671a2a22 Mon Sep 17 00:00:00 2001 From: Michael Penkov Date: Tue, 22 Mar 2022 00:02:14 +0900 Subject: [PATCH 14/14] build docs using github actions instead of circleci --- .circleci/config.yml | 48 ------------------------------------- .github/workflows/tests.yml | 48 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 48 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 1071aa5aeb..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,48 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: cimg/python:3.8.11 - - working_directory: ~/gensim - - steps: - - checkout - - - restore_cache: - key: pip-cache - - - run: - name: Apt install (for latex render) - command: | - sudo apt-get -yq update - sudo apt-get -yq remove texlive-binaries --purge - 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 - sudo apt-get -yq install build-essential python3.8-dev - - - run: - name: Basic installation (tox) - command: | - python3.8 -m virtualenv venv - source venv/bin/activate - pip install tox --progress-bar off - - - run: - name: Build documentation - environment: - TOX_PARALLEL_NO_SPINNER: 1 - TOX_PIP_OPTS: --progress-bar=off - command: | - source venv/bin/activate - tox -e compile,docs -vv - - - store_artifacts: - path: docs/src/_build - destination: documentation - - - save_cache: - key: pip-cache - paths: - - "~/.cache/pip" - - "~/.ccache" - - "~/.pip-cache" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3d88eccf7c..f09b21d61d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,6 +28,54 @@ jobs: # - name: Run flake8 linter (documentation) # run: flake8 --ignore E202,E402,E302,E305,F821 --max-line-length 120 --filename '*.py,*.rst' docs + docs: + name: build documentation + timeout-minutes: 10 + runs-on: ubuntu-20.04 + defaults: + run: + shell: bash + + # + # Don't run this job unless the linters have succeeded. + # It's wasteful to test code that failed to lint, because it'll get + # re-tested once the lint errors are fixed. + # + needs: [linters] + + steps: + - uses: actions/checkout@v2 + - name: Setup up Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + # + # We use Py3.8 here for historical reasons. + # + python-version: "3.8" + + - name: Update pip + run: python -m pip install -U pip + + - name: Install apt packages for LaTeX rendering + run: | + sudo apt-get -yq update + sudo apt-get -yq remove texlive-binaries --purge + 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 + sudo apt-get -yq install build-essential python3.8-dev + + - name: Install gensim and its dependencies + run: pip install -e .[docs] + + - name: Build documentation + run: | + python setup.py build_ext --inplace + make -C docs/src clean html + + # + # FIXME: do we want to store the built documentation somewhere, or is + # knowing that the docs built successfully enough? + # + tests: name: test ${{ matrix.os }} python ${{ matrix.python }} timeout-minutes: 30