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

Python 3.14 compatibility issues #158

Closed
sharkcz opened this issue Oct 31, 2024 · 5 comments · Fixed by #160
Closed

Python 3.14 compatibility issues #158

sharkcz opened this issue Oct 31, 2024 · 5 comments · Fixed by #160

Comments

@sharkcz
Copy link

sharkcz commented Oct 31, 2024

As found by the Fedora Python maintainers during their preparation for Python 3.14, the changes from PR #146 are not sufficient to resolve the depreciated ast module usage. Please see https://bugzilla.redhat.com/show_bug.cgi?id=2322707 for the full details. The report says

python-simpleeval fails to build with Python 3.14.0a1.

The AttributeError is repeated 100x.:

======================================================================
ERROR: test_trailing (__main__.TestWhitespace.test_trailing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-simpleeval-1.0.1-build/simpleeval-1.0.1/test_simpleeval.py", line 40, in setUp
    self.s = SimpleEval()
             ~~~~~~~~~~^^
  File "/builddir/build/BUILD/python-simpleeval-1.0.1-build/simpleeval-1.0.1/simpleeval.py", line 389, in __init__
    if Num := getattr(ast, "Num"):
              ~~~~~~~^^^^^^^^^^^^
AttributeError: module 'ast' has no attribute 'Num'

======================================================================
FAIL: test_simpleeval_cleanup (__main__.TestReferenceCleanup.test_simpleeval_cleanup)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-simpleeval-1.0.1-build/simpleeval-1.0.1/test_simpleeval.py", line 1318, in tearDown
    self.assertEqual(self._initial_garbage_len, self._final_garbage_len)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 331 != 348

According to: https://docs.python.org/dev/whatsnew/3.14.html#id2
...
@danthedeckie
Copy link
Owner

Thanks for flagging this @sharkcz - I'll try and work on it this week.

@danthedeckie
Copy link
Owner

@sharkcz -

https://pypi.org/project/simpleeval/1.0.3/

Should fix those warnings now?

@sharkcz
Copy link
Author

sharkcz commented Nov 2, 2024

Thanks, will give it a try and report back.

@sharkcz
Copy link
Author

sharkcz commented Nov 4, 2024

I have updated the Fedora package to 1.0.3 and it looks good now, please see https://copr.fedorainfracloud.org/coprs/g/python/python3.14/build/8205961/ for details.

@danthedeckie
Copy link
Owner

Thankyou @sharkcz !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants