Your message dated Thu, 01 Dec 2022 21:53:08 +0000
with message-id <e1p0rus-002lwt...@fasolo.debian.org>
and subject line Bug#1025108: fixed in python-marshmallow-dataclass 8.5.10-1
has caused the Debian Bug report #1025108,
regarding python-marshmallow-dataclass: (autopkgtest) needs update for 
python3.11: ValueError: mutable default for field data is not allowed
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.)


-- 
1025108: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1025108
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: python-marshmallow-dataclass
Version: 8.5.8-3
Severity: serious
Tags: sid bookworm
User: debian...@lists.debian.org
Usertags: needs-update
User: debian-pyt...@lists.debian.org
Usertags: python3.11
Control: affects -1 src:python3-defaults

Dear maintainer(s),

We are in the transition of adding python3.11 as a supported Python version [0]. With a recent upload of python3-defaults the autopkgtest of python-marshmallow-dataclass fails in testing when that autopkgtest is run with the binary packages of python3-defaults from unstable. It passes when run with only packages from testing. In tabular form:

                       pass            fail
python3-defaults       from testing    3.10.6-3
python-marshmallow-dataclass from testing    8.5.8-3
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 python3-defaults to testing [1]. https://docs.python.org/3/whatsnew/3.11.html lists what's new in Python3.11, it may help to identify what needs to be updated.

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

Paul

[0] https://bugs.debian.org/1021984
[1] https://qa.debian.org/excuses.php?package=python3-defaults

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

=================================== FAILURES =================================== _____________ TestClassSchema.test_final_infers_type_from_default ______________

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

    def test_final_infers_type_from_default(self):
        # @dataclasses.dataclass
        class A:
            data: Final = "a"
            # @dataclasses.dataclass
        class B:
            data: Final = A()
            # NOTE: This workaround is needed to avoid a Mypy crash.
# See: https://github.com/python/mypy/issues/10090#issuecomment-865971891
        if not TYPE_CHECKING:
            A = dataclasses.dataclass(A)
          B = dataclasses.dataclass(B)

tests/test_class_schema.py:242: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.11/dataclasses.py:1220: in dataclass
    return wrap(cls)
/usr/lib/python3.11/dataclasses.py:1210: in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
/usr/lib/python3.11/dataclasses.py:958: in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = <class 'tests.test_class_schema.TestClassSchema.test_final_infers_type_from_default.<locals>.B'>
a_name = 'data', a_type = typing.Final, default_kw_only = False

    def _get_field(cls, a_name, a_type, default_kw_only):
# Return a Field object for this field name and type. ClassVars and # InitVars are also returned, but marked as such (see f._field_type). # default_kw_only is the value of kw_only to use if there isn't a field()
        # that defines it.
# If the default value isn't derived from Field, then it's only a
        # normal default value.  Convert it to a Field().
        default = getattr(cls, a_name, MISSING)
        if isinstance(default, Field):
            f = default
        else:
            if isinstance(default, types.MemberDescriptorType):
                # This is a field in __slots__, so it has no default value.
                default = MISSING
            f = field(default=default)
# Only at this point do we know the name and the type. Set them.
        f.name = a_name
        f.type = a_type
# Assume it's a normal field until proven otherwise. We're next
        # going to decide if it's a ClassVar or InitVar, everything else
        # is just a normal field.
        f._field_type = _FIELD
            # In addition to checking for actual types here, also check for
        # string annotations.  get_type_hints() won't always work for us
        # (see https://github.com/python/typing/issues/508 for example),
        # plus it's expensive and would require an eval for every string
        # annotation.  So, make a best effort to see if this is a ClassVar
        # or InitVar using regex's and checking that the thing referenced
        # is actually of the correct type.
# For the complete discussion, see https://bugs.python.org/issue33453
            # If typing has not been imported, then it's impossible for any
        # annotation to be a ClassVar.  So, only look for ClassVar if
        # typing has been imported by any module (not necessarily cls's
        # module).
        typing = sys.modules.get('typing')
        if typing:
            if (_is_classvar(a_type, typing)
                or (isinstance(f.type, str)
                    and _is_type(f.type, cls, typing, typing.ClassVar,
                                 _is_classvar))):
                f._field_type = _FIELD_CLASSVAR
# If the type is InitVar, or if it's a matching string annotation,
        # then it's an InitVar.
        if f._field_type is _FIELD:
            # The module we're checking against is the module we're
            # currently in (dataclasses.py).
            dataclasses = sys.modules[__name__]
            if (_is_initvar(a_type, dataclasses)
                or (isinstance(f.type, str)
and _is_type(f.type, cls, dataclasses, dataclasses.InitVar,
                                 _is_initvar))):
                f._field_type = _FIELD_INITVAR
# Validations for individual fields. This is delayed until now,
        # instead of in the Field() constructor, since only here do we
        # know the field name, which allows for better error reporting.
            # Special restrictions for ClassVar and InitVar.
        if f._field_type in (_FIELD_CLASSVAR, _FIELD_INITVAR):
            if f.default_factory is not MISSING:
                raise TypeError(f'field {f.name} cannot have a '
                                'default factory')
            # Should I check for other field settings? default_factory
            # seems the most serious to check for.  Maybe add others.  For
            # example, how about init=False (or really,
            # init=<not-the-default-init-value>)?  It makes no sense for
            # ClassVar and InitVar to specify init=<anything>.
            # kw_only validation and assignment.
        if f._field_type in (_FIELD, _FIELD_INITVAR):
# For real and InitVar fields, if kw_only wasn't specified use the
            # default value.
            if f.kw_only is MISSING:
                f.kw_only = default_kw_only
        else:
            # Make sure kw_only isn't set for ClassVars
            assert f._field_type is _FIELD_CLASSVAR
            if f.kw_only is not MISSING:
raise TypeError(f'field {f.name} is a ClassVar but specifies '
                                'kw_only')
# For real fields, disallow mutable defaults. Use unhashable as a proxy # indicator for mutability. Read the __hash__ attribute from the class,
        # not the instance.
if f._field_type is _FIELD and f.default.__class__.__hash__ is None:
          raise ValueError(f'mutable default {type(f.default)} for field '
f'{f.name} is not allowed: use default_factory') E ValueError: mutable default <class 'tests.test_class_schema.TestClassSchema.test_final_infers_type_from_default.<locals>.A'> for field data is not allowed: use default_factory

/usr/lib/python3.11/dataclasses.py:815: ValueError
=========================== short test summary info ============================ FAILED tests/test_class_schema.py::TestClassSchema::test_final_infers_type_from_default ========================= 1 failed, 90 passed in 0.51s =========================
autopkgtest [23:15:03]: test upstream

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
Source: python-marshmallow-dataclass
Source-Version: 8.5.10-1
Done: Louis-Philippe Véronneau <po...@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 1025...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Louis-Philippe Véronneau <po...@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: Thu, 01 Dec 2022 16:27:58 -0500
Source: python-marshmallow-dataclass
Architecture: source
Version: 8.5.10-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+pyt...@tracker.debian.org>
Changed-By: Louis-Philippe Véronneau <po...@debian.org>
Closes: 1025108
Changes:
 python-marshmallow-dataclass (8.5.10-1) unstable; urgency=medium
 .
   * Team upload.
   * New upstream version. (Closes: #1025108)
   * d/patches: remove 'fix_broken_types.patch', as it has been upstreamed.
   * d/control: make the binary package's description longer, as recommended by
     lintian.
Checksums-Sha1:
 a6d25ff5a40a2a424165181f5c46dcf94b44fb04 1904 
python-marshmallow-dataclass_8.5.10-1.dsc
 6d70b14fe02f75b282a5d4c55311aa42b4c500d1 28052 
python-marshmallow-dataclass_8.5.10.orig.tar.xz
 37f470634d865eed79067fa81e410b250b5dceca 2568 
python-marshmallow-dataclass_8.5.10-1.debian.tar.xz
 c9862265fb733be1a04fd7d5982b07c2ace3fcbc 7347 
python-marshmallow-dataclass_8.5.10-1_amd64.buildinfo
Checksums-Sha256:
 7267609cd2e711d356fcc20ff81b79699c1eb51afc6a01d5c8cdb2d0650f6555 1904 
python-marshmallow-dataclass_8.5.10-1.dsc
 e7650f04fdc04182680934c1ed43941df69cc771d8b5dff4833ddb43fb3cdc1d 28052 
python-marshmallow-dataclass_8.5.10.orig.tar.xz
 509c1b323e901d6efb24f50e3e8df38ee561c46a2f34ebabe5f3d3f040391362 2568 
python-marshmallow-dataclass_8.5.10-1.debian.tar.xz
 820717297d17b447ae66ca841f0d6d771b2211382fa08712f06160f6288bf003 7347 
python-marshmallow-dataclass_8.5.10-1_amd64.buildinfo
Files:
 72398d5ce0dfae60e0d992d7647fd7f8 1904 python optional 
python-marshmallow-dataclass_8.5.10-1.dsc
 fd861b208a31ce1dfe3a38c2f78d7389 28052 python optional 
python-marshmallow-dataclass_8.5.10.orig.tar.xz
 44cbd4ed75b3b8c94fdaa74212d6325b 2568 python optional 
python-marshmallow-dataclass_8.5.10-1.debian.tar.xz
 01da224f4e84a9b9903bdffb4e623545 7347 python optional 
python-marshmallow-dataclass_8.5.10-1_amd64.buildinfo

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

iHUEARYKAB0WIQTKp0AHB6gWsCAvw830JXpQshz6hQUCY4kdWAAKCRD0JXpQshz6
hRl0AP4gCf1c9+XMwFWeal8Shxt3U2l6Vv86mE/c8N+mWmGJaAEAuJYoD1ehQWmR
oiV0dXYJIEeyBnZDqc35ZquCM++NHgQ=
=DB45
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to