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

Remove / deprecate outdated code in utils.compat #13636

Merged
merged 2 commits into from Sep 11, 2022

Conversation

nstarman
Copy link
Member

Description

  • suppress is part of core python and should be imported as such.
  • namedtuple_asdict was for python 3.3 and is not used in the core package.
  • override__dir__ is deprecated. It was necessary because of http://bugs.python.org/issue12166, which has been resolved for a long time.

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?
  • Do the proposed changes need the code-style fixed?
  • 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 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 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.

Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
@nstarman
Copy link
Member Author

I didn't touch possible_filename because fits uses it. @saimn, is it still necessary?

Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
@pllim
Copy link
Member

pllim commented Sep 10, 2022

because fits uses it

Not touching it is a wise choice. 😆

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.

Looks all good, thanks for the cleanup!

And fine to leave possible_filename for another issue.

@saimn
Copy link
Contributor

saimn commented Sep 11, 2022

I didn't touch possible_filename because fits uses it. @saimn, is it still necessary?

It's used in wcs, not io.fits, but I guess it could be deprecated as well.

@nstarman nstarman merged commit c00dc38 into astropy:main Sep 11, 2022
@nstarman nstarman deleted the rm-compats branch September 11, 2022 17:00
@@ -61,15 +78,3 @@ def override__dir__wrapper(self):
return sorted(members)

return override__dir__wrapper


def namedtuple_asdict(namedtuple):
Copy link
Member

Choose a reason for hiding this comment

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

Wait a minute... This and "suppress" were removed without deprecation?

Copy link
Member Author

Choose a reason for hiding this comment

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

I felt comfortable doing that because in https://github.com/astropy/astropy/blob/main/astropy/utils/compat/__init__.py
it says

The content of this module is solely for internal use of ``astropy``
and subject to changes without deprecations. Do not use it in external
packages or code.

They also weren't used, while override__dir__ saw a fair amount of use around astropy, so I didn't feel comfortable removing it outright.

Copy link
Member

Choose a reason for hiding this comment

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

Okay... 🤞

When we removed compat for functools.wraps, we broke a few packages. Let's hope that won't repeat.

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

4 participants