Bug 2328023

Summary: python-pygit2 fails to build with Python 3.14: TypeError: 'GenericIterator' object is not iterable
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-pygit2Assignee: Pete Walter <walter.pete>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: i, igor.raits, infra-sig, ksurma, mhroncok, nphilipp, pingou, sgallagh, walter.pete
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-pygit2-1.16.0-2.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-01-09 10:38:00 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: 2322407    

Description Karolina Surma 2024-11-22 12:03:48 UTC
python-pygit2 fails to build with Python 3.14.0a2.

__________________________________ test_iter ___________________________________

testrepo = pygit2.Repository('/tmp/pytest-of-mockbuild/pytest-0/test_iter0/testrepo/.git/')

    def test_iter(testrepo):
        index = testrepo.index
        n = len(index)
        assert len(list(index)) == n
    
        # Compare SHAs, not IndexEntry object identity
        entries = [index[x].id for x in range(n)]
>       assert list(x.id for x in index) == entries

test/test_index.py:167: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

.0 = <pygit2.utils.GenericIterator object at 0x7f04ee11e970>

>   assert list(x.id for x in index) == entries
E   TypeError: 'GenericIterator' object is not iterable

test/test_index.py:167: TypeError
_______________________________ test_bare_index ________________________________

testrepo = pygit2.Repository('/tmp/pytest-of-mockbuild/pytest-0/test_bare_index0/testrepo/.git/')

    def test_bare_index(testrepo):
        index = pygit2.Index(Path(testrepo.path) / 'index')
>       assert [x.id for x in index] == [x.id for x in testrepo.index]
E       TypeError: 'GenericIterator' object is not iterable

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08292407-python-pygit2/

For all our attempts to build python-pygit2 with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-pygit2/

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

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Miro Hrončok 2024-11-22 12:31:14 UTC
See also https://bugs.debian.org/1087432 which suggests this might not be Python 3.14 specific.

> It looks like it worked with 3.13 final (3.13.0-1) but it broke after the Debian
> package updated to the 3.13 branch from 2024-11-12 (3.13.0-2).  My guess is this
> commit [1] resulted in the generator expression now requiring the __iter__()
> method to be defined, causing the test failure we see here.
> 
> - Fay
> 
> [1] https://github.com/python/cpython/commit/bcc7227ef7fd21aa48c8f1c57922e8beced5737c

Comment 2 Nils Philippsen 2025-01-09 09:58:29 UTC
I can confirm that pygit2 version 1.16.0 doesn’t mock-build with Python 3.13.1 on Fedora 41.

Comment 3 Fedora Update System 2025-01-09 10:34:57 UTC
FEDORA-2025-7feb4f9692 (python-pygit2-1.16.0-2.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-7feb4f9692

Comment 4 Fedora Update System 2025-01-09 10:38:00 UTC
FEDORA-2025-7feb4f9692 (python-pygit2-1.16.0-2.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.