allow shorter imports; update examples to match#223
Merged
dhalbert merged 2 commits intoadafruit:mainfrom Nov 13, 2025
Merged
Conversation
Contributor
Author
|
I realized I need to explain this in the documentation, and also make sure the documentation builds properly with these |
Contributor
Author
|
OK, undrafted and ready for review. |
FoamyGuy
approved these changes
Nov 13, 2025
Contributor
FoamyGuy
left a comment
There was a problem hiding this comment.
This looks good to me. I tested the updated library on Fruit Jam with the IRC app and requests simpletest. I confirmed both old and new imports are working as expected and looked at the updated docs built locally.
Thank you for the simplification!
adafruit-adabot
pushed a commit
to adafruit/Adafruit_CircuitPython_Bundle
that referenced
this pull request
Nov 14, 2025
Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 11.0.0 from 10.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#223 from dhalbert/shorter-imports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
adafruit_esp32spilibrary (and a few others) have a redundant module naming structure that looks like this:adafruit_esp32spi/adafruit_esp32spi.py, which means you usually dofrom adafruit_esp32spi import adafruit_esp32spi.I have always found the duplicate name confusing. By adding
from adafruit_esp32spi import *in__init__.pyyou can now just doimport adafruit_esp32spiand have direct access to the definitions.adafruit_esp32spi_socketpool.pyandadafruit_esp32spi_wifimanageralso have unnecessary prefixes on their names, which could just besocketpool.pyandwifimanager.pyI added such files that also dofrom ... import *to allow this.So with this PR, you can now do:
etc.
I changed all the
examples/file to use the shorter import names. After this is merged Learn Guide code can be changed. But since it's backwards compatible, that doesn't need to be done all at once.I would release this as 10.1.0 or even 11.0.0. (Any opinion on that?)
Eventually we might remove the backwards compatibility.
I am working a native module version of
adafruit_esp32spiin core CircuitPython, and removing this extra layer of naming simplifies the code notably. My plan would be to only support the newer naming scheme here.