Bug 2271058

Summary: sympy fails to build with Python 3.13: DeprecationWarning: Constant.__init__ got an unexpected keyword argument 'ctx'. Support for arbitrary keyword arguments is deprecated and will be removed in Python 3.15.
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: sympyAssignee: Jerry James <loganjerry>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cbm, ksurma, loganjerry, mhroncok, orion, susi.lehtola
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sympy-1.12-7.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-03-22 17:38:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2244836    

Description Karolina Surma 2024-03-22 13:21:02 UTC
sympy fails to build with Python 3.13.0a5.

____________ sympy/solvers/tests/test_solvers.py:test_base_0_exp_0 _____________
Traceback (most recent call last):
  File "/builddir/build/BUILD/sympy-sympy-1.12/sympy/solvers/tests/test_solvers.py", line 2197, in test_base_0_exp_0
    assert solve(S('x*(1/x**0 - x)', evaluate=False)) == \
                 ~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/sympy-sympy-1.12/sympy/core/sympify.py", line 495, in sympify
    expr = parse_expr(a, local_dict=locals, transformations=transformations, evaluate=evaluate)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/sympy-sympy-1.12/sympy/parsing/sympy_parser.py", line 1077, in parse_expr
    code = compile(evaluateFalse(code), '<string>', 'eval') # type: ignore
                   ~~~~~~~~~~~~~^^^^^^
  File "/builddir/build/BUILD/sympy-sympy-1.12/sympy/parsing/sympy_parser.py", line 1097, in evaluateFalse
    transformed_node = EvaluateFalseTransformer().visit(node)
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.13/ast.py", line 409, in visit
    return visitor(node)
           ~~~~~~~^^^^^^
  File "/usr/lib64/python3.13/ast.py", line 485, in generic_visit
    value = self.visit(value)
            ~~~~~~~~~~^^^^^^^
  File "/usr/lib64/python3.13/ast.py", line 409, in visit
    return visitor(node)
           ~~~~~~~^^^^^^
  File "/usr/lib64/python3.13/ast.py", line 494, in generic_visit
    new_node = self.visit(old_value)
               ~~~~~~~~~~^^^^^^^^^^^
  File "/usr/lib64/python3.13/ast.py", line 409, in visit
    return visitor(node)
           ~~~~~~~^^^^^^
  File "/builddir/build/BUILD/sympy-sympy-1.12/sympy/parsing/sympy_parser.py", line 1165, in visit_BinOp
    right = self.visit(node.right)
            ~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib64/python3.13/ast.py", line 409, in visit
    return visitor(node)
           ~~~~~~~^^^^^^
  File "/builddir/build/BUILD/sympy-sympy-1.12/sympy/parsing/sympy_parser.py", line 1166, in visit_BinOp
    left = self.visit(node.left)
           ~~~~~~~~~~^^^^^^^^^^^
  File "/usr/lib64/python3.13/ast.py", line 409, in visit
    return visitor(node)
           ~~~~~~~^^^^^^
  File "/builddir/build/BUILD/sympy-sympy-1.12/sympy/parsing/sympy_parser.py", line 1165, in visit_BinOp
    right = self.visit(node.right)
            ~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib64/python3.13/ast.py", line 409, in visit
    return visitor(node)
           ~~~~~~~^^^^^^
  File "/builddir/build/BUILD/sympy-sympy-1.12/sympy/parsing/sympy_parser.py", line 1202, in visit_BinOp
    keywords=[ast.keyword(arg='evaluate', value=ast.Constant(value=False, ctx=ast.Load()))],
                                                ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DeprecationWarning: Constant.__init__ got an unexpected keyword argument 'ctx'. Support for arbitrary keyword arguments is deprecated and will be removed in Python 3.15.

 tests finished: 927 passed, 77 skipped, 52 expected to fail, 
1 expected to fail but passed, 1 exceptions, in 392.46 seconds 

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07197936-sympy/

For all our attempts to build sympy with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/sympy/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Fedora Update System 2024-03-22 17:24:26 UTC
FEDORA-2024-80de62752e (sympy-1.12-7.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-80de62752e

Comment 2 Fedora Update System 2024-03-22 17:38:18 UTC
FEDORA-2024-80de62752e (sympy-1.12-7.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.