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

Drop support for NumPy 1.20 #14349

Merged
merged 2 commits into from Feb 5, 2023
Merged

Conversation

WilliamJamieson
Copy link
Contributor

Description

Per APE 18, as of today (January, 31 2023) we should drop support for NumPy 1.20 (see https://numpy.org/neps/nep-0029-deprecation_policy.html#drop-schedule). This PR executes that drop of support

@github-actions
Copy link

github-actions bot commented Jan 31, 2023

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see "When to rebase and squash commits".
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • Is a milestone set? Milestone must be set but we cannot check for it on Actions; do not let the green checkmark fool you.
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@github-actions
Copy link

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@WilliamJamieson WilliamJamieson marked this pull request as ready for review January 31, 2023 19:48
Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

With dropping the support, we should also remove work-arounds that are needed for numpy 1.20. I think there are not so many:

find . -name \*.py -exec grep NUMPY_LT_1_21 {} \; -print
    "NUMPY_LT_1_21_1",
NUMPY_LT_1_21_1 = not minversion(np, "1.21.1")
./astropy/utils/compat/numpycompat.py
                # perhaps axis or where was masked (in NUMPY_LT_1_21 this is
./astropy/utils/masked/core.py
from astropy.utils.compat import NUMPY_LT_1_21_1, NUMPY_LT_1_22
        sys.byteorder == "big" and NUMPY_LT_1_21_1, reason="Numpy GitHub Issue 19153"
./astropy/units/tests/test_quantity_array_methods.py
from astropy.utils.compat import NUMPY_LT_1_21_1
    @pytest.mark.skipif(NUMPY_LT_1_21_1, reason="https://stackoverflow.com/q/69571643")
./astropy/units/tests/test_structured.py

Since these are all "mine", I thought I might as well fix them... Will push a commit shortly, and approve assuming tests pass.

tox.ini Outdated Show resolved Hide resolved
@pllim pllim added this to the v5.3 milestone Feb 3, 2023
@@ -125,9 +124,6 @@ def test_swapaxes(self):
assert q_swapaxes.unit == q.unit
assert np.all(q_swapaxes.value == q.value.swapaxes(0, 2))

@pytest.mark.xfail(
sys.byteorder == "big" and NUMPY_LT_1_21_1, reason="Numpy GitHub Issue 19153"
Copy link
Member

@pllim pllim Feb 3, 2023

Choose a reason for hiding this comment

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

@mhvk , won't this comparison also hold for 1.21.0?

Copy link
Contributor

Choose a reason for hiding this comment

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

Darn, I'm an idiot! I just thought we were dropping support for the oldest numpy version in numpycompat.py, but apparently we never had anything particularly bad about numpy 1.20... Sigh...

And thanks for catching that. Am happy to push an update with that commit removed...

@mhvk
Copy link
Contributor

mhvk commented Feb 5, 2023

I removed my incorrect adjustments! Should now all be fine.

@mhvk
Copy link
Contributor

mhvk commented Feb 5, 2023

Failures in -dev are all unrelated (asdf), so let's get this in. Thanks, @WilliamJamieson, and apologies again for adding edits for the wrong numpy version!

@mhvk mhvk merged commit 3fc3eaf into astropy:main Feb 5, 2023
@WilliamJamieson WilliamJamieson deleted the mnt/drop_numpy_1.20 branch February 6, 2023 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants