Skip to content

Fix attribute type errors for LEVELS.#70

Merged
FoamyGuy merged 2 commits intoadafruit:mainfrom
alec-bike:fix-levels-type-error
Feb 25, 2026
Merged

Fix attribute type errors for LEVELS.#70
FoamyGuy merged 2 commits intoadafruit:mainfrom
alec-bike:fix-levels-type-error

Conversation

@alec-bike
Copy link
Contributor

@alec-bike alec-bike commented Feb 23, 2026

Using logging.INFO throws a type check error when using ty (astral-sh/ty#2868).

This PR explicitly declares the LEVELS globals to avoid the type checker error. Fixes: #69.

@alec-bike alec-bike force-pushed the fix-levels-type-error branch 3 times, most recently from d4a5ea6 to 4db61d3 Compare February 24, 2026 17:26
@alec-bike alec-bike force-pushed the fix-levels-type-error branch from 4db61d3 to 6c4f1d9 Compare February 24, 2026 17:33
@alec-bike
Copy link
Contributor Author

I also updated some type annotations to fix ty warnings. I still see unresolved-attribute for self.stream.* calls, but I did not tackle these.

@alec-bike
Copy link
Contributor Author

I tested this branch on a Feather M4 Express with my logging code and it worked as expected.

@FoamyGuy this PR is ready for review.

@alec-bike alec-bike marked this pull request as ready for review February 25, 2026 19:15
Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you!

I did a quick smoke test with simpletest and filehandler test on a Fruit Jam, all is working as expected.

@FoamyGuy FoamyGuy merged commit 02aa75a into adafruit:main Feb 25, 2026
1 check passed
@alec-bike alec-bike deleted the fix-levels-type-error branch February 25, 2026 20:45
adafruit-adabot pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 26, 2026
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.

attribute type errors for logging LEVELS

2 participants