We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent afea947 commit 2cb5955Copy full SHA for 2cb5955
1 file changed
scripts/inject_python_sdk_helpers.sh
@@ -336,6 +336,23 @@ PYCODE
336
337
sed -i "s/__PACKAGE_NAME__/${package_name}/g" "${package_dir}/auth.py" "${package_dir}/sdk.py"
338
339
+models_dir="${package_dir}/models"
340
+if [ -d "${models_dir}" ]; then
341
+ while IFS= read -r -d '' model_file; do
342
+ python3 - <<'PYCODE' "${model_file}"
343
+import pathlib
344
+import re
345
+import sys
346
+
347
+path = pathlib.Path(sys.argv[1])
348
+text = path.read_text(encoding="utf-8")
349
+updated = re.sub(r"\bbytearray\b", "bytes", text)
350
+if updated != text:
351
+ path.write_text(updated, encoding="utf-8")
352
+PYCODE
353
+ done < <(find "${models_dir}" -type f -name "*.py" -print0)
354
+fi
355
356
readme_path="${sdk_dir}/README.md"
357
if [ -f "${readme_path}" ]; then
358
tmp_readme="$(mktemp)"
0 commit comments