Giter Site home page Giter Site logo

Comments (10)

aryarm avatar aryarm commented on September 27, 2024 1

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

from cyvcf2.

brentp avatar brentp commented on September 27, 2024 1

I pushed v0.31.1 with changes from @aryarm . Should resolve this issue.

from cyvcf2.

aryarm avatar aryarm commented on September 27, 2024

I'm also running into this issue.

Based on the numpy docs, I think the pyproject.toml file needs to be updated.

[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"',
]

from cyvcf2.

brentp avatar brentp commented on September 27, 2024

@aryarm , I pushed your suggestions, but the build is still failing. Any suggestions?

from cyvcf2.

aryarm avatar aryarm commented on September 27, 2024

@brentp, I think I made a mistake! I didn't realize os_name == "nt" applies only to windows

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:

  • if the python version is 3.9+, use numpy>=2.0.0
  • otherwise
    • if the os is windows, use any compatible numpy
    • or use oldest-supported-numpy if the os is linux

from cyvcf2.

aryarm avatar aryarm commented on September 27, 2024

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
https://numpy.org/doc/stable/numpy_2_0_migration_guide.html#c-api-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 requirements.txt file yet

image

from cyvcf2.

brentp avatar brentp commented on September 27, 2024

I pushed to a branch with the updated requirements.txt. Will continue work on it later this week. Pull requests appreciated. ;)

from cyvcf2.

aryarm avatar aryarm commented on September 27, 2024

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

from cyvcf2.

brentp avatar brentp commented on September 27, 2024

excellent! thank you for figuring this out!

from cyvcf2.

aryarm avatar aryarm commented on September 27, 2024

seems to be working now on my end! feel free to close this

thanks for the quick turnaround on this!

from cyvcf2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.