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

Use type-level deprecations #1389

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Use type-level deprecations #1389

merged 1 commit into from
Jan 9, 2025

Conversation

alex
Copy link
Member

@alex alex commented Jan 7, 2025

No description provided.

@alex alex force-pushed the deprecate branch 3 times, most recently from e6ee7d9 to 2343763 Compare January 7, 2025 14:15
mhils
mhils previously approved these changes Jan 7, 2025
Copy link
Member

@mhils mhils left a comment

Choose a reason for hiding this comment

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

Much nicer, thanks! 🍰

LGTM % CI errors.

@alex alex force-pushed the deprecate branch 2 times, most recently from 01b4a33 to c424333 Compare January 7, 2025 16:01
@alex
Copy link
Member Author

alex commented Jan 7, 2025

Last challenge here: not compatible with python 3.7.

3.7 is currently about 10% of our downloads. OTOH, it's been unsupported by upstream for 18 months...

@mhils
Copy link
Member

mhils commented Jan 7, 2025

How about something like this?

if sys.version_info >= (3, 13):
    from warnings import deprecated
elif sys.version_info < (3, 8):
    def deprecated(msg, **_):
        return lambda f: f
else:
    from typing_extensions import deprecated

3.7 users won't get deprecation warnings then, but that probably is the least of their concerns...

@alex
Copy link
Member Author

alex commented Jan 7, 2025

Hmm, it works, but it also makes it a regression on 3.7, since we currently warn... annoying...

@alex alex force-pushed the deprecate branch 4 times, most recently from a964259 to 454953f Compare January 9, 2025 19:39
@mhils mhils merged commit 1b2b0ed into pyca:main Jan 9, 2025
40 checks passed
@alex alex deleted the deprecate branch January 9, 2025 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants