Skip to content

use ruff and remove 8x displayio code #17

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 1 commit into from
Feb 24, 2025

Conversation

FoamyGuy
Copy link
Contributor

No description provided.

Comment on lines +29 to +33
import typing

from fourwire import FourWire
from epaperdisplay import EPaperDisplay
except ImportError:
from displayio import FourWire
from displayio import EPaperDisplay
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

If the import typing fails, then FourWire won't be imported. I don't think this is what you meant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dhalbert that is the intention. The only usage of FourWire is here: https://github.com/adafruit/Adafruit_CircuitPython_IL0398/blob/main/adafruit_il0398.py#L60 as a type annotation. If typing fails we know its a MCU context and this allows us to avoid the memory overhead of importing FourWire that won't be used at runtime.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks -- I realized this when I was reviewing another one.

@dhalbert dhalbert merged commit 299085a into adafruit:main Feb 24, 2025
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 4, 2025
Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305 to 2.0.0 from 1.4.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SSD1305#19 from FoamyGuy/use_ruff_remove_8x_comapt

Updating https://github.com/adafruit/Adafruit_CircuitPython_IL0398 to 2.0.0 from 1.2.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_IL0398#17 from FoamyGuy/use_ruff_remove_8x_compat

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1680 to 2.0.0 from 1.2.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1680#29 from FoamyGuy/use_ruff_remove_8x_compat

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1681 to 2.0.0 from 1.2.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1681#15 from FoamyGuy/use_ruff_remove_8x_compat

Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7735R to 2.0.0 from 1.6.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_ST7735R#38 from FoamyGuy/use_ruff_remove_8x_compat

Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7789 to 2.0.0 from 1.6.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_ST7789#39 from FoamyGuy/use_ruff_remove_8x_compat

Updating https://github.com/adafruit/Adafruit_CircuitPython_UC8151D to 2.0.0 from 1.3.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_UC8151D#14 from FoamyGuy/use_ruff_remove_8x_compat

Updating https://github.com/adafruit/Adafruit_CircuitPython_Wii_Classic to 1.0.9 from 1.0.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wii_Classic#6 from FoamyGuy/use_ruff_remove_8x_compat

Updating https://github.com/adafruit/Adafruit_CircuitPython_FunHouse to 2.3.1 from 2.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_FunHouse#45 from justmobilize/remove-secrets-usage

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 4.1.10 from 4.1.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#208 from dhalbert/update-ap_info
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