-
Notifications
You must be signed in to change notification settings - Fork 72
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
Error importing cyvcf2 with numpy 2.0.0 #307
Comments
I'm also running into this issue. Based on the numpy docs, I think the [build-system]
requires = [
"setuptools",
"wheel",
"cython>=0.23.3",
- 'oldest-supported-numpy; os_name != "nt"',
+ 'oldest-supported-numpy; os_name != "nt"' and python_version < "3.9"',
- 'numpy; os_name == "nt"'
+ 'numpy>=2.0.0; os_name == "nt" and python_version >= "3.9"',
] |
@aryarm , I pushed your suggestions, but the build is still failing. Any suggestions? |
@brentp, I think I made a mistake! I didn't realize In that case, maybe try something more like this? [build-system]
requires = [
"setuptools",
"wheel",
"cython>=0.23.3",
- 'oldest-supported-numpy; os_name != "nt"',
+ 'oldest-supported-numpy; os_name != "nt"' and python_version < "3.9"',
- 'numpy; os_name == "nt"'
+ 'numpy; os_name == "nt" and python_version < "3.9"',
+ 'numpy>=2.0.0; python_version >= "3.9"',
] In other words:
|
you might also need to make some changes to the source code to make it compatible with numpy 2.0 This doc has a list of the required changes Just from a cursory glance, that might explain why the sdist build with python 3.12 failed? It seems to be the only test running against numpy 2.0. The rest of the tests seem to be running with an older version of numpy (even though they may be using numpy 2.0 for compilation!) because we haven't also updated the |
I pushed to a branch with the updated requirements.txt. Will continue work on it later this week. Pull requests appreciated. ;) |
ok! thanks for the quick response on this and for trying my suggestions! It might also be a good idea to add steps to the CI to test against both the newest version of numpy and the oldest version of numpy supported by cyvcf2, as recommended in the numpy docs |
ok, upon further investigation, it seems that the failing sdist build with python 3.12 from earlier was a fluke. It happened because we tried to build cyvcf2 with numpy < 2.0 and then run it with a version of numpy > 2.0, which is explicitly discouraged in the docs The CI seems to pass now in #308 on my fork, so I'm inclined to say that there won't need to be any changes to the source code to support numpy 2.0, after all |
excellent! thank you for figuring this out! |
I pushed v0.31.1 with changes from @aryarm . Should resolve this issue. |
seems to be working now on my end! feel free to close this thanks for the quick turnaround on this! |
Got the following error when importing cyvcf2:
Versions:
I had to downgrade numpy manually to numpy 1.26.4 to get cyvcf2 working again.
The text was updated successfully, but these errors were encountered: