spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

numpy requirements/compatibility

Open adrianeboyd opened this issue 1 year ago • 2 comments

I noticed that conda-forge is struggling with some of the current numpy specifications to the point that they're having to patch the requirements (https://github.com/conda-forge/thinc-feedstock/pull/123).

To improve this and restore numpy v1 compatibility, could you consider using numpy's suggested build+install requirements as described here? https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-0-specific-advice

For python 3.9+ only, I think this could look like:

[build-system]
requires = [
    "numpy>=2.0.0",  # or additionally with <3.0 if you want
]
build-backend = "setuptools.build_meta"
install_requires =
    numpy>=1.19.3

And if you wanted to support earlier python, you could use oldest-supported-numpy for simplicity (which is less concerning now that it's effectively archived/frozen, plus restricted to EOL python):

[build-system]
requires = [
    "oldest-supported-numpy; python_version < '3.9'",
    "numpy>=2.0.0; python_version >= '3.9'",
]
build-backend = "setuptools.build_meta"

(And if you're already taking a look at requirements, I think you could also consider restricting blis to <0.9 for windows only? The segfaults are a known issue and we found some but not all of the related bugs back then, which is why we reverted all the attempted blis upgrades after a short time.)

adrianeboyd avatar Dec 05 '24 09:12 adrianeboyd