Skip to content

Import PWMOut protocols on applicable platforms #63

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 5 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion adafruit_motor/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
try:
from typing import Optional, Type
from types import TracebackType
from pwmio import PWMOut

try:
from pwmio import PWMOut
except NotImplementedError:
from circuitpython_typing.pwmio import PWMOut

except ImportError:
pass

Expand Down
6 changes: 5 additions & 1 deletion adafruit_motor/servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
from types import TracebackType

# pylint: disable-msg=unused-import
from pwmio import PWMOut
try:
from pwmio import PWMOut
except NotImplementedError:
from circuitpython_typing.pwmio import PWMOut

except (ImportError, NotImplementedError):
pass

Expand Down
7 changes: 6 additions & 1 deletion adafruit_motor/stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@

try:
from typing import Union, Optional
from pwmio import PWMOut
from digitalio import DigitalInOut

try:
from pwmio import PWMOut
except NotImplementedError:
from circuitpython_typing.pwmio import PWMOut

except ImportError:
pass

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#
# SPDX-License-Identifier: Unlicense

Adafruit-Blinka
Adafruit-Blinka>=7.0.0
adafruit-circuitpython-typing>=1.5.0
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
# Author details
author="Adafruit Industries",
author_email="[email protected]",
install_requires=["Adafruit-Blinka"],
install_requires=[
"Adafruit-Blinka>=7.0.0",
"adafruit-circuitpython-typing>=1.5.0",
],
# Choose your license
license="MIT",
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down