[Python] Improve python API (#8781)

* Fix generate_code script path

* [Python] Make StartVector public

Make StartVector vector public since it is already being used in
generated code

* [Python] Improve vector creation for Python API

Makes Python API for vectors cleaner like Rust and Swift

---------

Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
Jacob Abrams
2026-01-20 17:01:20 -08:00
committed by GitHub
parent 0d67abde45
commit af8997b567
20 changed files with 622 additions and 88 deletions

View File

@@ -33,11 +33,11 @@ result = subprocess.run(
if result.returncode != 0:
print(
"\n"
"ERROR: *********************************************************\n"
"ERROR: * The following differences were found after building. *\n"
"ERROR: * Perhaps there is a difference in the flags for the. *\n"
"ERROR: * CMakeLists.txt vs the script/generate_code.py script? *\n"
"ERROR: *********************************************************\n"
"ERROR: **********************************************************\n"
"ERROR: * The following differences were found after building. *\n"
"ERROR: * Perhaps there is a difference in the flags for the. *\n"
"ERROR: * CMakeLists.txt vs the scripts/generate_code.py script? *\n"
"ERROR: **********************************************************\n"
)
subprocess.run(["git", "diff", "--binary", "--exit-code"], cwd=root_path)
sys.exit(result.returncode)
@@ -55,11 +55,11 @@ result = subprocess.run(
if result.returncode != 0:
print(
"\n"
"ERROR: ********************************************************\n"
"ERROR: * The following differences were found after running *\n"
"ERROR: * the script/generate_code.py script. Maybe you forgot *\n"
"ERROR: * to run it after making changes in a generator? *\n"
"ERROR: ********************************************************\n"
"ERROR: *********************************************************\n"
"ERROR: * The following differences were found after running *\n"
"ERROR: * the scripts/generate_code.py script. Maybe you forgot *\n"
"ERROR: * to run it after making changes in a generator? *\n"
"ERROR: *********************************************************\n"
)
subprocess.run(["git", "diff", "--binary", "--exit-code"], cwd=root_path)
sys.exit(result.returncode)