Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Linux: tweak dataclass for compatibility with python 3.12 #6620

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

maxtropets
Copy link
Collaborator

@maxtropets maxtropets commented Nov 8, 2024

Fixes:

56:   File "/usr/lib/python3.12/dataclasses.py", line 1268, in dataclass
56:     return wrap(cls)
56:            │    └ <class 'infra.interfaces.NodeByRoleResolver'>
56:            └ <function dataclass.<locals>.wrap at 0x7f6a3b28e160>
...
56:   File "/usr/lib/python3.12/dataclasses.py", line 852, in _get_field
56:     raise ValueError(f'mutable default {type(f.default)} for field '
56: ValueError: mutable default <class 'infra.interfaces.TargetRole'> for field target is not allowed: use default_factory

Part of #6588

@maxtropets maxtropets self-assigned this Nov 8, 2024
@maxtropets maxtropets force-pushed the f/6588-dataclass-defaults-fix branch from 4f095f6 to ed88e62 Compare November 14, 2024 15:45
@maxtropets maxtropets force-pushed the f/6588-dataclass-defaults-fix branch from ed88e62 to 1387252 Compare November 14, 2024 15:46
@maxtropets maxtropets changed the title Fix python3.12 dataclass issues Azure Linux: tweak dataclass for compatibility with python 3.12 Nov 14, 2024
@maxtropets maxtropets marked this pull request as ready for review November 14, 2024 16:47
@maxtropets maxtropets requested a review from a team November 14, 2024 16:47
@achamayou achamayou enabled auto-merge November 14, 2024 18:35
@achamayou achamayou added this pull request to the merge queue Nov 14, 2024
Merged via the queue into microsoft:main with commit b979233 Nov 14, 2024
13 checks passed
@achamayou achamayou deleted the f/6588-dataclass-defaults-fix branch November 14, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants