Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1716491 - python-cerberus fails to build with Python 3.8
Summary: python-cerberus fails to build with Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-cerberus
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL: https://copr.fedorainfracloud.org/cop...
Whiteboard:
Depends On:
Blocks: PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-06-03 14:37 UTC by Miro Hrončok
Modified: 2019-08-21 10:35 UTC (History)
3 users (show)

Fixed In Version: python-cerberus-1.3.1-2.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-21 10:35:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pyeve cerberus issues 504 0 None closed Cerberus tests fail under Python 3.8 2020-07-30 15:03:32 UTC

Description Miro Hrončok 2019-06-03 14:37:50 UTC
See https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/python-cerberus/ for actual logs. This report is automated and not very verbose, but feel free to ping me for help.

Comment 1 Miro Hrončok 2019-07-10 12:50:53 UTC
______________________________ test_nested_oneofs ______________________________

validator = <cerberus.validator.Validator object at 0x7ff323303880>

    def test_nested_oneofs(validator):
>       validator.schema = {'abc': {
            'type': 'dict',
            'oneof_schema': [
                {'foo': {
                    'type': 'dict',
                    'schema': {'bar': {'oneof_type': ['integer', 'float']}}
                }},
                {'baz': {'type': 'string'}}
            ]}}

cerberus/tests/test_validation.py:1312: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cerberus/validator.py:509: in schema
    self._schema = DefinitionSchema(self, schema)
cerberus/schema.py:69: in __init__
    self.validate(schema)
cerberus/schema.py:197: in validate
    self._validate(schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <[AttributeError("'DefinitionSchema' object has no attribute 'schema'") raised in repr()] DefinitionSchema object at 0x7ff32331c910>
schema = {'abc': {'oneof': [{'schema': {'foo': {'schema': {...}, 'type': 'dict'}}}, {'schema': {'baz': {'type': 'string'}}}], 'type': 'dict'}}

    def _validate(self, schema):
        """ Validates a schema that defines rules against supported rules.
    
        :param schema: The schema to be validated as a legal cerberus schema
                       according to the rules of this Validator object.
        """
        if isinstance(schema, _str_type):
            schema = self.validator.schema_registry.get(schema, schema)
    
        if schema is None:
            raise SchemaError(errors.SCHEMA_ERROR_MISSING)
    
        schema = copy(schema)
        for field in schema:
            if isinstance(schema[field], _str_type):
                schema[field] = rules_set_registry.get(schema[field],
                                                       schema[field])
    
        if not self.schema_validator(schema, normalize=False):
>           raise SchemaError(self.schema_validator.errors)
E           cerberus.schema.SchemaError: {'abc': [{'oneof': [{'schema': ['no definitions validate', {'anyof definition 0': [{'foo': [{'schema': ['no definitions validate', {'anyof definition 0': [{'bar': [{'oneof_type': ['unknown rule']}]}], 'anyof definition 1': [{'bar': ['unknown rule']}]}]}]}], 'anyof definition 1': [{'foo': ['unknown rule']}]}]}]}]}

cerberus/schema.py:219: SchemaError

Comment 2 Igor Raits 2019-07-28 14:44:55 UTC
I think this has been fixed in latest release (1.3.1) which is building in rawhide now.

Comment 3 Miro Hrončok 2019-07-29 17:43:47 UTC
______________________________ test_nested_oneofs ______________________________

validator = <cerberus.validator.Validator object at 0x7f6ccf22a0a0>

    def test_nested_oneofs(validator):
>       validator.schema = {
            'abc': {
                'type': 'dict',
                'oneof_schema': [
                    {
                        'foo': {
                            'type': 'dict',
                            'schema': {'bar': {'oneof_type': ['integer', 'float']}},
                        }
                    },
                    {'baz': {'type': 'string'}},
                ],
            }
        }

cerberus/tests/test_validation.py:1522: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cerberus/validator.py:562: in schema
    self._schema = DefinitionSchema(self, schema)
cerberus/schema.py:82: in __init__
    self.validate(schema)
cerberus/schema.py:259: in validate
    self._validate(schema)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <[AttributeError("'DefinitionSchema' object has no attribute 'schema'") raised in repr()] DefinitionSchema object at 0x7f6ccf22acd0>
schema = {'abc': {'oneof': [{'schema': {'foo': {'schema': {...}, 'type': 'dict'}}}, {'schema': {'baz': {'type': 'string'}}}], 'type': 'dict'}}

    def _validate(self, schema):
        if isinstance(schema, _str_type):
            schema = self.validator.schema_registry.get(schema, schema)
    
        if schema is None:
            raise SchemaError(errors.SCHEMA_ERROR_MISSING)
    
        schema = copy(schema)
        for field in schema:
            if isinstance(schema[field], _str_type):
                schema[field] = rules_set_registry.get(schema[field], schema[field])
    
        if not self.schema_validator(schema, normalize=False):
>           raise SchemaError(self.schema_validator.errors)
E           cerberus.schema.SchemaError: {'abc': [{'oneof': [{'schema': ['no definitions validate', {'anyof definition 0': [{'foo': [{'schema': ['no definitions validate', {'anyof definition 0': [{'bar': [{'oneof_type': ['unknown rule']}]}], 'anyof definition 1': [{'bar': ['unknown rule']}]}]}]}], 'anyof definition 1': [{'foo': ['unknown rule']}]}]}]}]}

cerberus/schema.py:275: SchemaError

Comment 4 Igor Raits 2019-07-29 17:55:04 UTC
https://github.com/pyeve/cerberus/issues/504

Comment 5 Lumír Balhar 2019-08-10 15:48:28 UTC
The issue is fixed. Now it depends whether we want to use the patch downstream or wait for the 1.3.2 release.

Comment 6 Ben Cotton 2019-08-13 16:55:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 7 Ben Cotton 2019-08-13 17:10:17 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 8 Miro Hrončok 2019-08-13 17:21:22 UTC
Python 3.8 will happen in Fedora 32, changing back to rawhide.

Comment 9 Miro Hrončok 2019-08-14 22:24:43 UTC
The coordinated rebuild of Python 3.8 has started in the `f32-python` side tag.

If you figure out how to rebuild this package, please don't rebuild it in regular rawhide, but use the side tag instead:

    on branch master:
    $ fedpkg build --target=f32-python

To wait for a build to show up in the side tag, do:

    $ koji wait-repo f32-python --build=<nvr>

Where <nvr> is name-version-release of the source package, e.g. python-foo-1.1-2.fc32.

An updated mock config is posted at:
http://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Note that it will take a while before the essential packages are rebuilt, so don't expect all your dependencies to be available right away.

Thanks. Let us know if you need up to date info, or if you have any questions.



PS this message is mass posted to all the bugs that block the PYTHON38 bug. If this is also a Fedora 31 FTBFS bug and you manage to fix it, you can do a f31 build as usual:

    on branch f31:
    $ fedpkg build

Comment 10 Patrik Kopkan 2019-08-20 12:32:51 UTC
Will be fixed at 1.3.2 https://github.com/pyeve/cerberus/issues/504#issuecomment-520155112

Comment 11 Miro Hrončok 2019-08-21 10:35:21 UTC
Fix backported.


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