From 78875623c3c53ab9bcba66517777cd6d09fbe968 Mon Sep 17 00:00:00 2001 From: Pascal Palenda Date: Wed, 12 Aug 2026 20:53:39 +0200 Subject: [PATCH 1/5] Fix: python code gen path to copy --- code-gen/generate_data_structures.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code-gen/generate_data_structures.cmake b/code-gen/generate_data_structures.cmake index 0000a7d..7ece033 100644 --- a/code-gen/generate_data_structures.cmake +++ b/code-gen/generate_data_structures.cmake @@ -318,8 +318,11 @@ function (generate_data_structures TARGET_LIBRARY) file (MAKE_DIRECTORY ${GEN_DATA_IN_SOURCE_PATH}) endif () + # get the parent directory of the output python file + get_filename_component (GEN_DATA_OUTPUT_PYTHON_PARENT_DIR ${GEN_DATA_IN_SOURCE_PATH}/${GEN_DATA_OUTPUT_PYTHON} DIRECTORY) + file (COPY ${GEN_DATA_OUTPUT_BASE_DIR}/${GEN_DATA_OUTPUT_PYTHON} - DESTINATION ${GEN_DATA_IN_SOURCE_PATH}/${GEN_DATA_OUTPUT_PYTHON} + DESTINATION ${GEN_DATA_OUTPUT_PYTHON_PARENT_DIR} ) endif () From 01b5de5cc34d07f0a7c4da25b9110a3aa55c8bf7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 13 Aug 2026 06:46:30 +0000 Subject: [PATCH 2/5] Fix quoted Python output paths in CMake copy logic Co-authored-by: pingelit <22936321+pingelit@users.noreply.github.com> --- code-gen/generate_data_structures.cmake | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code-gen/generate_data_structures.cmake b/code-gen/generate_data_structures.cmake index 7ece033..1bfaed1 100644 --- a/code-gen/generate_data_structures.cmake +++ b/code-gen/generate_data_structures.cmake @@ -314,15 +314,15 @@ function (generate_data_structures TARGET_LIBRARY) endif () if (GEN_DATA_OUTPUT_PYTHON) - if (NOT EXISTS ${GEN_DATA_IN_SOURCE_PATH}/${GEN_DATA_OUTPUT_PYTHON}) - file (MAKE_DIRECTORY ${GEN_DATA_IN_SOURCE_PATH}) - endif () - # get the parent directory of the output python file - get_filename_component (GEN_DATA_OUTPUT_PYTHON_PARENT_DIR ${GEN_DATA_IN_SOURCE_PATH}/${GEN_DATA_OUTPUT_PYTHON} DIRECTORY) + get_filename_component (GEN_DATA_OUTPUT_PYTHON_PARENT_DIR "${GEN_DATA_IN_SOURCE_PATH}/${GEN_DATA_OUTPUT_PYTHON}" DIRECTORY) + + if (NOT EXISTS "${GEN_DATA_OUTPUT_PYTHON_PARENT_DIR}") + file (MAKE_DIRECTORY "${GEN_DATA_OUTPUT_PYTHON_PARENT_DIR}") + endif () - file (COPY ${GEN_DATA_OUTPUT_BASE_DIR}/${GEN_DATA_OUTPUT_PYTHON} - DESTINATION ${GEN_DATA_OUTPUT_PYTHON_PARENT_DIR} + file (COPY "${GEN_DATA_OUTPUT_BASE_DIR}/${GEN_DATA_OUTPUT_PYTHON}" + DESTINATION "${GEN_DATA_OUTPUT_PYTHON_PARENT_DIR}" ) endif () From 29693a92203b02da43fcb86546f1b17022bdadd6 Mon Sep 17 00:00:00 2001 From: Pascal Palenda Date: Thu, 13 Aug 2026 09:29:45 +0200 Subject: [PATCH 3/5] Refactor: switch to new hatch CLI --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82eb1a6..a9a81f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,7 +165,9 @@ jobs: python -m pip install hatch - name: Lint working-directory: ./code-gen - run: hatch fmt --check + run: | + hatch check code + hatch check fmt - name: type-check working-directory: ./code-gen run: hatch run types:check From 80e11315e82506c3f32ccda88fe441fb7ce0e0a8 Mon Sep 17 00:00:00 2001 From: Pascal Palenda Date: Thu, 13 Aug 2026 09:30:05 +0200 Subject: [PATCH 4/5] Fix: new raised errors --- code-gen/pyproject.toml | 1 + code-gen/src/poly_scribe_code_gen/cli/__init__.py | 6 +++--- code-gen/src/poly_scribe_code_gen/py_gen.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code-gen/pyproject.toml b/code-gen/pyproject.toml index f633a89..f70739a 100644 --- a/code-gen/pyproject.toml +++ b/code-gen/pyproject.toml @@ -94,6 +94,7 @@ ignore = [ "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", # Okay to use random "S311", + "RUF043", ] unfixable = [ # Don't touch unused imports diff --git a/code-gen/src/poly_scribe_code_gen/cli/__init__.py b/code-gen/src/poly_scribe_code_gen/cli/__init__.py index 8bff792..bc553cd 100644 --- a/code-gen/src/poly_scribe_code_gen/cli/__init__.py +++ b/code-gen/src/poly_scribe_code_gen/cli/__init__.py @@ -92,9 +92,9 @@ def poly_scribe_code_gen() -> int: raise RuntimeError(msg) if args.schema: - import importlib.util - import inspect - import sys + import importlib.util # noqa: PLC0415 + import inspect # noqa: PLC0415 + import sys # noqa: PLC0415 module_name = "idl_module" diff --git a/code-gen/src/poly_scribe_code_gen/py_gen.py b/code-gen/src/poly_scribe_code_gen/py_gen.py index d32dfaf..8907c5e 100644 --- a/code-gen/src/poly_scribe_code_gen/py_gen.py +++ b/code-gen/src/poly_scribe_code_gen/py_gen.py @@ -282,7 +282,7 @@ def _get_polymorphic_type(type_input: str, inheritance_data: dict[str, list[str] if union_content: union_content = [f'"{type_name}"' for type_name in union_content if type_name in defined_types] - return f"Annotated[Union[{', '.join(union_content)}],Field(discriminator=\"type\")]" + return f'Annotated[Union[{", ".join(union_content)}],Field(discriminator="type")]' return type_input From 59d1a3245839d4c4c7259c7a19f1a713b92d7ed4 Mon Sep 17 00:00:00 2001 From: Pascal Palenda Date: Thu, 13 Aug 2026 09:53:46 +0200 Subject: [PATCH 5/5] Fix: python 3.9 is EOL --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9a81f2..b71594f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,7 +146,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v3 - name: Setup Python