Opened 5 months ago

Last modified 7 weeks ago

#70251 assigned defect

py-numpy 2.0.0

Reported by: Schamschula (Marius Schamschula) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cooljeanius (Eric Gallager), i0ntempest
Port: py-astropy py-cartopy py-matplotlib py-numpy py-pyerfa py-sunpy py-tifffile py-tropycal py-vispy

Description (last modified by Schamschula (Marius Schamschula))

We are transitioning from py-numpy 1.26.4 to py-numpy 2.0.0, which was officially released on June 16, 2024.

From the numpy documentation: https://numpy.org/devdocs/dev/depending_on_numpy.html#numpy-2-0-specific-advice

So far we have run into the following ports that require >= 2.0.0rc2:

py-astropy 6.1.3: Only needed for PyPI wheels. See: https://github.com/macports/macports-ports/commit/9c190e872373cb073b7e3168787575944a054ed5

py-bottleneck 1.4.0: Only needed for PyPI wheels. See: https://github.com/macports/macports-ports/pull/25662

py-cartopy 0.23.0: Only needed for PyPI wheels. See: https://github.com/macports/macports-ports/commit/cdaae5629bec4ee4f5de51701695d28e8ebef86e

py-matplotlib 3.9.0

py-pyerfa 2.0.1.41: Only needed for PyPI wheels. See: https://github.com/macports/macports-ports/commit/1cb2757245ac645d5669299a765635cc9337ba35

py-sunpy 6.0.1: Only needed for PyPI wheels. See: https://github.com/macports/macports-ports/commit/6c882c5fe7c78d98ff47974931bc5b8a27dbf733

py-vispy 0.14.3: Only needed for PyPI wheels. See: https://github.com/macports/macports-ports/commit/dc64d200891ff5e80281097b7cc8c8e310d81457

py-wavelets 1.7.0

Updates have been held back until py-numpy >= 2.0.0 is available.

I will update this ticket as I run into additional ports.

Change History (30)

comment:1 Changed 5 months ago by reneeotten (Renee Otten)

latest version of py-matplotlib also requires it, and I have held back the update

comment:2 Changed 5 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:3 Changed 5 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:4 Changed 5 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)
Port: py-matplotlib added

comment:5 Changed 4 months ago by Marius Schamschula <mschamschula@…>

In a55e7512c9aed21eccf0694a57c5d926031da80b/macports-ports (master):

py-tropycal: revert to version 1.2.1

See: #70251

comment:6 Changed 4 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:7 Changed 4 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:8 Changed 4 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:9 Changed 4 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:10 Changed 4 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:11 Changed 4 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:12 Changed 3 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:13 Changed 3 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:15 Changed 3 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:16 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:17 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:18 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:19 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:20 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:21 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:22 Changed 2 months ago by reneeotten (Renee Otten)

I am working on this update and will put up a PR once I've finished up a few remaining things. NumPy v2.0.1 supports PY39, the latest upstream version v2.1.0 supports PY310 and above.

I would propose the following:

  1. keep the current version as py-numpy-legacy, this has to conflict with the latest versions as Python packages cannot be installed side-by-side.
  2. list all dependents and:
  • remove all subports below 39 where possible, if needed going down the dependency chain
  • if a port depends on Python < 3.9 and is deemed to be valuable and cannot be removed, then it should depend on pyXY-numpy-legacy
  • update all ports if a newer upstream version is available, or if not, rebuild the port with NumPy v2.0 and enable/run the test-suite to verify that it still works correctly. If no issues are reported by using ruff check path/to/code/ --select NPY201 I think we assume that things are likely to work.

I *think* this is the only way it can work, but am open to comments/suggestions.

I will update here with a link to the PR once that is all fixed and we can start adding ports/updates there and once we are fairly convinced most of the things will work, then we can merge. Additionally, once that's the case people who are interested in older systems should verify that this all still works and if not provide patches to make that happen if possible. The build system has changed to meson and upstream is using a vendored version with NumPy specific changes. Our meson port has quite a few changes specifically intended to support older OSes, but integrating these modified meson versions sounds complicated and not something I am willing to invest time in.

comment:23 Changed 2 months ago by reneeotten (Renee Otten)

Same considerations/issues apply to py-scipy as well. If we want to make any progress in keeping things up-to-date we will have to drop unsupported Python versions. Also here the build system was switched to meson and there is no point patching around that any longer; is someone wants older systems supported, then please do the work on getting meson to do TheRightThing there. I will try to put up an initial PR for NumPy and SciPy - and will try to clean-up Python subports below 3.9 to make things easier.

However, if there are expectations to keep older Python versions/OSes supported then I am not even going to bother; there is no sustainable way to do that given that upstream aggressively drops things.

comment:24 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:25 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

It turns out that

comment:26 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

Even though py-tifffile specifies numpy 2.1.0 in the release notes, it builds correctly with numpy < 2.0.0.

comment:27 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

py-tropycal works with numpy < 2.0.0

comment:28 Changed 2 months ago by Schamschula (Marius Schamschula)

Description: modified (diff)

comment:29 Changed 2 months ago by Marius Schamschula <mschamschula@…>

In bbbcd2096b9409e39855703dd663408ddcef618f/macports-ports (master):

py-bottleneck: update to 1.4.0

Work around PyPI py-numpy >= 2.0.0 requirement
See: https://github.com/pydata/bottleneck/blob/master/pyproject.toml
See: #70251

comment:30 Changed 7 weeks ago by i0ntempest

Cc: i0ntempest added
Note: See TracTickets for help on using tickets.