-
Notifications
You must be signed in to change notification settings - Fork 144
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
Use attrs
#2831
base: main
Are you sure you want to change the base?
Use attrs
#2831
Conversation
Signed-off-by: Cristian Le <[email protected]>
Signed-off-by: Cristian Le <[email protected]>
Hi @LecrisUT, why attrs? Did I miss something? |
tmt/hardware.py
Outdated
@@ -72,7 +73,6 @@ | |||
# The default formatting should use unit symbols rather than full names. | |||
UNITS.default_format = '~' | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One immediate comment, there are way too many formatting changes, obscuring the actual changes. Empty lines added and removed, indentation changes... I wonder how that happens, we should be using the same autopep8
settings in pre-commit.
The rest seems safely trivial, but need to re-read once the dust settles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that must have been from my IDE, but I thought it was already setup to use ruff-format
, so I'm not sure why this got changed and not in the pre-commit
, I can review the commit more and minimize these
@martinhoyer
|
Just to note version: Oldest attrs we need to support is 20.3.0 in el9 (from appstream repo) |
Signed-off-by: Cristian Le <[email protected]>
I've tried something very basic like: @attrs.define
class DiscoverCoprData(DiscoverStepData):
packages: list[str] = tmt.utils.field(
option=("-p", "--package"),
default_factory=list,
) But this didn't go as intended, the |
Testing out how hard it would be to replace
dataclass
withattrs
dataclass
: Trivialattrs.define
subclassingdataclasses.dataclass
:__init__
kwargs are not inherittedtmt.utils.field
: unknownclick
/metadata
/attrs.field
tmt.utils.FieldMetadata
: unknowntmt.utils.DataContainer
: unknownPull Request Checklist