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

Fix ast deprecations for 3.12 #257

Closed
wants to merge 3 commits into from
Closed

Fix ast deprecations for 3.12 #257

wants to merge 3 commits into from

Conversation

cdce8p
Copy link

@cdce8p cdce8p commented Aug 6, 2023

ast.Str and ast.Num have been deprecated since Python 3.8. Starting with 3.12, they will now emit DeprecationWarnings. Replace them with calls to ast.Constant for Python 3.8+.

An alternative would be to drop support for Python 3.7.

DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead
DeprecationWarning: ast.Num is deprecated and will be removed in Python 3.14; use ast.Constant instead

https://docs.python.org/3.12/library/ast.html#ast.AST

@cdce8p
Copy link
Author

cdce8p commented Aug 7, 2023

The lint errors where a result of the recent pycodestyle==2.11.0 release.

For coverage, I chose to ignore all Python 3.7 branches. The report is generated with Python 3.8 currently, so those will never match. An alternative would be to rewrite the CI config to generate partial coverage results for each Python version and combine them in a later step. Not sure that's worth it though. Could also still be done at a later point.

@dataflake
Copy link
Member

In order to accept your contribution please sign our contributor agreement: https://zope.dev/developer/becoming-a-committer.html

@cdce8p
Copy link
Author

cdce8p commented Aug 7, 2023

In order to accept your contribution please sign our contributor agreement: https://zope.dev/developer/becoming-a-committer.html

I'm sorry I won't sign it just for a simple PR like this one. The PR doesn't do anything unique that would be protected anyway. Feel free to use it or don't, your call. For what it's worth, consider any changes in this PR to be public domain or CC0-1.0-Universal licensed.

@dataflake
Copy link
Member

Superceded by #259

@dataflake dataflake closed this Aug 26, 2023
@cdce8p cdce8p deleted the fix-deprecation branch August 26, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants