From ff266b4dd5bc7aa237f1b2afda23e76ff2d8f0a9 Mon Sep 17 00:00:00 2001 From: Chris I-B Date: Sat, 18 Jan 2025 12:07:46 -0500 Subject: [PATCH] Fix missing subdirectories in firmware build --- software/firmware/setup.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/software/firmware/setup.py b/software/firmware/setup.py index 01c4cd625..1b1cbfeae 100644 --- a/software/firmware/setup.py +++ b/software/firmware/setup.py @@ -7,16 +7,23 @@ def build_firmware_module_list(): import os - dirs = {"experimental"} + dirs = {"experimental", "tools"} excluded = {"__init__.py", "setup.py"} - return [f[:-3] for f in os.listdir(".") if f.endswith(".py") and f not in excluded] + [ - ".".join([d, f[:-3]]) - for d in dirs - for f in os.listdir(d) - if f.endswith(".py") and f not in excluded + # grab files from the local directory first + modules = [ + f[:-3] for f in os.listdir(".") if f.endswith(".py") and not f in excluded ] + # add any modules in additional directories + for d in dirs: + for (root_dir, subdirs, files) in os.walk(d): + for f in files: + if f.endswith(".py") and not f in excluded: + modules.append(root_dir.replace("/", ".") + "." + f[:-3]) + + return modules + setup( name="micropython-europi",