Skip to content

py-xarray: fix for numpy@2#50075

Merged
becker33 merged 45 commits intospack:developfrom
Chrismarsh:package-fix/xarray-np2
Jun 4, 2025
Merged

py-xarray: fix for numpy@2#50075
becker33 merged 45 commits intospack:developfrom
Chrismarsh:package-fix/xarray-np2

Conversation

@Chrismarsh
Copy link
Copy Markdown
Contributor

@Chrismarsh Chrismarsh commented Apr 15, 2025

This fixes py-xarray and friends to concretize with numpy@2:

spack spec [email protected] +io +parallel +viz ^py-numpy@2
  • py-dask-expr and py-distributed had their py-versioneer versions bumped to 0.28: which ensure they are compatible with the 0.29 required elsewhere in the dask ecosystem.
  • py-dask has the correct numpy bounds to ensure pre and post numpy2 compatible versions
  • py-h5py was updated and numpy versions fixed
  • pydap had a new version added and fixed the URL for future versions. @3.2.2 seems to occupy both the new and old url schemes, so I have updated the scheme without having to have a bespoke url_for_version handler
  • py-zarr was updated for numpy2 compatible version
  • py-zarr also had a mistake in depends_on("py-packaging@:22.0", type=("build", "run")) which is now fixed. I verified all the previous versions back to 3.0 require @22: https://github.com/zarr-developers/zarr-python/blob/v3.0.0/pyproject.toml#L29

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Apr 15, 2025

Hi @Chrismarsh! I noticed that the following package(s) don't yet have maintainers:

  • py-dask-expr
  • py-distributed
  • py-pydap
  • py-xarray
  • py-zarr

Are you interested in adopting any of these package(s)? If so, simply add the following to the package class:

    maintainers("Chrismarsh")

If not, could you contact the developers of this package and see if they are interested? You can quickly see who has worked on a package with spack blame:

$ spack blame py-dask-expr

Thank you for your help! Please don't add maintainers without their consent.

You don't have to be a Spack expert or package developer in order to be a "maintainer," it just gives us a list of users willing to review PRs or debug issues relating to this package. A package can have multiple maintainers; just add a list of GitHub handles of anyone who wants to volunteer.

@spackbot-app spackbot-app bot requested review from skosukhin and takluyver April 15, 2025 23:09
@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Apr 15, 2025

@bryanherman can you review this PR?

This PR modifies the following package(s), for which you are listed as a maintainer:

  • py-dask
  • py-h5py
  • py-netcdf4

@Chrismarsh
Copy link
Copy Markdown
Contributor Author

@spackbot fix style

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Apr 15, 2025

Let me see if I can fix that for you!

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Apr 15, 2025

I was able to run spack style --fix for you!

spack style --fix
==> Running style checks on spack
  selected: import, isort, black, flake8, mypy
==> Modified files
  var/spack/repos/builtin/packages/py-dask-expr/package.py
  var/spack/repos/builtin/packages/py-dask/package.py
  var/spack/repos/builtin/packages/py-distributed/package.py
  var/spack/repos/builtin/packages/py-h5py/package.py
  var/spack/repos/builtin/packages/py-netcdf4/package.py
  var/spack/repos/builtin/packages/py-pydap/package.py
  var/spack/repos/builtin/packages/py-xarray/package.py
  var/spack/repos/builtin/packages/py-zarr/package.py
==> Running import checks
  import checks were clean
==> Running isort checks
  isort checks were clean
==> Running black checks
reformatted var/spack/repos/builtin/packages/py-distributed/package.py
reformatted var/spack/repos/builtin/packages/py-pydap/package.py
reformatted var/spack/repos/builtin/packages/py-h5py/package.py
reformatted var/spack/repos/builtin/packages/py-xarray/package.py
All done! ✨ 🍰 ✨
4 files reformatted, 4 files left unchanged.
  black checks were clean
==> Running flake8 checks
  flake8 checks were clean
==> Running mypy checks
Success: no issues found in 632 source files
  mypy checks were clean
==> spack style checks were clean
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I've updated the branch with style fixes.

@Chrismarsh
Copy link
Copy Markdown
Contributor Author

CI failure is unrelated to these changes

@vsoch
Copy link
Copy Markdown
Member

vsoch commented Apr 24, 2025

Does anyone know why I keep getting notified for this issue? I'm going to try to comment so I can subscribe and unsubscribe (because I don't see the option now).

@Chrismarsh Chrismarsh force-pushed the package-fix/xarray-np2 branch from f6f8637 to aa9d537 Compare April 28, 2025 21:43
@Chrismarsh Chrismarsh requested a review from skosukhin April 28, 2025 21:43
@Chrismarsh
Copy link
Copy Markdown
Contributor Author

@spackbot fix style

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Apr 28, 2025

Let me see if I can fix that for you!

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Apr 28, 2025

I was able to run spack style --fix for you!

spack style --fix
==> Running style checks on spack
  selected: import, isort, black, flake8, mypy
==> Modified files
  var/spack/repos/builtin/packages/py-dask-expr/package.py
  var/spack/repos/builtin/packages/py-dask/package.py
  var/spack/repos/builtin/packages/py-distributed/package.py
  var/spack/repos/builtin/packages/py-h5netcdf/package.py
  var/spack/repos/builtin/packages/py-h5py/package.py
  var/spack/repos/builtin/packages/py-netcdf4/package.py
  var/spack/repos/builtin/packages/py-pydap/package.py
  var/spack/repos/builtin/packages/py-xarray/package.py
  var/spack/repos/builtin/packages/py-zarr/package.py
==> Running import checks
  import checks were clean
==> Running isort checks
  isort checks were clean
==> Running black checks
reformatted var/spack/repos/builtin/packages/py-netcdf4/package.py
All done! ✨ 🍰 ✨
1 file reformatted, 8 files left unchanged.
  black checks were clean
==> Running flake8 checks
  flake8 checks were clean
==> Running mypy checks
Success: no issues found in 632 source files
  mypy checks were clean
==> spack style checks were clean
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I've updated the branch with style fixes.

@Chrismarsh
Copy link
Copy Markdown
Contributor Author

@wdconinc sorry for the mess of commits, I messed up a rebase+merge. I think this addresses all of the comments. I rebased to get the changes from https://github.com/spack/spack/pull/50666/files and refined the numpy range

@Chrismarsh Chrismarsh requested review from becker33 and wdconinc June 4, 2025 16:07
Copy link
Copy Markdown
Contributor

@wdconinc wdconinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me now. Will still needs @becker33 to remove the request changes lock.

@becker33 becker33 merged commit 4c87f02 into spack:develop Jun 4, 2025
16 checks passed
@Chrismarsh Chrismarsh deleted the package-fix/xarray-np2 branch June 4, 2025 22:05
kshea21 pushed a commit to kshea21/spack that referenced this pull request Jun 18, 2025
* Add changes required for xarray with all variants to concretize against numpy@2

* correctly enforce numpy < 2 for @:3.10

* add url_for_version for 3.2.2

* add new py-h5netcdf

* ensure cython is guided to mpi compiler when ingesting a mpi h5 header

---------

Co-authored-by: Chrismarsh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants