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

Fix type casing #11

Merged
merged 1 commit into from
Jan 11, 2023
Merged

Fix type casing #11

merged 1 commit into from
Jan 11, 2023

Conversation

greatest-gatsby
Copy link
Contributor

This is the same issue as found and addressed in this PR.

This PR fixes a type casing issue that prevents instantiation of the SSD1306 object. The constructor expects a type of displayio.Fourwire but the 'w' should be capitalized such that the expected type is displayio.FourWire.

The block below is a snippet of the output from a CI/CD runner attempting to build a project which references this SSD1306 repo. Because of the lowercase 'w', the project fails to find the named type, and the code fails.

ImportError: Failed to import test module: test.test_adjust
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
    module = self._get_module_from_name(name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
    __import__(name)
  File "/builds/project-40/test/test_adjust.py", line 3, in <module>
    from fruity_menu.adjust import AdjustMenu, BoolMenu
  File "/builds/project-40/fruity_menu/adjust.py", line 4, in <module>
    from adafruit_displayio_sh1106 import SH1106
  File "/builds/project-40/env/lib/python3.11/site-packages/adafruit_displayio_sh1106.py", line 55, in <module>
    class SH1106(displayio.Display):
  File "/builds/project-40/env/lib/python3.11/site-packages/adafruit_displayio_sh1106.py", line 65, in SH1106
    def __init__(self, bus: displayio.Fourwire, **kwargs) -> None:
                            ^^^^^^^^^^^^^^^^^^
AttributeError: module 'displayio' has no attribute 'Fourwire'

Copy link
Contributor

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Thank you!

@dhalbert dhalbert merged commit 9d4ca03 into adafruit:main Jan 11, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jan 11, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1106 to 1.2.10 from 1.2.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SH1106#11 from greatest-gatsby/main
  > Add .venv to .gitignore
  > Update .pylintrc for v2.15.5
  > Fix release CI files
  > Update pylint to 2.15.5
  > Updated pylint version to 2.13.0
  > Switching to composite actions

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.23.0 from 2.22.13:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#180 from FoamyGuy/fix_left_glpyh_logic

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 7.1.0 from 7.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#136 from vladak/user_data
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#139 from vladak/tls_port
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#141 from vladak/enable_logger_nits

Updating https://github.com/adafruit/Adafruit_CircuitPython_OneWire to 2.0.4 from 2.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_OneWire#28 from tekktrik/dev/fix-annotations
  > Add .venv to .gitignore
  > Update .pylintrc for v2.15.5
  > Fix release CI files
  > Update pylint to 2.15.5
  > Updated pylint version to 2.13.0
  > Switching to composite actions

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
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.

2 participants