Skip to content

Commit

Permalink
Merge pull request #199 from zyp/ignore_missing_deps
Browse files Browse the repository at this point in the history
boards/compat: Skip targets with unsatisfied dependencies.
  • Loading branch information
enjoy-digital authored Apr 11, 2021
2 parents 17e7cbc + 2e20428 commit 2a7d8c5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions litex_boards/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
# from litex_boards.targets import digilent_arty or
# from litex_boards.targets import arty
if target.split("_")[0] in vendors:
short_target = target[len(target.split("_")[0])+1:]
t = importlib.import_module(f"litex_boards.targets.{target}")
vars()[short_target] = t
sys.modules[f"litex_boards.targets.{short_target}"] = t
try:
short_target = target[len(target.split("_")[0])+1:]
t = importlib.import_module(f"litex_boards.targets.{target}")
vars()[short_target] = t
sys.modules[f"litex_boards.targets.{short_target}"] = t
except ModuleNotFoundError:
# Not all dependencies for this target is satisfied. Skip.
pass

0 comments on commit 2a7d8c5

Please sign in to comment.