Bug 2050148 - python-sphinxcontrib-bibtex fails to build with Python 3.11: ValueError: mutable default <class 'pybtex.richtext.Text'> for field other is not allowed: use default_factory
Summary: python-sphinxcontrib-bibtex fails to build with Python 3.11: ValueError: muta...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-sphinxcontrib-bibtex
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2022-02-03 11:01 UTC by Tomáš Hrnčiar
Modified: 2022-05-07 04:21 UTC (History)
3 users (show)

Fixed In Version: python-sphinxcontrib-bibtex-2.4.1-3.fc36 python-sphinxcontrib-bibtex-2.4.2-1.fc36
Clone Of:
Environment:
Last Closed: 2022-05-07 04:21:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github mcmtroffaes sphinxcontrib-bibtex issues 284 0 None open Python 3.11 is pickier about mutable dataclass fields 2022-02-04 02:09:26 UTC

Description Tomáš Hrnčiar 2022-02-03 11:01:55 UTC
python-sphinxcontrib-bibtex fails to build with Python 3.11.0a4.

==================================== ERRORS ====================================
____________________ ERROR collecting test/test_citation.py ____________________
test/test_citation.py:5: in <module>
    import sphinxcontrib.bibtex.plugin
../../BUILDROOT/python-sphinxcontrib-bibtex-2.4.1-2.fc36.x86_64/usr/lib/python3.11/site-packages/sphinxcontrib/bibtex/__init__.py:9: in <module>
    from .domain import BibtexDomain
../../BUILDROOT/python-sphinxcontrib-bibtex-2.4.1-2.fc36.x86_64/usr/lib/python3.11/site-packages/sphinxcontrib/bibtex/domain.py:44: in <module>
    from .style.referencing import (
../../BUILDROOT/python-sphinxcontrib-bibtex-2.4.1-2.fc36.x86_64/usr/lib/python3.11/site-packages/sphinxcontrib/bibtex/style/referencing/__init__.py:121: in <module>
    ???
/usr/lib64/python3.11/dataclasses.py:1187: in dataclass
    return wrap(cls)
/usr/lib64/python3.11/dataclasses.py:1178: in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
/usr/lib64/python3.11/dataclasses.py:958: in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
/usr/lib64/python3.11/dataclasses.py:815: in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
E   ValueError: mutable default <class 'pybtex.richtext.Text'> for field other is not allowed: use default_factory
____________________ ERROR collecting test/test_footcite.py ____________________
test/test_footcite.py:6: in <module>
    from sphinxcontrib.bibtex.style.referencing import BracketStyle, PersonStyle
../../BUILDROOT/python-sphinxcontrib-bibtex-2.4.1-2.fc36.x86_64/usr/lib/python3.11/site-packages/sphinxcontrib/bibtex/style/referencing/__init__.py:121: in <module>
    ???
/usr/lib64/python3.11/dataclasses.py:1187: in dataclass
    return wrap(cls)
/usr/lib64/python3.11/dataclasses.py:1178: in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
/usr/lib64/python3.11/dataclasses.py:958: in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
/usr/lib64/python3.11/dataclasses.py:815: in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
E   ValueError: mutable default <class 'pybtex.richtext.Text'> for field other is not allowed: use default_factory
_____________________ ERROR collecting test/test_style.py ______________________
test/test_style.py:8: in <module>
    from sphinxcontrib.bibtex.style.referencing import (
../../BUILDROOT/python-sphinxcontrib-bibtex-2.4.1-2.fc36.x86_64/usr/lib/python3.11/site-packages/sphinxcontrib/bibtex/style/referencing/__init__.py:121: in <module>
    ???
/usr/lib64/python3.11/dataclasses.py:1187: in dataclass
    return wrap(cls)
/usr/lib64/python3.11/dataclasses.py:1178: in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
/usr/lib64/python3.11/dataclasses.py:958: in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
/usr/lib64/python3.11/dataclasses.py:815: in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
E   ValueError: mutable default <class 'pybtex.richtext.Text'> for field other is not allowed: use default_factory
____________________ ERROR collecting test/test_template.py ____________________
test/test_template.py:1: in <module>
    from sphinxcontrib.bibtex.style.referencing import join, sentence
../../BUILDROOT/python-sphinxcontrib-bibtex-2.4.1-2.fc36.x86_64/usr/lib/python3.11/site-packages/sphinxcontrib/bibtex/style/referencing/__init__.py:121: in <module>
    ???
/usr/lib64/python3.11/dataclasses.py:1187: in dataclass
    return wrap(cls)
/usr/lib64/python3.11/dataclasses.py:1178: in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
/usr/lib64/python3.11/dataclasses.py:958: in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
/usr/lib64/python3.11/dataclasses.py:815: in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
E   ValueError: mutable default <class 'pybtex.richtext.Text'> for field other is not allowed: use default_factory
=========================== short test summary info ============================
ERROR test/test_citation.py - ValueError: mutable default <class 'pybtex.rich...
ERROR test/test_footcite.py - ValueError: mutable default <class 'pybtex.rich...
ERROR test/test_style.py - ValueError: mutable default <class 'pybtex.richtex...
ERROR test/test_template.py - ValueError: mutable default <class 'pybtex.rich...
!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 4 errors in 0.43s ===============================

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/03272610-python-sphinxcontrib-bibtex/

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

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 Jerry James 2022-02-04 02:08:54 UTC
I have done a successful build in Rawhide with an experimental patch.  I'm not sure if upstream will find the patch palatable or will want to take a different course.  Upstream bug report: https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/284.

Comment 2 Ben Cotton 2022-02-08 20:16:44 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 3 Fedora Update System 2022-04-10 23:03:15 UTC
FEDORA-2022-b20e86c976 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-b20e86c976

Comment 4 Fedora Update System 2022-04-11 14:57:23 UTC
FEDORA-2022-b20e86c976 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-b20e86c976`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-b20e86c976

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2022-05-07 04:21:44 UTC
FEDORA-2022-b20e86c976 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.