-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add stubs for RPi.GPIO #11345
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 stubs for RPi.GPIO #11345
Conversation
This comment has been minimized.
This comment has been minimized.
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.
Thanks, LGTM. Let's see whether it breaks our stub uploader.
stubs/RPi.GPIO/RPi/GPIO/__init__.pyi
Outdated
from typing_extensions import TypeAlias | ||
|
||
VERSION: str | ||
RPI_INFO: dict[str, Any] |
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.
This could be a TypedDict
, but this can always be done later.
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.
Thank you for the review @srittau
I just tried that, and mypy failed with: https://github.com/fperrin/typeshed/actions/runs/7710857960/job/21015067471?pr=3
mypy --platform win32 --python-version 3.9 on the test cases for 'requests': FAILURE
...
File "mypy/fixup.py", line 127, in visit_symbol_table
File "mypy/lookup.py", line 31, in lookup_fully_qualified
AssertionError: Cannot find module for resource.struct_rusage
I really doubt this is related to my change, but who knows...
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.
@fperrin sorry about that! That's entirely unrelated, and it's very much on our minds right now: see
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.
in that case I'll ignore that failure and push Sebastian's suggestion
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Cross-referencing the following for discoverability: |
Hi,
These stubs cover the entirety of the API exposed to Python.
The name of the project on PyPi is
RPi.GPIO
with a.
, hopefully that won't cause any issue.There is very little activity upstream, but that module is still useful, indeed it comes by default with Raspbian as provided with brand new Pi modules.