Skip to content

Commit

Permalink
Core rework
Browse files Browse the repository at this point in the history
Rewrote the core logic using Pydantic.
- Tree nodes contain a Pydantic class instance in their 'data' attribute
- Pydantic handles the model validation
- Model is initialized in 'relaxed' mode so that we can support
  overlaying of instance nodes without the need to specify nodes
  completely
- Added a lot more validations to the model regarding consistency of
  datatypes, units, allowed attributes etc
- Rewrote include vspec logic and more
- Rewrote instance expansion logic and more

Signed-off-by: Sebastian Schleemilch <sebastian.schleemilch@bmw.de>
  • Loading branch information
sschleemilch committed Aug 5, 2024
1 parent 6705152 commit 7b71f20
Show file tree
Hide file tree
Showing 114 changed files with 3,267 additions and 4,350 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ jobs:
run: |
pip install cyclonedds
cd tests/ddsidl
vspec export ddsidl -u ../vspec/test_units.yaml -s test.vspec -o test.idl
vspec export ddsidl -u ../vspec/test_units.yaml -s test.vspec -o test.idl -q ../vspec/test_quantities.yaml
idlc -l py test.idl
grep -i A.String A/_test.py
2 changes: 1 addition & 1 deletion .github/workflows/check-header.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- name: Get changed files
run: |
echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | grep -v '^obsolete' | tr '\n' ',')" >> $GITHUB_ENV
echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | grep -v '^obsolete' | grep -v '^tests' | tr '\n' ',')" >> $GITHUB_ENV
- uses: ./.github/actions/verify-headers
with:
Expand Down
1 change: 1 addition & 0 deletions docs/vspec.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ vspec export --help
│ jsonschema Export as a jsonschema. │
│ protobuf Export as protobuf. │
│ yaml Export as YAML. │
│ tree Export as Tree. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

Expand Down
204 changes: 169 additions & 35 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ rdflib = "^6.0.0"
importlib-metadata = "^7.0"
click = "^8.1.7"
rich-click = "^1.8.3"
pydantic = "^2.8.2"

[tool.poetry.group.dev.dependencies]
mypy = "*"
Expand All @@ -30,8 +31,11 @@ pre-commit = "*"


[tool.poetry.scripts]
vspec = "vss_tools.vspec.vspec:cli"
vspec = "vss_tools.vspec.cli:cli"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.mypy]
disable_error_code = "import-untyped"
Loading

0 comments on commit 7b71f20

Please sign in to comment.