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

ast.NameConstant, ast.Str,ast.Num is deprecated and will be removeed from Python 3.14 #419

Closed
2 tasks
hroncok opened this issue Oct 17, 2024 · 0 comments · Fixed by #420
Closed
2 tasks

Comments

@hroncok
Copy link
Contributor

hroncok commented Oct 17, 2024

What happened? What is the problem?

pytest lets me know:

specfile/formatter.py:32: DeprecationWarning: ast.NameConstant is deprecated and will be removed in Python 3.14; use ast.Constant instead
    if isinstance(node, (ast.Constant, ast.NameConstant)):

specfile/formatter.py:34: DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead
    elif isinstance(node, ast.Str):

specfile/formatter.py:36: DeprecationWarning: ast.Num is deprecated and will be removed in Python 3.14; use ast.Constant instead
    elif isinstance(node, ast.Num):

This has already been removed from Python 3.14.0a1.

If you still need to support Python 3.6 and 3.7 (out of life upstream), you might need to guard this by an if, like here: pypa/flit#684

What did you expect to happen?

No DeprecationWarnings

Example URL(s)

No response

Steps to reproduce

run code that uses specfile via pytest

Workaround

  • There is an existing workaround that can be used until this issue is fixed.

Participation

  • I am willing to submit a pull request for this issue. (Packit team is happy to help!)
@nforro nforro moved this from new to in-review in Packit Kanban Board Oct 17, 2024
softwarefactory-project-zuul bot added a commit that referenced this issue Oct 17, 2024
Handle constants deprecated in Python 3.8

Fixes #419.

Reviewed-by: Matej Focko
Reviewed-by: Nikola Forró
@github-project-automation github-project-automation bot moved this from in-review to done in Packit Kanban Board Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant