Bug 2283503

Summary: python-executing fails to build with Python 3.13: multiple test suite failures
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-executingAssignee: Roman Inflianskas <rominf>
Status: CLOSED RAWHIDE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: epel-packagers-sig, ksurma, lbalhar, mhroncok, paul.wouters, rominf, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-09-03 19:16:48 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: 2260875, 2244836    

Description Karolina Surma 2024-05-27 13:56:25 UTC
python-executing fails to build with Python 3.13.0b1.
=========================== short test summary info ============================
FAILED tests/test_main.py::test_small_samples[0126981e43aec288449c540bef895abc32c6046ac22095919e1a1564ece7160b.py]
FAILED tests/test_main.py::test_small_samples[0675309754ba4277c9cb3c52d7131377fe69c7744a271e2b7471917dabb5aaa1.py]
FAILED tests/test_main.py::test_small_samples[289bcf3ad1de1e72dab056250fe9516668937d7d9c55be773acd60a8f05c4318.py]
FAILED tests/test_main.py::test_small_samples[2ad55a93b62d942e84a4ec6cf3385da73bfe13a70739c8b6e21d6917cdf54142.py]
FAILED tests/test_main.py::test_small_samples[318c09f5abc7ace5b69c55380616ebf1cc984e6c365ff8d9f021725eabbe02ae.py]
FAILED tests/test_main.py::test_small_samples[3946430f5c3048d7d85d5424c4fcb541db50c9c41d5653c977e974351b2f6bc9.py]
FAILED tests/test_main.py::test_small_samples[42a37b8a823eb2e510b967332661afd679c82c60b7177b992a47c16d81117c8a.py]
FAILED tests/test_main.py::test_small_samples[437c7cbd0809c59a17c3928b83eb0a4f2c23aeef11417cdadea9bdefe77c318a.py]
FAILED tests/test_main.py::test_small_samples[46597f8f896f11c5d7f432236344cc7e5645c2a39836eb6abdd2437c0422f0f4.py]
FAILED tests/test_main.py::test_small_samples[508ccd0dcac13ecee6f0cea939b73ba5319c780ddbb6c496be96fe5614871d4a.py]
FAILED tests/test_main.py::test_small_samples[524a7a805db753f5ea998182ddaea49a177b75a7ae88ab77eaa879755857a15a.py]
FAILED tests/test_main.py::test_small_samples[736316309812e0ca8306cb7eec4c20d75f8e3c45cab3cd46cf4370524ada6823.py]
FAILED tests/test_main.py::test_small_samples[7532e0e7ee9c85347bb4bfcc8751604bf934d3e96e48f3bc8b5778d7856d5a7e.py]
FAILED tests/test_main.py::test_small_samples[8519155d8a424c7cbc4bc15042d50c3193688c600ac9552f9503672e7c01b4d9.py]
FAILED tests/test_main.py::test_small_samples[8d7d8e2330522993cf517ba2f4191e01c336fb27bbbfa40815629432b96d74fa.py]
FAILED tests/test_main.py::test_small_samples[91f5b684f56b415a61d211027904e023f2371952602a8d71c17416d8fa3ceed7.py]
FAILED tests/test_main.py::test_small_samples[93f00cfd350495557ead44e2dd46ac4ce7d913f6e5d86ba1b0d5044cec188438.py]
FAILED tests/test_main.py::test_small_samples[LOAD_NAME_ast_AugAssign.py] - e...
FAILED tests/test_main.py::test_small_samples[a2389f211aec4c553b1cec683b416480636d7c13d10e8db50b5da567192ce42f.py]
FAILED tests/test_main.py::test_small_samples[cc6ef858e370019db11a9d07b4e6439b84ae021422241e69addc8a12b5b1a071.py]
FAILED tests/test_main.py::test_small_samples[dcf515466528197be9497b7a599fedb9ad7837e4c66d9356a426ce86c8742123.py]
FAILED tests/test_main.py::test_small_samples[e0d5430c6d9ee891b8adb6dc69d571ada7b1da181b905e47bc09bd291b90b3db.py]
FAILED tests/test_main.py::test_small_samples[f4962cd6e6b77f4f1d6f676de32f29200067bf3ac05c63e1d60ef2823b4d1b10.py]
FAILED tests/test_main.py::test_small_samples[fc6eb521024986baa84af2634f638e40af090be4aa70ab3c22f3d022e8068228.py]
FAILED tests/test_main.py::test_small_samples[load_deref.py] - executing.exec...
FAILED tests/test_main.py::test_small_samples[73d0fdb16164fc57d2dfc4fad6182f18b9c004a668645de8c14219daa546e2d1.py]
FAILED tests/test_pytest.py::test_mangled_name - AssertionError: assert {'Tes...
===== 27 failed, 163 passed, 15 skipped, 1 deselected, 1 warning in 10.37s =====

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/07477798-python-executing/

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

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 Roman Inflianskas 2024-06-03 14:12:29 UTC
There is a stale PR (https://github.com/alexmojaki/executing/pull/80) that adds the support for Python 3.13, probably it is possible to ask there what is missing, but I won't be available for another week, sorry.

Comment 2 Lumír Balhar 2024-06-04 08:34:51 UTC
I ping them in the PR. Unfortunately, the patch from the PR does not solve the issue.

Comment 4 Karolina Surma 2024-06-19 14:00:43 UTC
The build with tests in Koji failed with RecursionError happening in one of the tests:

_ test_small_samples[1656dc52edd2385921104de7bb255ca369713f4b8c034ebeba5cf946058109bc.py] _
full_filename = '/builddir/build/BUILD/python-executing-2.0.1-build/executing-2.0.1/tests/small_samples/1656dc52edd2385921104de7bb255ca369713f4b8c034ebeba5cf946058109bc.py'
result_filename = '/builddir/build/BUILD/python-executing-2.0.1-build/executing-2.0.1/tests/sample_results/1656dc52edd2385921104de7bb255ca369713f4b8c034ebeba5cf946058109bc-py-3.13.json'
    @pytest.mark.parametrize(
        "full_filename,result_filename", list(sample_files("small_samples"))
    )
    @pytest.mark.skipif(sys.version_info<(3,),reason="no 2.7 support")
    def test_small_samples(full_filename, result_filename):
        skip_sentinel = [
            "load_deref",
            "4851dc1b626a95e97dbe0c53f96099d165b755dd1bd552c6ca771f7bca6d30f5",
            "508ccd0dcac13ecee6f0cea939b73ba5319c780ddbb6c496be96fe5614871d4a",
            "fc6eb521024986baa84af2634f638e40af090be4aa70ab3c22f3d022e8068228",
            "42a37b8a823eb2e510b967332661afd679c82c60b7177b992a47c16d81117c8a",
            "206e0609ff0589a0a32422ee902f09156af91746e27157c32c9595d12072f92a",
        ]
    
        skip_annotations = [
            "d98e27d8963331b58e4e6b84c7580dafde4d9e2980ad4277ce55e6b186113c1d",
            "9b3db37076d3c7c76bdfd9badcc70d8047584433e1eea89f45014453d58bbc43",
        ]
    
        if any(s in full_filename for s in skip_sentinel) and sys.version_info < (3, 11):
            pytest.xfail("SentinelNodeFinder does not find some of the nodes (maybe a bug)")
    
        if any(s in full_filename for s in skip_annotations) and sys.version_info < (3, 7):
            pytest.xfail("no `from __future__ import annotations`")
    
        if (
            (sys.version_info[:2] == (3, 7))
            and "ad8aa993e6ee4eb5ee764d55f2e3fd636a99b2ecb8c5aff2b35fbb78a074ea30"
            in full_filename
        ):
            pytest.xfail("(i async for i in arange) can not be analyzed in 3.7")
    
        if (
            (sys.version_info[:2] == (3, 5) or PYPY)
            and "1656dc52edd2385921104de7bb255ca369713f4b8c034ebeba5cf946058109bc"
            in full_filename
        ):
            pytest.skip("recursion takes to long in 3.5")
    
>       TestFiles().check_filename(full_filename, check_names=True)
tests/test_main.py:743: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_main.py:825: in check_filename
    source = Source.for_filename(filename)
executing/executing.py:212: in for_filename
    return cls._for_filename_and_lines(filename, tuple(lines))
executing/executing.py:223: in _for_filename_and_lines
    result = source_cache[(filename, lines)] = cls(filename, lines)
executing/executing.py:163: in __init__
    self.tree = ast.parse(self.text, filename=filename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
source = "x = ('R0lGODlhigJnAef/AAABAAEEAAkCAAMGAg0GBAYJBQoMCBMODQ4QDRITEBkS'\n     +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmG...Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA'\n     +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7')\n"
filename = '/builddir/build/BUILD/python-executing-2.0.1-build/executing-2.0.1/tests/small_samples/1656dc52edd2385921104de7bb255ca369713f4b8c034ebeba5cf946058109bc.py'
mode = 'exec'
    def parse(source, filename='<unknown>', mode='exec', *,
              type_comments=False, feature_version=None, optimize=-1):
        """
        Parse the source into an AST node.
        Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
        Pass type_comments=True to get back type comments where the syntax allows.
        """
        flags = PyCF_ONLY_AST
        if optimize > 0:
            flags |= PyCF_OPTIMIZED_AST
        if type_comments:
            flags |= PyCF_TYPE_COMMENTS
        if feature_version is None:
            feature_version = -1
        elif isinstance(feature_version, tuple):
            major, minor = feature_version  # Should be a 2-tuple.
            if major != 3:
                raise ValueError(f"Unsupported major version: {major}")
            feature_version = minor
        # Else it should be an int giving the minor version for 3.x.
>       return compile(source, filename, mode, flags,
                       _feature_version=feature_version, optimize=optimize)
E       RecursionError: maximum recursion depth exceeded during ast construction
/usr/lib64/python3.13/ast.py:54: RecursionError
=========================== short test summary info ============================
FAILED tests/test_main.py::test_small_samples[1656dc52edd2385921104de7bb255ca369713f4b8c034ebeba5cf946058109bc.py]
====== 1 failed, 189 passed, 15 skipped, 1 deselected, 1 warning in 3.91s ======

Comment 5 Lumír Balhar 2024-09-03 19:16:48 UTC
The latest version supports Python 3.13.