Open FoamyGuy opened 3 months ago
@FoamyGuy I think that makes sense. Happy to tackle this if you want
@justmobilize sounds good, you can if you'd like. Thank you!
@FoamyGuy and @dhalbert I've got this working locally, but have a question.
In CPython it's requests.auth.HTTPBasicAuth
. Do we want to mimic that and update requests
to have multiple files (and include the main one in __init__
so we don't break things)? Or do we want to just do requests.HTTPBasicAuth
?
It's not like it's very big, but if we wanted to add more features, allowing things to be broken up makes sense...
Breaking it up from a single file to a directory with multiple files is okay IMO. So long as if it's an incompatible change we bump the major version and update examples / learn guide code that need it.
It does also feel like a natural time to do it if we want to add auth.HTTPBasicAuth
and keep it's importing and usage compatible with CPython.
@FoamyGuy do you know if circup
handles this? changing from a single file to a directory?
I tested and it doesn't. I hacked it around esp32spi
:
So it deleted the old version, but couldn't install the new one
@FoamyGuy and @dhalbert I'm thinking of first tackling updating circup
to support this switch. Would you both agree?
In CPython requests it looks like there is HTTPBasicAuth which handles encoding credentials into the appropriate format. https://requests.readthedocs.io/en/latest/user/authentication/ we could add that class in the adafruit_requests library and then have matching APIs between circuitpython and CPython more closely.
Once implemented this could be used to simplify a few of the examples that make use of basic auth.
This was originally discussed in #167