pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.63k stars 1.09k forks source link

array-api-strict v2.1.2 breaks CI #9750

Closed kmuehlbauer closed 1 week ago

kmuehlbauer commented 2 weeks ago

What is your issue?

array-api-strict v2.1.2 (released some hours ago) needs numpy >=2.1, but the conda-forge package is missing that pin:

see:

Some of xarray's dependencies are not available yet for numpy >=2.1, the current environments resolve to numpy 2.0.2. This breaks the tests where array-api-strict is imported.

kmuehlbauer commented 2 weeks ago

The offending package is numba which has pinned numpy <2.1 for the current version 0.60.

numba 0.61 will be numpy 2.1 compatible, but isn't yet released.

One short-term solution to unlock CI would be to pin numpy <2.1 in all CI with environments containing numba.

keewis commented 2 weeks ago

you mean, pin array-api-strict for now?

kmuehlbauer commented 2 weeks ago

That would be one solution, or to pin numpy>=2,<2.1. Not sure what's more reasonable.

keewis commented 2 weeks ago

if I understand correctly, the issue is that the new version of array-api-strict requires numpy>=2.1 but the conda-forge package metadata does not reflect that. So I don't think requiring an older version of numpy would help, since we'd still get the new (broken) version of array-api-strict.

rgommers commented 2 weeks ago

The conda-forge array-api-strict metadata is fixed now.

If the current choice is to pin array-api-strict or numpy, I'd constrain the former though.

keewis commented 2 weeks ago

numpy is indirectly constrained by numba, so if the metadata has been fixed there might be nothing we need to do here?

Edit: actually, I misunderstood what you said. I guess it would be best to pin array-api-strict (or explicitly forbid the broken versions) either way.

kmuehlbauer commented 2 weeks ago

Thanks @rgommers, much appreciated.

@keewis The all-but-numba check fails even with numpy=2.1.3 and array-api-strict=2.1.2. See https://github.com/pydata/xarray/actions/runs/11739187309/job/32703227103?pr=9751

keewis commented 2 weeks ago

I'll look into it, but this might take some time.

kmuehlbauer commented 2 weeks ago

@keewis I've pinned array-api-strict<=2.1 in all relevant environments in #9751. Would be good to get this in to unlock CI again. Would also buy you some time to investigate the issues wrt the failing array-api-strict related tests.