From 79f982b25be815310bc4410758ac6ee83a095e9e Mon Sep 17 00:00:00 2001 From: Filip <39336739+filip-komarzyniec@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:03:07 +0200 Subject: [PATCH] removed scipy from build-only dependencies (#3538) * removed scipy from build-only dependencies; updated README accordingly * fixed conditions regarding oldest numpy installation on arm64 Windows machines * README rephrased regarding NumPy installation * Revert "fixed conditions regarding oldest numpy installation on arm64 Windows machines" This reverts commit 68197fb9beb65cf3abdb03f71d7c7a4b8ae36473. * pin scipy, need old sparsetools for wheel testing * make scipy pin more strict * use macos-latest instead of deprecated macos-11 * pin scipy in setup.py * remove redundant scipy pin from build-wheels.yml * get rid of remaining macos-11 traces in CI workflow * use macos-12 instead of macos-latest --------- Co-authored-by: Michael Penkov --- .github/workflows/build-wheels.yml | 12 ++++++------ README.md | 20 +++++++++++--------- pyproject.toml | 4 ---- setup.py | 5 ++++- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 856efcbd00..c4c3444499 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2019, macos-11] + os: [ubuntu-20.04, windows-2019, macos-12] steps: - name: Checkout @@ -61,11 +61,11 @@ jobs: 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.12', 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} diff --git a/README.md b/README.md index a69c3a187b..b876aaf8b2 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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]. @@ -172,7 +173,8 @@ 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/ diff --git a/pyproject.toml b/pyproject.toml index 3d807b3574..dba0603d0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,10 +9,6 @@ requires = [ # is 1.18.5, remove the line when they increase oldest supported Numpy for this platform "numpy==1.18.5; python_version=='3.8' and platform_machine not in 'arm64|aarch64'", "oldest-supported-numpy; python_version>'3.8' or platform_machine in 'arm64|aarch64'", - # - # SciPy 1.14.0 onwards removed the deprecated sparsetools submodule needed by gensim.models.lsimodel - # - "scipy<=1.13.1", "setuptools", "wheel", ] diff --git a/setup.py b/setup.py index be7f58330b..335426dcf3 100644 --- a/setup.py +++ b/setup.py @@ -331,7 +331,10 @@ def run(self): install_requires = [ NUMPY_STR, - 'scipy >= 1.7.0', + # + # scipy 1.14.0 and onwards removes deprecated sparsetools submodule + # + 'scipy >= 1.7.0, <1.14.0', 'smart_open >= 1.8.1', ]