Your message dated Sat, 01 Oct 2022 10:51:13 +0000
with message-id <e1oea5r-009efe...@fasolo.debian.org>
and subject line Bug#1019391: fixed in python-marshmallow-dataclass 8.5.8-3
has caused the Debian Bug report #1019391,
regarding python-typing-inspect breaks python-marshmallow-dataclass 
autopkgtest: TypeError: CustomTypeNoneValidator is not a dataclass
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1019391: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019391
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: python-typing-inspect, python-marshmallow-dataclass
Control: found -1 python-typing-inspect/0.8.0-1
Control: found -1 python-marshmallow-dataclass/8.5.8-2
Severity: serious
Tags: sid bookworm
User: debian...@lists.debian.org
Usertags: breaks needs-update

Dear maintainer(s),

With a recent upload of python-typing-inspect the autopkgtest of python-marshmallow-dataclass fails in testing when that autopkgtest is run with the binary packages of python-typing-inspect from unstable. It passes when run with only packages from testing. In tabular form:

                             pass            fail
python-typing-inspect        from testing    0.8.0-1
python-marshmallow-dataclass from testing    8.5.8-2
all others                   from testing    from testing

I copied some of the output at the bottom of this report.

Currently this regression is blocking the migration of python-typing-inspect to testing [1]. Due to the nature of this issue, I filed this bug report against both packages. Can you please investigate the situation and reassign the bug to the right package?

More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[1] https://qa.debian.org/excuses.php?package=python-typing-inspect

https://ci.debian.net/data/autopkgtest/testing/amd64/p/python-marshmallow-dataclass/25831906/log.gz

=================================== FAILURES =================================== ___________________ TestClassSchema.test_validator_stacking ____________________

class_or_instance = <function NewType.<locals>.new_type at 0x7f0b19be1990>

    def fields(class_or_instance):
        """Return a tuple describing the fields of this dataclass.
Accepts a dataclass or an instance of one. Tuple elements are of
        type Field.
        """
            # Might it be worth caching this, per class?
        try:
          fields = getattr(class_or_instance, _FIELDS)
E AttributeError: 'function' object has no attribute '__dataclass_fields__'

/usr/lib/python3.10/dataclasses.py:1197: AttributeError

During handling of the above exception, another exception occurred:

clazz = <function NewType.<locals>.new_type at 0x7f0b19be1990>
base_schema = None
clazz_frame = <frame at 0x55c027b54830, file '/tmp/autopkgtest-lxc.c9zyolii/downtmp/autopkgtest_tmp/tests/test_class_schema.py', line 319, code test_validator_stacking>

    @lru_cache(maxsize=MAX_CLASS_SCHEMA_CACHE_SIZE)
    def _internal_class_schema(
        clazz: type,
        base_schema: Optional[Type[marshmallow.Schema]] = None,
        clazz_frame: types.FrameType = None,
    ) -> Type[marshmallow.Schema]:
        _RECURSION_GUARD.seen_classes[clazz] = clazz.__name__
        try:
            # noinspection PyDataclass
          fields: Tuple[dataclasses.Field, ...] = dataclasses.fields(clazz)

/usr/lib/python3/dist-packages/marshmallow_dataclass/__init__.py:370: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
class_or_instance = <function NewType.<locals>.new_type at 0x7f0b19be1990>

    def fields(class_or_instance):
        """Return a tuple describing the fields of this dataclass.
Accepts a dataclass or an instance of one. Tuple elements are of
        type Field.
        """
            # Might it be worth caching this, per class?
        try:
            fields = getattr(class_or_instance, _FIELDS)
        except AttributeError:
          raise TypeError('must be called with a dataclass type or instance')
E           TypeError: must be called with a dataclass type or instance

/usr/lib/python3.10/dataclasses.py:1199: TypeError

During handling of the above exception, another exception occurred:

clazz = <function NewType.<locals>.new_type at 0x7f0b19be1990>
base_schema = None
clazz_frame = <frame at 0x55c027b54830, file '/tmp/autopkgtest-lxc.c9zyolii/downtmp/autopkgtest_tmp/tests/test_class_schema.py', line 319, code test_validator_stacking>

    @lru_cache(maxsize=MAX_CLASS_SCHEMA_CACHE_SIZE)
    def _internal_class_schema(
        clazz: type,
        base_schema: Optional[Type[marshmallow.Schema]] = None,
        clazz_frame: types.FrameType = None,
    ) -> Type[marshmallow.Schema]:
        _RECURSION_GUARD.seen_classes[clazz] = clazz.__name__
        try:
            # noinspection PyDataclass
fields: Tuple[dataclasses.Field, ...] = dataclasses.fields(clazz)
        except TypeError:  # Not a dataclass
            try:
                warnings.warn(
                    "****** WARNING ****** "
f"marshmallow_dataclass was called on the class {clazz}, which is not a dataclass. " "It is going to try and convert the class into a dataclass, which may have " "undesirable side effects. To avoid this message, make sure all your classes and " "all the classes of their fields are either explicitly supported by " "marshmallow_dataclass, or define the schema explicitly using " "field(metadata=dict(marshmallow_field=...)). For more information, see "

"https://github.com/lovasoa/marshmallow_dataclass/issues/51 "
                    "****** WARNING ******"
                )
              created_dataclass: type = dataclasses.dataclass(clazz)

/usr/lib/python3/dist-packages/marshmallow_dataclass/__init__.py:384: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <function NewType.<locals>.new_type at 0x7f0b19be1990>

def dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False,
                  unsafe_hash=False, frozen=False, match_args=True,
                  kw_only=False, slots=False):
        """Returns the same class as was passed in, with dunder methods
        added based on the fields defined in the class.
            Examines PEP 526 __annotations__ to determine fields.
            If init is true, an __init__() method is added to the class. If
        repr is true, a __repr__() method is added. If order is true, rich
        comparison dunder methods are added. If unsafe_hash is true, a
        __hash__() method function is added. If frozen is true, fields may
        not be assigned to after instance creation. If match_args is true,
        the __match_args__ tuple is added. If kw_only is true, then by
        default all fields are keyword-only. If slots is true, an
        __slots__ attribute is added.
        """
            def wrap(cls):
            return _process_class(cls, init, repr, eq, order, unsafe_hash,
                                  frozen, match_args, kw_only, slots)
            # See if we're being called as @dataclass or @dataclass().
        if cls is None:
            # We're called with parens.
            return wrap
            # We're called as @dataclass without parens.
      return wrap(cls)

/usr/lib/python3.10/dataclasses.py:1185: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <function NewType.<locals>.new_type at 0x7f0b19be1990>

    def wrap(cls):
      return _process_class(cls, init, repr, eq, order, unsafe_hash,
                              frozen, match_args, kw_only, slots)

/usr/lib/python3.10/dataclasses.py:1176: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <function NewType.<locals>.new_type at 0x7f0b19be1990>, init = True
repr = True, eq = True, order = False, unsafe_hash = False, frozen = False
match_args = True, kw_only = False, slots = False

    def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
                       match_args, kw_only, slots):
        # Now that dicts retain insertion order, there's no reason to use
        # an ordered dict.  I am leveraging that ordering here, because
        # derived class fields overwrite base class fields, but the order
        # is defined by the base class, which is found first.
        fields = {}
            if cls.__module__ in sys.modules:
            globals = sys.modules[cls.__module__].__dict__
        else:
            # Theoretically this can happen if someone writes
            # a custom string to cls.__module__.  In which case
            # such dataclass won't be fully introspectable
            # (w.r.t. typing.get_type_hints) but will still function
            # correctly.
            globals = {}
            setattr(cls, _PARAMS, _DataclassParams(init, repr, eq, order,
                                               unsafe_hash, frozen))
            # Find our base classes in reverse MRO order, and exclude
        # ourselves.  In reversed order so that more derived classes
        # override earlier field definitions in base classes.  As long as
        # we're iterating over them, see if any are frozen.
        any_frozen_base = False
        has_dataclass_bases = False
      for b in cls.__mro__[-1:0:-1]:
E       AttributeError: 'function' object has no attribute '__mro__'

/usr/lib/python3.10/dataclasses.py:909: AttributeError

During handling of the above exception, another exception occurred:

self = <tests.test_class_schema.TestClassSchema testMethod=test_validator_stacking>

    def test_validator_stacking(self):
        # See: https://github.com/lovasoa/marshmallow_dataclass/issues/91
        class SimpleValidator(Validator):
# Marshmallow checks for valid validators at construction time only using `callable`
            def __call__(self):
                pass
            validator_a = SimpleValidator()
        validator_b = SimpleValidator()
        validator_c = SimpleValidator()
        validator_d = SimpleValidator()
            CustomTypeOneValidator = NewType(
            "CustomTypeOneValidator", str, validate=validator_a
        )
CustomTypeNoneValidator = NewType("CustomTypeNoneValidator", str, validate=None)
        CustomTypeMultiValidator = NewType(
"CustomTypeNoneValidator", str, validate=[validator_a, validator_b]
        )
            @dataclasses.dataclass
        class A:
            data: CustomTypeNoneValidator = dataclasses.field()
    >       schema_a = class_schema(A)()

tests/test_class_schema.py:319: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/marshmallow_dataclass/__init__.py:356: in class_schema
    return _internal_class_schema(clazz, base_schema, clazz_frame)
/usr/lib/python3/dist-packages/marshmallow_dataclass/__init__.py:402: in _internal_class_schema
    attributes.update(
/usr/lib/python3/dist-packages/marshmallow_dataclass/__init__.py:405: in <genexpr>
    field_for_schema(
/usr/lib/python3/dist-packages/marshmallow_dataclass/__init__.py:729: in field_for_schema
    or _internal_class_schema(typ, base_schema, typ_frame)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
clazz = <function NewType.<locals>.new_type at 0x7f0b19be1990>
base_schema = None
clazz_frame = <frame at 0x55c027b54830, file '/tmp/autopkgtest-lxc.c9zyolii/downtmp/autopkgtest_tmp/tests/test_class_schema.py', line 319, code test_validator_stacking>

    @lru_cache(maxsize=MAX_CLASS_SCHEMA_CACHE_SIZE)
    def _internal_class_schema(
        clazz: type,
        base_schema: Optional[Type[marshmallow.Schema]] = None,
        clazz_frame: types.FrameType = None,
    ) -> Type[marshmallow.Schema]:
        _RECURSION_GUARD.seen_classes[clazz] = clazz.__name__
        try:
            # noinspection PyDataclass
fields: Tuple[dataclasses.Field, ...] = dataclasses.fields(clazz)
        except TypeError:  # Not a dataclass
            try:
                warnings.warn(
                    "****** WARNING ****** "
f"marshmallow_dataclass was called on the class {clazz}, which is not a dataclass. " "It is going to try and convert the class into a dataclass, which may have " "undesirable side effects. To avoid this message, make sure all your classes and " "all the classes of their fields are either explicitly supported by " "marshmallow_dataclass, or define the schema explicitly using " "field(metadata=dict(marshmallow_field=...)). For more information, see "

"https://github.com/lovasoa/marshmallow_dataclass/issues/51 "
                    "****** WARNING ******"
                )
                created_dataclass: type = dataclasses.dataclass(clazz)
return _internal_class_schema(created_dataclass, base_schema, clazz_frame)
            except Exception:
              raise TypeError(
f"{getattr(clazz, '__name__', repr(clazz))} is not a dataclass and cannot be turned into one."
                )
E TypeError: CustomTypeNoneValidator is not a dataclass and cannot be turned into one.

/usr/lib/python3/dist-packages/marshmallow_dataclass/__init__.py:387: TypeError

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
Source: python-marshmallow-dataclass
Source-Version: 8.5.8-3
Done: Michael R. Crusoe <cru...@debian.org>

We believe that the bug you reported is fixed in the latest version of
python-marshmallow-dataclass, which is due to be installed in the Debian FTP 
archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1019...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael R. Crusoe <cru...@debian.org> (supplier of updated 
python-marshmallow-dataclass package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 01 Oct 2022 12:25:37 +0200
Source: python-marshmallow-dataclass
Architecture: source
Version: 8.5.8-3
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+pyt...@tracker.debian.org>
Changed-By: Michael R. Crusoe <cru...@debian.org>
Closes: 1019391 1020099
Changes:
 python-marshmallow-dataclass (8.5.8-3) unstable; urgency=medium
 .
   * Team upload.
   * d/patches/fix_broken_types.patch: from upstream
     Closes: #1019391, #1020099
Checksums-Sha1:
 91129657f0a03bede8b70017b26ec07d3b8887ca 2502 
python-marshmallow-dataclass_8.5.8-3.dsc
 bbe9d58adef790d77b56d1aefd8dac76d86135e1 3036 
python-marshmallow-dataclass_8.5.8-3.debian.tar.xz
 c6e985593a70aae90efd3d5a1fbbb954a59c5503 8506 
python-marshmallow-dataclass_8.5.8-3_source.buildinfo
Checksums-Sha256:
 aed82f5b03fe080a9978805e0e390a13d102561d89c29cf1749d94c982137a5c 2502 
python-marshmallow-dataclass_8.5.8-3.dsc
 4550bdebae45300608ba77e54b015ccc40c50dabcb7b29a162613e6c6a0ca49e 3036 
python-marshmallow-dataclass_8.5.8-3.debian.tar.xz
 4b35023ce72a7ea88c197017477e2ec02cb51c05dc1f8a0ad4e0ef6cda42dc15 8506 
python-marshmallow-dataclass_8.5.8-3_source.buildinfo
Files:
 59ac8750b5cbc1af07d2a7b8a526b7e9 2502 python optional 
python-marshmallow-dataclass_8.5.8-3.dsc
 317537d1c640087798a0b116c10b795c 3036 python optional 
python-marshmallow-dataclass_8.5.8-3.debian.tar.xz
 6a081b1291a46a6e77bf043b414cbe68 8506 python optional 
python-marshmallow-dataclass_8.5.8-3_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEck1gkzcRPHEFUNdHPCZ2P2xn5uIFAmM4FbQACgkQPCZ2P2xn
5uLo5Q//XGvmTWjC2WmZqYTTVNeF9usO2XfLkvTlwr0ZYif3l3be6VBLfgn85lWY
tUgIDjz8Xljzp3X2pCSvvL2P3N37HerQqOqsuWqjicKDyHVqm8u7yhR6yXhDLg9f
SgRr9nNQu2w3W3HFMOZQfQfUD6tyLBY4o76/eWimfibVG/UrgCdzIOSBbOpXXDe7
KWYbocXcbTSrGCebvS0S5ALAslGFff205ySZz8456uJHKoSPXtpHCvNXztr/eRGH
TcZ2EVQgD6UTabPWQWYy5rYvDiZgyFhk71eKdEfFlhOELFqjHL3/tX0p1QCEXc/C
sOpXPxj4JHEHFM145ZaE8NRBaf6bzweP+O6m6nIKXQi3Jca5nfXKKykl2bY6Qb8h
3Uzdae8+/dcNM1Di1pwuHiCHptX1fFOv9shff/ckzl/6SX7UsBSf9NzefJXKhVi9
td/pRNNVsHMPaf6Wxlzks90S/Nxt8h3pqMxeE6BaBQ/mPr8bcSqye5mfLl5i48v3
k42dGBpEBfLzscy51vo7Jw5cTXR2naY7UKkVmvDPEXPkwvz0ne32+4Vmyhoni7Uw
WtAC02Z0lsOeY5T4cXNVr+dpmjIQHtDPO17WYPyewX3/qbKnkqI6jTnCYGtLtHrb
Xicy1qc/IWfP3EdH8YSve6H2up3jJAtGfYWWaBtl7ndZ6KtjUS8=
=s3im
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to