Skip to content

Commit

Permalink
removed scipy from build-only dependencies (#3538)
Browse files Browse the repository at this point in the history
* 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 68197fb.

* 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 <[email protected]>
  • Loading branch information
filip-komarzyniec and mpenkov authored Jul 18, 2024
1 parent afbb82e commit 79f982b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
20 changes: 11 additions & 9 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 @@ -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/
Expand Down
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]

Expand Down

0 comments on commit 79f982b

Please sign in to comment.