Bug 2189446

Summary: python-ruamel-yaml fails to build with Python 3.12: AssertionError: assert "ordereddict({'a': 1})" == "ordereddict([('a', 1)])"
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-ruamel-yamlAssignee: Chandan Kumar <chkumar>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: chkumar, code, jmontleo, maxwell, mhroncok, openstack-sig, smilner, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-ruamel-yaml-0.17.22-1.fc39 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-04 23:29:39 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: 2192464    
Bug Blocks: 2135404    

Description Tomáš Hrnčiar 2023-04-25 09:39:41 UTC
python-ruamel-yaml fails to build with Python 3.12.0a7.

=================================== FAILURES ===================================
_____________________ TestCommentedMapMerge.test_issue_60 ______________________

self = <test_comments.TestCommentedMapMerge object at 0x7f2abe725f10>

    def test_issue_60(self):
        data = round_trip_load("""
        x: &base
          a: 1
        y:
          <<: *base
        """)
        assert data['x']['a'] == 1
        assert data['y']['a'] == 1
>       assert str(data['y']) == """ordereddict([('a', 1)])"""
E       assert "ordereddict({'a': 1})" == "ordereddict([('a', 1)])"
E         - ordereddict([('a', 1)])
E         ?             ^^   ^   --
E         + ordereddict({'a': 1})
E         ?             ^   ^  +

_test/test_comments.py:520: AssertionError
____________________ TestCommentedMapMerge.test_issue_60_1 _____________________

self = <test_comments.TestCommentedMapMerge object at 0x7f2abe725df0>

    def test_issue_60_1(self):
        data = round_trip_load("""
        x: &base
          a: 1
        y:
          <<: *base
          b: 2
        """)
        assert data['x']['a'] == 1
        assert data['y']['a'] == 1
>       assert str(data['y']) == """ordereddict([('b', 2), ('a', 1)])"""
E       assert "ordereddict(...: 2, 'a': 1})" == "ordereddict(...), ('a', 1)])"
E         - ordereddict([('b', 2), ('a', 1)])
E         + ordereddict({'b': 2, 'a': 1})

_test/test_comments.py:532: AssertionError
___________________________ TestIssues.test_issue_61 ___________________________

self = <test_issues.TestIssues object at 0x7f2abe808fb0>

    def test_issue_61(self):
        s = dedent("""
        def1: &ANCHOR1
            key1: value1
        def: &ANCHOR
            <<: *ANCHOR1
            key: value
        comb:
            <<: *ANCHOR
        """)
        data = round_trip_load(s)
        assert str(data['comb']) == str(data['def'])
>       assert str(data['comb']) == "ordereddict([('key', 'value'), ('key1', 'value1')])"
E       assert "ordereddict(...': 'value1'})" == "ordereddict(..., 'value1')])"
E         - ordereddict([('key', 'value'), ('key1', 'value1')])
E         ?             ^^     ^        -  -      ^          --
E         + ordereddict({'key': 'value', 'key1': 'value1'})
E         ?             ^     ^                ^         +

_test/test_issues.py:30: AssertionError
=========================== short test summary info ============================
FAILED _test/test_comments.py::TestCommentedMapMerge::test_issue_60 - assert ...
FAILED _test/test_comments.py::TestCommentedMapMerge::test_issue_60_1 - asser...
FAILED _test/test_issues.py::TestIssues::test_issue_61 - assert "ordereddict(...
============= 3 failed, 390 passed, 5 skipped, 22 xfailed in 3.56s =============

gh-101446: Change repr of collections.OrderedDict to use regular dictionary formating instead of pairs of keys and values.

https://github.com/python/cpython/issues/101446
https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05840759-python-ruamel-yaml/

For all our attempts to build python-ruamel-yaml with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/python-ruamel-yaml/

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.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
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 2 Tomáš Hrnčiar 2023-05-04 08:06:18 UTC
Thank you!