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
Conversation
3528641
to
ac146b0
Compare
Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
ac146b0
to
1b87d35
Compare
I didn't touch |
Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
Not touching it is a wise choice. 😆 |
1b87d35
to
4977f6e
Compare
There was a problem hiding this 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.
It's used in |
@@ -61,15 +78,3 @@ def override__dir__wrapper(self): | |||
return sorted(members) | |||
|
|||
return override__dir__wrapper | |||
|
|||
|
|||
def namedtuple_asdict(namedtuple): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.
Extra CI
label.no-changelog-entry-needed
label. If this is a manual backport, use theskip-changelog-checks
label unless special changelog handling is necessary.astropy-bot
check might be missing; do not let the green checkmark fool you.backport-X.Y.x
label(s) before merge.