-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add type hints #29
base: master
Are you sure you want to change the base?
Add type hints #29
Conversation
This looks interesting, I will do some reading. I am currently working on replacing Adafruit GPIO (archived) with smbus2 in v2.0.0 of library, so this seems like a good time to introduce this. |
4fcb2cd
to
8754a5f
Compare
Codecov Report
@@ Coverage Diff @@
## master #29 +/- ##
=======================================
Coverage 99.14% 99.14%
=======================================
Files 1 1
Lines 234 235 +1
Branches 20 18 -2
=======================================
+ Hits 232 233 +1
Misses 1 1
Partials 1 1
Continue to review full report at Codecov.
|
I'm realizing that adding type hints breaks compatibility with Python 3.5 and 2.7. There are ways for type-hinting Python 2 code as well (see here), but I'm not sure if it's worth it then. |
I have removed 2.7 and 3.5 from my convert-to-smbus2 branch so no need to
deal with these.
Chris
…On Mon, 22 Nov 2021, 05:38 Janos Kutscherauer, ***@***.***> wrote:
I'm realizing that adding type hints breaks compatibility with Python 3.5
and 2.7. There are ways for type-hinting Python 2 code as well (see here
<https://mypy.readthedocs.io/en/latest/python2.html#type-checking-python-2-code>),
but I'm not sure if it's worth it then.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXR2V4342QAE72YC7YE2MDUNEN6VANCNFSM5IONEN3Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Awesome! Regarding this smbus2-branch - do you mind to further abstract the whole I2C access out, to have the user choose what driver they're using? I for example am currently using |
Yes smbus and smbus2 will be interchangeable. I choose smbus2 as smbus
looks like a dead repo with no recent maintenance. What other drivers are
you thinking of?
Any way I agree this seems reasonable.
Chris
…On Mon, 22 Nov 2021, 07:50 Janos Kutscherauer, ***@***.***> wrote:
I have removed 2.7 and 3.5 from my convert-to-smbus2 branch so no need to
deal with these.
Awesome!
Regarding this branch - do you mind to further abstract the whole I2C
access out, to have the user choose what driver they're using? I for
example am currently using smbus in a project (I don't know why,
actually), and the first thing I was doing was to rewrite that part. I'll
suggest something in another PR in a bit.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXR2V6DDZOEZYTSUST2MVTUNE5N5ANCNFSM5IONEN3Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I wouldn't know of any others myself, but searching for it, there seem to be some others. See this PR for my suggestion: #30. I'm not sure if everything needs to be abstracted... It makes the usage slightly more complicated, but gives the freedom of tool on the other hand. For >this< PR - I don't seem to get Travis to pass. It seems to build older commits and is still failing on 2.7/3.5, although I removed them. Could you assist in getting it to pass? |
Will take a look later , at work atm
Chris
…On Mon, 22 Nov 2021, 11:55 Janos Kutscherauer, ***@***.***> wrote:
What other drivers are you thinking of?
I wouldn't know of any others myself, but searching for it, there seem to
be some others. See this PR for my suggestion: #30
<#30>. I'm not sure if
everything needs to be abstracted... It makes the usage slightly more
complicated, but gives the freedom of tool on the other hand.
For >this< PR - I don't seem to get Travis to pass. It seems to build
older commits and is still failing on 2.7/3.5, although I removed them.
Could you assist in getting it to pass?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXR2V46ZWVVQ63TWW7FDFLUNF2E5ANCNFSM5IONEN3Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
5acadd3
to
18e5940
Compare
18e5940
to
1aebe35
Compare
unittest: fix deprecation warnings and cleanup testing dependencies
Also adding python 3.9
1aebe35
to
27d8fae
Compare
It's almost 2022 - are you interested in having typehints in the code base?
Feel free to decline it, just a suggestion.
Cheers, Janos