[robotpy][examples] Split examples and snippets (#8944)

This also updates the bazel scripts to behave more like the C++ and Java
examples, and updates the copybara scripts to be able to sync up
`mostrobotpy`
This commit is contained in:
PJ Reiniger
2026-06-03 22:43:16 -04:00
committed by GitHub
parent a734275cc5
commit dca59147e1
134 changed files with 111 additions and 80 deletions

View File

@@ -2,18 +2,24 @@
import sys
import tomli
def main():
toml_filename = "robotpyExamples/examples.toml"
output_file = "robotpyExamples/example_projects.bzl"
def load_project_names(toml_filename, project_type):
with open(toml_filename, "rb") as f:
data = tomli.load(f)
contents = "PROJECTS = [\n"
contents = f"{project_type.upper()}_PROJECTS = [\n"
for test_folder in data["tests"]["base"]:
contents += f' "{test_folder}",\n'
contents += f' "{project_type}s/{test_folder}",\n'
contents += "]\n"
return contents
def main():
output_file = "robotpyExamples/example_projects.bzl"
contents = load_project_names("robotpyExamples/examples/examples.toml", "example")
contents += load_project_names("robotpyExamples/snippets/snippets.toml", "snippet")
if len(sys.argv) == 2:
output_file = sys.argv[1]