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

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

Merged
merged 2 commits into from
May 5, 2024

Conversation

seisman
Copy link
Member

@seisman seisman commented Apr 29, 2024

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,

@seisman seisman added the run/test-gmt-dev Trigger the GMT Dev Tests workflow in PR label Apr 29, 2024
@seisman seisman added the maintenance Boring but important stuff for the core devs label May 5, 2024
@seisman seisman changed the title WIP: CI: Temporarily pin to numpy<2 in "GMT Dev Tests" workflow CI: Temporarily pin to numpy<2 in "GMT Dev Tests" workflow May 5, 2024
@seisman seisman changed the title CI: Temporarily pin to numpy<2 in "GMT Dev Tests" workflow CI: Temporarily pin to numpy<2 in the "GMT Dev Tests" workflow May 5, 2024
@seisman seisman added this to the 0.13.0 milestone May 5, 2024
@seisman
Copy link
Member Author

seisman commented May 5, 2024

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.

@seisman seisman added the needs review This PR has higher priority and needs review. label May 5, 2024
@seisman seisman 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 main May 5, 2024
11 of 20 checks passed
@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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants