Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpy requirements/compatibility #13707

Open
adrianeboyd opened this issue Dec 5, 2024 · 2 comments
Open

numpy requirements/compatibility #13707

adrianeboyd opened this issue Dec 5, 2024 · 2 comments

Comments

@adrianeboyd
Copy link
Contributor

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 (conda-forge/thinc-feedstock#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.)

@honnibal
Copy link
Member

Thanks, I missed this issue before!

I wasn't aware we could build against numpy v2 and have the install compatibility across both. I'll do that. I've also been trying to update Blis to the latest vendored version, and if that doesn't fix the crashes I'll revert back down, yes.

@adrianeboyd
Copy link
Contributor Author

You need to have >=2.0.0 in the build system requirements to be sure it's going to be compatible, not this:

https://github.com/explosion/cython-blis/pull/114/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants