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 2.0 issues #406

Closed
kinnala opened this issue Apr 7, 2024 · 13 comments
Closed

NumPy 2.0 issues #406

kinnala opened this issue Apr 7, 2024 · 13 comments

Comments

@kinnala
Copy link

kinnala commented Apr 7, 2024

I was testing some old code against numpy==2.0rc1 and ran into the following issue:

E           AttributeError: `np.deprecate` was removed in the NumPy 2.0 release. Emit `DeprecationWarning` with `warnings.warn` directly, or use `typing.deprecated`.

Seems to be used here: @np.deprecate

There might be other incompabilities that I am unaware of.

@lukeolson
Copy link
Member

Thanks @kinnala. This appears to be the only issues so far. Both ruff and testing pass with this fix: #407. I'll dig a bit to see if other changes are needed.

@lesteve
Copy link
Contributor

lesteve commented Jun 17, 2024

We are hitting this in scikit-learn CI. There is no rush since we can ignore the warning for now, but it would be great if #407 was merged.

@jorgensd
Copy link

We are aiming to move to numpy 2.0 in DOLFINx (https://github.com/FEniCS/dolfinx/) and we have pyamg in our demos, so would be great to get #407 merged.

@jakirkham
Copy link

Am I reading correctly that it was merged and placed in the 5.2.0 release?

@lukeolson
Copy link
Member

Yep -- that's right. rn I'm working on getting the wheels up on pypi (and having a slight issue).

@jakirkham
Copy link

Thanks Luke! 🙏

Do you need another set of eyes?

@lesteve
Copy link
Contributor

lesteve commented Jun 27, 2024

Looks like the wheels have been uploaded to PyPI https://pypi.org/project/pyamg/#files, so I guess this can be closed?

Thanks a lot @lukeolson 🙏!

@lukeolson
Copy link
Member

yep, I think the binary wheels are all looking ok. there remains an issue with the sdist if anyone has ideas:
https://github.com/pyamg/pyamg/actions/runs/9690697265/job/26741266593

thank you for your patience @*everyone!

@lesteve
Copy link
Contributor

lesteve commented Jun 27, 2024

Maybe you already know this, but one weird thing is that your version looks like a dev version rather than 5.2.0.

For completeness, here is the error:

ERROR    HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/        
         The use of local versions in <Version('5.2.1.post1.dev1+gb11728f')> is 
         not allowed. See                                                       
         https://packaging.python.org/specifications/core-metadata for more     
         information.                                        

According to pypi/legacy#731 (comment) you are not supposed to upload a version with the +gb11728f part. I still think the main thing would be to figure out why you are trying to upload a dev version rather than 5.2.0 ...

@jakirkham
Copy link

Likely sdist build process (or something that precedes it) makes the working directory dirty. As a result setuptools-scm notes the version as in development. This might be fixable by...

  1. Running the sdist build outside of the source directory
  2. Configuring the sdist build to use directories outside of the source directory
  3. Finding what contaminates the source directory and adding it to .gitignore
  4. Using some git workaround to ignore the change
  5. ?

@lukeolson
Copy link
Member

@jakirkham @lesteve -- thanks for the pointers. In the end it was an issue with the fetch depth and failing to specify a tag to checkout (on rerunning the action). The wheels are up along with an sdist (as v5.2.1) -- any issues just let us know.

@jakirkham
Copy link

Thanks Luke! 🙏

@jakirkham
Copy link

Had a couple observations on build dependencies we should update

Filed in issue: #415

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

5 participants