From 8e349c395545b7d4ba59dcf317ef55baa591510c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sat, 23 Nov 2024 00:04:12 -0600 Subject: [PATCH] Fix DBC scons build (#1523) * fix * clean up --- opendbc/dbc/SConscript | 9 ++++++++- .../tesla/{radar_common.py => _radar_common.py} | 0 opendbc/dbc/generator/tesla/tesla_radar_bosch.py | 2 +- opendbc/dbc/generator/tesla/tesla_radar_continental.py | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) rename opendbc/dbc/generator/tesla/{radar_common.py => _radar_common.py} (100%) diff --git a/opendbc/dbc/SConscript b/opendbc/dbc/SConscript index 4b0cff324c..fd8d84529e 100644 --- a/opendbc/dbc/SConscript +++ b/opendbc/dbc/SConscript @@ -16,8 +16,15 @@ output_files = [ if not f.name.startswith("_") ] +# include DBCs generated by python scripts +output_files += [ + f.name.replace(".py", "_generated.dbc") + for f in Path("generator").rglob("*.py") + if not f.name.startswith(("_", "test_")) and f.name != "generator.py" +] + generated = env.Command( target=output_files, source=[generator] + source_files, action="python3 ${SOURCES[0]}", -) \ No newline at end of file +) diff --git a/opendbc/dbc/generator/tesla/radar_common.py b/opendbc/dbc/generator/tesla/_radar_common.py similarity index 100% rename from opendbc/dbc/generator/tesla/radar_common.py rename to opendbc/dbc/generator/tesla/_radar_common.py diff --git a/opendbc/dbc/generator/tesla/tesla_radar_bosch.py b/opendbc/dbc/generator/tesla/tesla_radar_bosch.py index 6518c27436..6586655ec0 100755 --- a/opendbc/dbc/generator/tesla/tesla_radar_bosch.py +++ b/opendbc/dbc/generator/tesla/tesla_radar_bosch.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import os -from opendbc.dbc.generator.tesla.radar_common import get_radar_point_definition, get_val_definition +from opendbc.dbc.generator.tesla._radar_common import get_radar_point_definition, get_val_definition if __name__ == "__main__": dbc_name = os.path.basename(__file__).replace(".py", ".dbc") diff --git a/opendbc/dbc/generator/tesla/tesla_radar_continental.py b/opendbc/dbc/generator/tesla/tesla_radar_continental.py index 1279bf1f21..36355d4a03 100755 --- a/opendbc/dbc/generator/tesla/tesla_radar_continental.py +++ b/opendbc/dbc/generator/tesla/tesla_radar_continental.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import os -from opendbc.dbc.generator.tesla.radar_common import get_radar_point_definition, get_val_definition +from opendbc.dbc.generator.tesla._radar_common import get_radar_point_definition, get_val_definition if __name__ == "__main__": dbc_name = os.path.basename(__file__).replace(".py", ".dbc")