Bug 2279990

Summary: python-pure-eval fails to build with Python 3.13: test_sys_modules: AssertionError
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-pure-evalAssignee: Lumír Balhar <lbalhar>
Status: CLOSED RAWHIDE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: epel-packagers-sig, ksurma, lbalhar, mhroncok, michel, python-packagers-sig
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-05-15 08:49:31 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-05-10 12:08:24 UTC
python-pure-eval fails to build with Python 3.13.0b1.


=================================== FAILURES ===================================
_______________________________ test_sys_modules _______________________________

    def test_sys_modules():
        modules = sys_modules_sources()
        if not os.environ.get('PURE_EVAL_SLOW_TESTS'):
            modules = islice(modules, 0, 3)
    
        for filename, source, tree in modules:
            print(filename)
            if not filename.endswith("ast.py"):
>               check_copy_ast_without_context(tree)

tests/test_utils.py:53: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

tree = <ast.Module object at 0x7f87699d70d0>

    def check_copy_ast_without_context(tree):
        tree2 = copy_ast_without_context(tree)
        dump1 = ast.dump(tree)
        dump2 = ast.dump(tree2)
        normalised_dump1 = re.sub(
            r", ctx=(Load|Store|Del)\(\)",
            "",
            dump1
        )
>       assert normalised_dump1 == dump2
E       assert "Module(body=...e__'))]))])])" == "Module(body=...e__'))]))])])"
E         Skipping 4274 identical leading characters in diff, use -v to show
E         - alue=List()), Assign(targets=[Attribute(value=Name(id='self'), attr='_iterating')], value=Call(func=Name(id='set'))), Assign(targets=[Attribute(value=Name(id='self'), attr='data')], value=Dict())]), FunctionDef(name='_commit_removals', args=arguments(args=[arg(arg='self')]), body=[Assign(targets=[Name(id='pop')], value=Attribute(value=Attribute(value=Name(id='self'), attr='_pending_removals'), attr='pop')), Assign(targets=[Name(id='d')], value=Attribute(value=Name(id='self'), attr='data')), While(test=C...
E         
E         ...Full output truncated (4 lines hidden), use '-vv' to show

tests/test_utils.py:65: AssertionError
FAILED tests/test_utils.py::test_sys_modules - assert "Module(body=...e__'))]...

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/07434127-python-pure-eval/

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

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 Lumír Balhar 2024-05-13 11:35:05 UTC
Reported upstream: https://github.com/alexmojaki/pure_eval/issues/16

Comment 2 Lumír Balhar 2024-05-15 08:49:31 UTC
Fixed in https://github.com/cloudpipe/cloudpickle/pull/534