-
Notifications
You must be signed in to change notification settings - Fork 6
change requirements to pypi format, remove ESP32SPI requirement #15
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's a CI error, but if same thing as the other PR - if any of the dependencies are used in optional functionalities or examples, could you add them to a new optional_requirements.txt
? Thanks!
The error is from the docs run, because of the type annotations that use ESP32SPI. But if it works with native we don't want circup or others installing the ESP32SPI library. Projects that require the esp library will import it regardless of whether it's a requirement for LIFX or not. |
Also moved |
Trying to figure out how to type annotate something using Add a type definition to class WiFiManagerProtocol(Protocol):
def post(url: str, **kwargs) -> Response:
"""Post method"""
def put(url: str, **kwargs) -> Response:
"""Put method"""
def get(url: str, **kwargs) -> Response:
"""Get method"""
... Then, we can pull it in this library and modify it: from typing import Union
from adafruit_requests import WiFiManagerProtocol, Session
ESP32SPI_WFM_Type = type("ESPSPI_WiFiManager", (), {})
ESPAT_WFM_Type = type("ESPAT_WiFiManager", (), {})
AllowedWiFiManagerProtocol(WiFiManagerProtocol):
__class__: Union[Type[ESP32SPI_WFM_Type], Type[ESPAT_WFM_Type]]
AllowedWiFiManagerType = Union[AllowedWiFiManagerProtocol, Session] I think def __init__(self, wifi_manager: AllowedWifiManagerType, lifx_token: str) -> None: OOOORRRR we just remove the type annotation 😆 I'm open to that since the docstring is pretty clear |
That's a lot of hoops to jump through to get to that ! |
The more I think about this more I think a general |
This idea sounds good to me if you're still interested in PR'ing that in the typing library so it can be used here (and elsewhere as needed). Mabye |
Definitely happy to do that! |
…thon_LIFX into requirements-to-pypi
Okay, I'll make a new PR for the changes discussed here, but this looks good to me! I merged |
Oh hey, it actually looks like the |
While pypi doesn't care about
-
versus_
and letter case, the format used for the minimqtt requirement makes it listed in "external_dependencies" instead of "dependencies" in the bundle's json file, causing potential issues with bundler tools.And the library does not need ESP32SPI, it works on native wifi too.