Skip to content

Commit

Permalink
Merge pull request #142 from dhalbert/handle-circuitpython_typing
Browse files Browse the repository at this point in the history
special-case circuitpython_typing
  • Loading branch information
dhalbert authored Feb 18, 2022
2 parents 14f7caf + d783743 commit 86ff01c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions circup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
"adafruit-blinka",
"adafruit-blinka-bleio",
"adafruit-blinka-displayio",
"adafruit-circuitpython-typing",
"circuitpython_typing",
"pyserial",
]
#: The version of CircuitPython found on the connected device.
Expand Down Expand Up @@ -848,19 +850,23 @@ def get_dependencies(*requested_libraries, mod_names, to_install=()):
# If nothing is requested, we're done
return _to_install

for l in _rl:
# Convert tuple to list and force all to lowercase, Clean the names
l = clean_library_name(l.lower())
if l in NOT_MCU_LIBRARIES:
logger.info("Skipping %s. It is not for microcontroller installs.", l)
for lib_name in _rl:
lower_lib_name = lib_name.lower()
if lower_lib_name in NOT_MCU_LIBRARIES:
logger.info(
"Skipping %s. It is not for microcontroller installs.", lib_name
)
else:
# Canonicalize, with some exceptions:
# adafruit-circuitpython-something => adafruit_something
canonical_lib_name = clean_library_name(lower_lib_name)
try:
# Don't process any names we can't find in mod_names
mod_names[l] # pylint: disable=pointless-statement
_requested_libraries.append(l)
mod_names[canonical_lib_name] # pylint: disable=pointless-statement
_requested_libraries.append(canonical_lib_name)
except KeyError:
click.secho(
f"WARNING:\n\t{l} is not a known CircuitPython library.",
f"WARNING:\n\t{canonical_lib_name} is not a known CircuitPython library.",
fg="yellow",
)

Expand Down

0 comments on commit 86ff01c

Please sign in to comment.