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

Does stripy support numpy 2.x on PyPI (pip) ? #114

Open
jcannon-gplates opened this issue Feb 1, 2025 · 8 comments
Open

Does stripy support numpy 2.x on PyPI (pip) ? #114

jcannon-gplates opened this issue Feb 1, 2025 · 8 comments

Comments

@jcannon-gplates
Copy link

I can see that stripy 2.3.3 on conda supports numpy 2.x (conda-forge/stripy-feedstock#21).

Do you know if stripy 2.3.3 on PyPI was also compiled with numpy 2.x ?

Because in GPlates/gplately#305 we're getting a numpy import error that appears to come from stripy. But if we downgrade numpy from 2.x to 1.x it's fine.

Building against numpy 2.x supports both numpy 1.x and 2.x at runtime. So you could force compilation against numpy 2.x with something like the following in your "pyproject.toml":

[build-system]
...
requires = [
    # Building against numpy 2.x supports both numpy 1.x and 2.x at *runtime*.
    'numpy>=2.0; python_version>="3.9"',
    # Python 3.8 is not supported by NumPy 2.x.
    # And *building* against NumPy 1.x does NOT support earlier (<1.x) versions at runtime.
    # So using the oldest supported NumPy for the Python version and platform.
    'oldest-supported-numpy; python_version<"3.9"',
    ...
]

...this is what I do in pygplates.

@julesghub
Copy link
Member

julesghub commented Feb 3, 2025

Hi @jcannon-gplates, I'm not sure about the build on Pypi - I'm guessing it's compiled with numpy 1.x
@brmather & @lmoresi any comment?

I'm happy to kick off a numpy>=2 build via feedstock if you like.

@lmoresi
Copy link
Member

lmoresi commented Feb 3, 2025 via email

@jcannon-gplates
Copy link
Author

I'm happy to kick off a numpy>2 build via feedstock if you like.

Thanks, but conda is all good - it looks like @brmather has numpy 2 working there. The code snippet above is really just for PyPI.

@julesghub
Copy link
Member

oh i see. Unfortunately I don't have access to the stripy PyPI. @brmather or @lmoresi please grant.

@brmather
Copy link
Member

brmather commented Feb 3, 2025

@julesghub what is your PyPI username?

@brmather
Copy link
Member

brmather commented Feb 3, 2025

Just found it. jgiordani Has been added

@julesghub
Copy link
Member

Thanks - I'll update it later today.

@jcannon-gplates
Copy link
Author

jcannon-gplates commented Feb 4, 2025

Thanks - I'll update it later today.

Great, thanks!!

I see that "test_linear_interpolation" is failing. Gosh I hope that's not a NumPy 2 issue. No hurry for us, we can always set dependencies=["numpy<2"] in gplately, for our upcoming release (which is still a few weeks away) and revisit it in the future.

By the way, regarding 7cfce70, it's fine to leave dependencies = ["numpy>=1.16.0"] (rather than "numpy>=2.0.0"). That allows user's environment to work with numpy 1.x (or 2.x) at runtime.

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

4 participants