Bug 2247024

Summary: python-oauthlib fails to build with Python 3.13: AssertionError: indentation of a docstring doesn't match
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-oauthlibAssignee: Fedora Infrastructure SIG <infra-sig>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 40CC: infra-sig, ksurma, mhroncok, mkelly, patrick
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-09-27 12:52:11 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 2023-10-30 12:19:39 UTC
python-oauthlib fails to build with Python 3.13.0a1.
________________________ UtilsTests.test_filter_params _________________________

self = <tests.oauth1.rfc5849.test_utils.UtilsTests testMethod=test_filter_params>

    def test_filter_params(self):
    
        # The following is an isolated test function used to test the filter_params decorator.
        @filter_params
        def special_test_function(params, realm=None):
            """ I am a special test function """
            return 'OAuth ' + ','.join(['='.join([k, v]) for k, v in params])
    
        # check that the docstring got through
>       self.assertEqual(special_test_function.__doc__, " I am a special test function ")
E       AssertionError: 'I am a special test function ' != ' I am a special test function '
E       - I am a special test function 
E       +  I am a special test function 
E       ? +

tests/oauth1/rfc5849/test_utils.py:60: AssertionError
=========================== short test summary info ============================
FAILED tests/oauth1/rfc5849/test_utils.py::UtilsTests::test_filter_params - A...


Compiler now strip indents from docstrings. This will reduce the size of bytecode cache (e.g. .pyc file). For example, cache file size for sqlalchemy.orm.session in SQLAlchemy 2.0 is reduced by about 5%. This change will affect tools using docstrings, like doctest. (Contributed by Inada Naoki in gh-81283.)

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/06573295-python-oauthlib/

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

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 Miro HronĨok 2023-10-30 12:24:14 UTC
I've proposed a fix in https://src.fedoraproject.org/rpms/python-oauthlib/pull-request/10 -- it has been built in our Copr as well, which is why some of the builds at https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-oauthlib/ are successful.

Comment 2 Aoife Moloney 2024-02-15 23:02:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.