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

NEP29: Test PyGMT on NumPy 1.23 and 1.21 #2057

Merged
merged 2 commits into from
Aug 17, 2022
Merged

NEP29: Test PyGMT on NumPy 1.23 and 1.21 #2057

merged 2 commits into from
Aug 17, 2022

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Aug 17, 2022

Description of proposed changes

Bumps numpy from 1.22.4 to 1.23.2. NumPy 1.23.0 was released on 22 Jun 2022.

This is in line with PyGMT's policy on NEP29 at https://www.pygmt.org/v0.7.0/maintenance.html#dependencies-policy, xref #1074.

Also setting minimum NumPy version on CI to 1.21, to bypass the TypeError: <class 'numpy.typing._dtype_like._SupportsDType'> is not a generic class problem with NumPy 1.20 and xarray==2022.6.0 so that unit tests pass. See also pydata/xarray#6818

Note that the branch protection rules at https://github.com/GenericMappingTools/pygmt/settings/branches will need to be changed to use Python 3.10/Numpy 1.22 instead of Python 3.10/Numpy 1.23 before this Pull Request is merged.

Supersedes #1701

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@weiji14 weiji14 added the maintenance Boring but important stuff for the core devs label Aug 17, 2022
@weiji14 weiji14 self-assigned this Aug 17, 2022
# Pair Python 3.8 with NumPy 1.20 and Python 3.10 with NumPy 1.22
# Only install optional packages on Python 3.10/NumPy 1.22
# Pair Python 3.8 with NumPy 1.20 and Python 3.10 with NumPy 1.23
# Only install optional packages on Python 3.10/NumPy 1.23
include:
- python-version: '3.8'
numpy-version: '1.20'
Copy link
Member Author

Choose a reason for hiding this comment

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

Question. Do we want to just set our minimum tested NumPy version to 1.21 in the CI since xarray doesn't work with Numpy 1.20 and they won't be releasing a patch as per pydata/xarray#6818 (comment)? Due date to drop Numpy 1.20 is Jan 31, 2023 (5 months) per https://numpy.org/neps/nep-0029-deprecation_policy.html#drop-schedule.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think setting numpy to v1.21 makes sense. I'm not sure what the plan is for the pygmt v0.8 release, but I don't think we'll have 2 releases before January 2023, so our next release should be up to date on minimum versions.

Copy link
Member Author

@weiji14 weiji14 Aug 17, 2022

Choose a reason for hiding this comment

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

Cool. Just to be clear, the suggestion is to just set NumPy 1.21 for the Continuous Integration (CI) so that the unit tests pass. We shouldn't change the minimum supported NumPy mentioned in https://github.com/GenericMappingTools/pygmt/tree/v0.7.0#compatibility-with-gmtpythonnumpy-versions until after Jan 2023 (though users using NumPy 1.20 will need to figure out the xarray dependency themselves).

Bypass issue with `TypeError: <class 'numpy.typing._dtype_like._SupportsDType'> is not a generic class` reported in pydata/xarray#6818.
@weiji14 weiji14 changed the title NEP29: Test PyGMT on NumPy 1.23 NEP29: Test PyGMT on NumPy 1.23 and 1.21 Aug 17, 2022
@weiji14 weiji14 marked this pull request as ready for review August 17, 2022 15:30
@seisman seisman added this to the 0.8.0 milestone Aug 17, 2022
Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

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

Looks good to me.

The two failing tests on Windows are unrelated to this PR and should be addressed separately.

@weiji14 weiji14 merged commit 58a9b30 into main Aug 17, 2022
@weiji14 weiji14 deleted the nep29/numpy-1.23 branch August 17, 2022 15:56
@weiji14 weiji14 linked an issue Aug 17, 2022 that may be closed by this pull request
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
* NEP29: Test PyGMT on NumPy 1.23

Bumps [numpy](https://github.com/numpy/numpy) from 1.22.4 to 1.23.2.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/v1.23.0/doc/changelog/1.23.0-changelog.rst)
- [Commits](numpy/numpy@v1.22.4...v1.23.2)

* Set minimum NumPy version to 1.21 for CI tests

Bypass issue with `TypeError: <class 'numpy.typing._dtype_like._SupportsDType'> is not a generic class` reported in pydata/xarray#6818.
@weiji14 weiji14 mentioned this pull request Jun 20, 2023
7 tasks
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests fail with xarray 2022.6.0 + numpy 1.20
3 participants