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

Bump dependencies for NumPy 2 compatibility #511

Open
wants to merge 56 commits into
base: main
Choose a base branch
from

Conversation

cbrnr
Copy link
Contributor

@cbrnr cbrnr commented Oct 23, 2024

All tests pass and demo.ipynb works without any errors or warnings using NumPy >= 2.

@cbrnr
Copy link
Contributor Author

cbrnr commented Oct 23, 2024

OK, I'm struggling a bit with dependencies here. If you want to keep Python >= 3.9 and at the same time also support 3.13, scipy >= 1.13.1 works only for Python <= 3.12. Strangely, uv does not use scipy 1.14.1 (there is no binary wheel for scipy 1.13.1 for Python 3.13) for Python 3.13, but insists on using 1.13.1...

@bemoody
Copy link
Collaborator

bemoody commented Oct 24, 2024

Sure, seems like the problem is that "uv run --extra dev pytest" is doing something bizarre.

I don't know exactly what that command is doing or trying to do, but it seems to be trying to install the oldest versions of packages that satisfy our dependencies. That is not what we want (that's not what any normal user does) and is not likely to lead to a good solution.

@cbrnr
Copy link
Contributor Author

cbrnr commented Oct 24, 2024

It might actually be something at the core of how uv resolves dependencies, yes. I've opened an issue here: astral-sh/uv#8492

@YmirKhang
Copy link

Hells yeah!

@cbrnr
Copy link
Contributor Author

cbrnr commented Nov 18, 2024

Hmmm, the Windows 3.13 job crashed, but this might be unrelated. @bemoody or @tompollard could you please restart this job (I don't have the permissions to do that myself)?

@cbrnr
Copy link
Contributor Author

cbrnr commented Nov 19, 2024

We're hitting another issue, this time related to CPython (python/cpython#125235). We gotta wait for 3.13.1 for the fix.

@cbrnr cbrnr marked this pull request as ready for review November 19, 2024 09:34
@cbrnr
Copy link
Contributor Author

cbrnr commented Nov 19, 2024

This is ready for review. Everything works with NumPy >= 2. I've removed support for Python 3.8 and added Python 3.12. Python 3.13 can be added as soon as 3.13.1 is released, but I would do that in a separate PR. It would be great if you could push out a new release to PyPI once this PR gets merged.

@cbrnr
Copy link
Contributor Author

cbrnr commented Nov 26, 2024

OK, I'd really appreciate if someone took a look. I've now enabled weak_and_warn, and the Python 3.9 job on Ubuntu uses numpy==1.26.4 (all other jobs use numpy>=2). One test fails, which I cannot reproduce locally (neither on macOS nor on Linux).

The Windows jobs all emit a warning related to tk (see here), but I think these warnings have always been there (not a result of this PR).

Another question that came up: is the Debian i386 job still needed? It runs the tests with Python 3.7, which is not supported anymore.

Finally, and this is a question for when all other issues have been resolved, the test matrix is rather large. Is it really necessary to test on all combinations of OSs and Python versions?

@cbrnr
Copy link
Contributor Author

cbrnr commented Dec 17, 2024

Since uv has a new solver which now by default behaves like pip (astral-sh/uv#9868), I'll revert to using uv sync and uv run again (will take a little time though). I'd appreciate any responses to my questions, because these are not affected by the resolution strategy.

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

Successfully merging this pull request may close these issues.

3 participants