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

Conversion to a dataclass of the Osversion class #38

Open
SchoolGuy opened this issue Jun 28, 2021 · 2 comments
Open

Conversion to a dataclass of the Osversion class #38

SchoolGuy opened this issue Jun 28, 2021 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@SchoolGuy
Copy link
Member

SchoolGuy commented Jun 28, 2021

So after reasoning with @agraul in this thread here, we have decided to get rid of properties and use a dataclass for Osversion.

Since we do want to do type validation on the members, we need a library who supports that. I see three options currently:

I would vote for the gata library because it seems the most used one but I see the downside that this means that we can't run it with Python 3.6 which we have on SLE15 (no SP).

CC @nodeg @meaksh @agraul @vzhestkov we need to maintain this library in the future so the choice is also up to you. I did not look up what we have in the Buildservice packaged or not already.

@SchoolGuy SchoolGuy added the enhancement New feature or request label Jun 28, 2021
@SchoolGuy SchoolGuy added this to the v1.0.0 milestone Jun 28, 2021
@vzhestkov
Copy link

+1 for gata

@agraul
Copy link

agraul commented Jun 28, 2021

@SchoolGuy something is wrong in the description, in * enforce-typing you link to gata and vice versa.

dataclass-type-validator's author said they'd move to gata themself in levii/dataclass-type-validator#5, I wonder how well it's going to be supported.

python-enforce-typing's decorator is pretty nice and it works with Python3.6 and the code is pretty simple, while gata is a lot more complex. The downside is that there are 2 open issues about incomplete type checks.

gata wasn't updated in a while either, but has no real issue open at this moment. The problems I see with gata is that 1. it does not work on SLE 15 and 2. I couldn't quickly find where validate_dataclass is defined. From a maintenance perspective,
python-enforce-typing seems more approachable to me.

All in all, I would try python-enforce-typing and see if it is good enough. If it is, great. If not we can see if it makes sense to improve it or if we should use gata instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

3 participants