Bug 2192904 - python-faker fails to build with Python 3.12: E Failed: DID NOT RAISE <class 'TypeError'>
Summary: python-faker fails to build with Python 3.12: E Failed: DID NOT RAISE <class ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-faker
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Juan Orti Alcaine
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2023-05-03 13:04 UTC by Tomáš Hrnčiar
Modified: 2023-06-21 13:33 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-06-21 13:33:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2023-05-03 13:04:54 UTC
python-faker fails to build with Python 3.12.0a7.


=================================== FAILURES ===================================
__________________ TestFakerProxyClass.test_seed_classmethod ___________________

self = <tests.test_proxy.TestFakerProxyClass object at 0x7f50b7d59f40>

    def test_seed_classmethod(self):
        fake = Faker()
    
        # Verify `seed()` is not callable from a class instance
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE <class 'TypeError'>

tests/test_proxy.py:122: Failed
___________ TestFakerProxyClass.test_multiple_locale_proxy_behavior ____________

self = <tests.test_proxy.TestFakerProxyClass object at 0x7f50b7d59160>

    def test_multiple_locale_proxy_behavior(self):
        fake = Faker(["de-DE", "en-US", "en-PH", "ja-JP"])
    
        # `Generator` attributes are not implemented
        for attr in fake.generator_attrs:
            with pytest.raises(NotImplementedError):
                getattr(fake, attr)
    
        # The `random` getter is not implemented
        with pytest.raises(NotImplementedError):
>           random = fake.random

tests/test_proxy.py:220: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:110: in __getattr__
    if len(self._factories) == 1:
../../BUILDROOT/python-faker-18.3.1-1.fc39.x86_64/usr/lib/python3.12/site-packages/faker/proxy.py:119: in __getattr__
    factory = self._select_factory(attr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <faker.proxy.Faker object at 0x7f50b835ee40>, method_name = '_factories'

    def _select_factory(self, method_name: str) -> Factory:
        """
        Returns a random factory that supports the provider method
    
        :param method_name: Name of provider method
        :return: A factory that supports the provider method
        """
    
        factories, weights = self._map_provider_method(method_name)
    
        if len(factories) == 0:
            msg = f"No generator object has attribute {method_name!r}"
>           raise AttributeError(msg)
E           AttributeError: No generator object has attribute '_factories'. Did you mean: 'factories'?

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/05839471-python-faker/

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

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 1 Juan Orti Alcaine 2023-06-21 13:33:32 UTC
Latest version python-faker-18.11.1-1.fc39.x86_64 passes the tests using Python 3.12.0b3


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