Skip to content

Commit

Permalink
Fix Python code generation (#192)
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Louis Leroy <jleroy9@bloomberg.net>
  • Loading branch information
jll63 authored Feb 6, 2024
1 parent 3bdaf5a commit 6f1321d
Show file tree
Hide file tree
Showing 5 changed files with 516 additions and 758 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ jobs:
cd build/blazingmq
ctest -E mwcsys_executil.t --output-on-failure
- name: Run Python Unit Tests
env:
PYTHONPATH: src/python
run: |
src/python/bin/schemagen
src/python/bin/tweakgen
pytest src/python
- name: Run Integration Tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions src/python/bin/schemagen
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ if [ ! "$(which xsdata)" ]; then
fi

cd "${python_root}"
xsdata generate --package bmq.schemas "${blazingmq_root}/src/groups/mqb/mqbcfg/mqbcfg.xsd"
xsdata generate --package bmq.schemas "${blazingmq_root}/src/groups/mqb/mqbconfm/mqbconf.xsd"
xsdata generate --package blazingmq.schemas "${blazingmq_root}/src/groups/mqb/mqbcfg/mqbcfg.xsd"
xsdata generate --package blazingmq.schemas "${blazingmq_root}/src/groups/mqb/mqbconfm/mqbconf.xsd"
2 changes: 1 addition & 1 deletion src/python/bin/tweakgen
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def generate(cls: Type, indent: int, file: IO[str]):
assert False, f"add support for {origin}"

for item_type in nested_types:
if hasattr(item_type, "__annotations__"):
if dataclasses.is_dataclass(item_type):
generate(item_type, indent + 1, file)

print_indented(
Expand Down
Loading

0 comments on commit 6f1321d

Please sign in to comment.