Skip to content

CI: Temporarily pin to numpy<2 in the "GMT Dev Tests" workflow - #3208

Merged
seisman merged 2 commits into
mainfrom
CI/dev-numpy2
May 5, 2024
Merged

CI: Temporarily pin to numpy<2 in the "GMT Dev Tests" workflow#3208
seisman merged 2 commits into
mainfrom
CI/dev-numpy2

Conversation

@seisman

@seismanseisman commented Apr 29, 2024

Copy link
Copy Markdown
Member

The "GMT Dev Tests" workflow is failing likely because cftime is incompatible with numpy 2.x (Unidata/cftime#325):

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.0.dev0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.
Traceback (most recent call last): File "<string>", line 1, in <module>
File "/home/runner/work/pygmt/pygmt/pygmt/__init__.py", line 30, in <module>
from pygmt import datasets
File "/home/runner/work/pygmt/pygmt/pygmt/datasets/__init__.py", line 7, in <module>
from pygmt.datasets.earth_age import load_earth_age
File "/home/runner/work/pygmt/pygmt/pygmt/datasets/earth_age.py", line 10, in <module>
from pygmt.datasets.load_remote_dataset import _load_remote_dataset
File "/home/runner/work/pygmt/pygmt/pygmt/datasets/load_remote_dataset.py", line 9, in <module>
from pygmt.clib import Session
File "/home/runner/work/pygmt/pygmt/pygmt/clib/__init__.py", line 8, in <module>
from pygmt.clib.session import Session
File "/home/runner/work/pygmt/pygmt/pygmt/clib/session.py", line 17, in <module>
import xarray as xr
File "/home/runner/micromamba/envs/pygmt/lib/python3.12/site-packages/xarray/__init__.py", line 3, in <module>
from xarray import testing, tutorial
File "/home/runner/micromamba/envs/pygmt/lib/python3.12/site-packages/xarray/testing/__init__.py", line 2, in <module>
from xarray.testing.assertions import ( # noqa: F401
File "/home/runner/micromamba/envs/pygmt/lib/python3.12/site-packages/xarray/testing/assertions.py", line 12, in <module>
from xarray.core.coordinates import Coordinates
File "/home/runner/micromamba/envs/pygmt/lib/python3.12/site-packages/xarray/core/coordinates.py", line [16](https://github.com/GenericMappingTools/pygmt/actions/runs/8871676257/job/24354984638#step:12:17), in <module>
from xarray.core.alignment import Aligner
File "/home/runner/micromamba/envs/pygmt/lib/python3.12/site-packages/xarray/core/alignment.py", line 24, in <module>
from xarray.core.variable import Variable, as_compatible_data, calculate_dimensions
File "/home/runner/micromamba/envs/pygmt/lib/python3.12/site-packages/xarray/core/variable.py", line [19](https://github.com/GenericMappingTools/pygmt/actions/runs/8871676257/job/24354984638#step:12:20), in <module>
from xarray.core import common, dtypes, duck_array_ops, indexing, nputils, ops, utils
File "/home/runner/micromamba/envs/pygmt/lib/python3.12/site-packages/xarray/core/common.py", line 26, in <module>
import cftime
File "/home/runner/micromamba/envs/pygmt/lib/python3.12/site-packages/cftime/__init__.py", line 1, in <module>
from ._cftime import (datetime, real_datetime,

@seismanseisman added the run/test-gmt-dev Trigger the GMT Dev Tests workflow in PR label Apr 29, 2024
@seismanseisman mentioned this pull request Apr 29, 2024
35 tasks
@seismanseisman added the maintenance Boring but important stuff for the core devs label May 5, 2024
@seismanseisman changed the title WIP: CI: Temporarily pin to numpy<2 in "GMT Dev Tests" workflowCI: Temporarily pin to numpy<2 in "GMT Dev Tests" workflowMay 5, 2024
@seismanseisman changed the title CI: Temporarily pin to numpy<2 in "GMT Dev Tests" workflowCI: Temporarily pin to numpy<2 in the "GMT Dev Tests" workflowMay 5, 2024
@seismanseisman added this to the 0.13.0 milestone May 5, 2024
@seisman

Copy link
Copy Markdown
MemberAuthor

It's unclear when NumPy 2.x and the compatible cftime will be released. This PR pins to NumPy<2 in the "GMT Dev Tests" workflow so the workflow won't fail due to incompatible packages.

Later, I'll open a separate PR to revert the changes in this PR so that we can track if there are any changes in numpy or cftime.

@seismanseisman added the needs review This PR has higher priority and needs review. label May 5, 2024
@seismanseisman added skip-changelog Skip adding Pull Request to changelog and removed needs review This PR has higher priority and needs review. run/test-gmt-dev Trigger the GMT Dev Tests workflow in PR labels May 5, 2024
@seisman
seisman merged commit 8605895 into mainMay 5, 2024
@seisman
seisman deleted the CI/dev-numpy2 branch May 5, 2024 22:41
seisman added a commit that referenced this pull request May 6, 2024
seisman added a commit that referenced this pull request Jun 18, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenanceBoring but important stuff for the core devsskip-changelogSkip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@seisman@weiji14