Skip to content

Type info #29

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

Merged
merged 3 commits into from
Oct 8, 2021
Merged

Type info #29

merged 3 commits into from
Oct 8, 2021

Conversation

FoamyGuy
Copy link
Contributor

resolves #28

I am not certain whether using Any is the best option for **kwargs but there are many different possible types of the various different arguments that can get passed that way. I tried using some of the specific types but mypy still reported errors. I'm not sure if we have another option beyond breaking out all of the possible arguments and declaring types for all of them. I'm still pretty new to typing in python though, perhaps I've overlooked something or someone else has ideas.

There is possibly something that still needs done to make the sphinx docs correct. When building locally I'm not seeing the proper arguments for init(). But strangely when I build the docs from main I'm seeing the same issue. So perhaps there is some difference in my environment vs. in actions.

I tested this driver successfully with a Raspberry Pi B+ using Blinka_Displayio

@FoamyGuy
Copy link
Contributor Author

The latest commit removes the mock import for displayio from the sphinx conf.py file. It turned out that being mocked was causing the arguments to turn out incorrectly when building the sphinx docs locally. And it does not need to be mocked because adafruit-blinka-displayio is listed in requirements.txt which fulfills the need for displayio for sphinx to understand.

With the latest commit I am seeing proper arguments listed in a local sphinx build:
image

Copy link
Member

@gamblor21 gamblor21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some looking on the types and using Any for the kwargs seems as much of a solution as anyone has right now for this type of situation. The rest looks good to me.

@gamblor21 gamblor21 merged commit 3c92cfe into adafruit:main Oct 8, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 13, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_ILI9341 to 1.3.1 from 1.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_ILI9341#29 from FoamyGuy/type_info
  > Globally disabled consider-using-f-string pylint check

Updating https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel to 6.2.2 from 6.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_NeoPixel#119 from jsymons/typing
  > Globally disabled consider-using-f-string pylint check

Updating https://github.com/adafruit/Adafruit_CircuitPython_Seesaw to 1.10.0 from 1.9.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#85 from ladyada/master
  > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#81 from FoamyGuy/use_rainbowio
  > Globally disabled consider-using-f-string pylint check

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.12.2 from 2.12.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#69 from careyk007/add_missing_type_annotations
  > Globally disabled consider-using-f-string pylint check

Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7789 to 1.5.2 from 1.5.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_ST7789#27 from helgibbons/Display-Pack-2.0
  > Globally disabled consider-using-f-string pylint check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Type Annotations
2 participants