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

Ensure no unexpected failures in treating deprecations as exceptions. #12389

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

mhvk
Copy link
Contributor

@mhvk mhvk commented Nov 3, 2021

The current del module.__warningregistry__ fails with a TypeError rather than AttributeError for h5py.
It seems reasonable to just skip trying to delete it on any exception. Tests run after this change. I don't really know how to add a test for this, though, short of testing with more Debian packages in our test grid.

Fixes #12388

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • 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.
  • 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 a milestone set? Milestone must be set but astropy-bot check might be missing; 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.

The current del module.__warningregistry__
fails with a TypeError rather than AttributeError for h5py.
It seems reasonable to just skip trying to delete it on any exception.
Tests pass after this change.
@mhvk mhvk added this to the v5.0 milestone Nov 3, 2021
@mhvk mhvk added the 💤 backport-v5.0.x on-merge: backport to v5.0.x label Nov 3, 2021
@mhvk
Copy link
Contributor Author

mhvk commented Nov 3, 2021

Failures unrelated - will be fixed by #12390

@astrofrog
Copy link
Member

Thanks for the fix! As an aside we really should consider deprecating our custom machinery for treating deprecation warnings as exceptions at some point since it is possible to do the same with pytest options...

@astrofrog astrofrog merged commit 80fcd79 into astropy:main Nov 4, 2021
meeseeksmachine pushed a commit to meeseeksmachine/astropy that referenced this pull request Nov 4, 2021
astrofrog added a commit that referenced this pull request Nov 4, 2021
…389-on-v5.0.x

Backport PR #12389 on branch v5.0.x (Ensure no unexpected failures in treating deprecations as exceptions.)
@mhvk mhvk deleted the fix-deprecations-as-exceptions branch December 20, 2021 20:07
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.

Test failure for 5.0rc1 with h5py installed locally
2 participants