Bug 2040164

Summary: python-pyrsistent fails to build with Python 3.11: pyrsistent/_pmap.py:216: DocTestFailure
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-pyrsistentAssignee: Ben Beasley <code>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: code, devrim, mhroncok, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-pyrsistent-0.18.0-10.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-13 15:01:51 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: 2016048    

Description Tomáš Hrnčiar 2022-01-13 07:04:30 UTC
python-pyrsistent fails to build with Python 3.11.0a3.

=================================== FAILURES ===================================
____________________ [doctest] pyrsistent._pmap.PMap.update ____________________
211 
212         Return a new PMap with the items in Mappings inserted. If the same key is present in multiple
213         maps the rightmost (last) value is inserted.
214 
215         >>> m1 = m(a=1, b=2)
216         >>> m1.update(m(a=2, c=3), {'a': 17, 'd': 35})
Expected:
    pmap({'c': 3, 'b': 2, 'a': 17, 'd': 35})
Got:
    pmap({'d': 35, 'c': 3, 'b': 2, 'a': 17})

/builddir/build/BUILD/pyrsistent-0.18.0/pyrsistent/_pmap.py:216: DocTestFailure
=========================== short test summary info ============================
FAILED pyrsistent/_pmap.py::pyrsistent._pmap.PMap.update
========================= 1 failed, 79 passed in 0.12s =========================

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/03146641-python-pyrsistent/

For all our attempts to build python-pyrsistent with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-pyrsistent/

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

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
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 Ben Beasley 2022-01-13 14:43:07 UTC
Thanks. I’ve submitted this upstream as https://github.com/tobgu/pyrsistent/issues/238.

The root cause is probably a change in the order of entries in pyrsistent’s map type, probably due to a change in string hashing in 3.11a3 (https://docs.python.org/3.11/whatsnew/3.11.html#other-cpython-implementation-changes).

Until upstream has decided on a solution, I’ll skip the affected doctest.

Comment 2 Fedora Update System 2022-01-13 14:59:56 UTC
FEDORA-2022-b7f546b90e has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-b7f546b90e

Comment 3 Fedora Update System 2022-01-13 15:01:51 UTC
FEDORA-2022-b7f546b90e has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Ben Beasley 2022-01-14 20:14:49 UTC
A PR is now merged upstream for this: https://github.com/tobgu/pyrsistent/pull/239

I’ll update the Fedora package to use that PR as a patch, rather than skipping the affected doctests.

Comment 5 Ben Beasley 2022-01-14 20:19:21 UTC
The fix is also now released in pyrsistent 0.18.1.