Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,17 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
# TODO(#592): revisit when the sdk<->compliance_tool version pinning is fixed.
# Need tags so setuptools_scm builds the local sdk as >=1.0.0, else the loose
# `basyx-python-sdk>=1.0.0` pin lets pip replace it with the PyPI release.
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
# install the local sdk in editable mode so it does not get overwritten
# install the local sdk first so its version satisfies the >=1.0.0 pin and pip keeps it instead of PyPI
run: |
python -m pip install --upgrade pip
python -m pip install ../sdk
Expand All @@ -242,12 +247,17 @@ jobs:
working-directory: ./compliance_tool
steps:
- uses: actions/checkout@v4
with:
# TODO(#592): revisit when the sdk<->compliance_tool version pinning is fixed.
# Need tags so setuptools_scm builds the local sdk as >=1.0.0, else the loose
# `basyx-python-sdk>=1.0.0` pin lets pip replace it with the PyPI release.
fetch-depth: 0
- name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.X_PYTHON_MIN_VERSION }}
- name: Install Python dependencies
# install the local sdk in editable mode so it does not get overwritten
# install the local sdk first so its version satisfies the >=1.0.0 pin and pip keeps it instead of PyPI
run: |
python -m pip install --upgrade pip
python -m pip install ../sdk
Expand Down
32 changes: 32 additions & 0 deletions compliance_tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@ Shell elements
* check if the data in a given xml, json or aasx file is the same as the example data
* check if two given xml, json or aasx files contain the same Asset Administration Shell elements in any order

## Installation

### Default installation
Install the latest release from PyPI:

```bash
pip install basyx-compliance-tool
```

### Developer installation
When working from a checkout of this repository, install the sibling SDK from the source tree *first*, then the
compliance tool:

```bash
pip install ./sdk
pip install ./compliance_tool
```

Installing the local SDK first is what lets the tool check against your in-development metamodel: `pip` keeps the
already-installed local SDK instead of pulling a release from PyPI.

> [!IMPORTANT]
> The compliance checks are only as current as the installed `basyx-python-sdk` — the tool reports compliance against
> whatever metamodel version that SDK implements, not against the version named in this README. Because the dependency
> is currently declared loosely (`basyx-python-sdk>=1.0.0`), `pip` will **not** replace an SDK that is already installed
> and satisfies that constraint, even if it is older than the one you intend to test against. This happens silently, with
> no error. To be sure you are checking against the intended metamodel, install or upgrade the SDK explicitly, e.g. the
> local source tree with `pip install ./sdk` or a specific release with `pip install --upgrade "basyx-python-sdk==2.1.0"`.
>
> This manual version matching is a temporary workaround; see #592.

## Usage
Invoking should work with either `python -m aas_compliance_tool.cli` or (when installed correctly and PATH is set
correctly) with `aas-compliance-check` on the command line.

Expand Down
5 changes: 4 additions & 1 deletion compliance_tool/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ requires-python = ">=3.10"
dependencies = [
"pyecma376-2>=0.2.4",
"jsonschema>=4.21.1",
"basyx-python-sdk @ file:../sdk",
"basyx-python-sdk>=1.0.0",
]

[project.optional-dependencies]
Expand All @@ -52,6 +52,9 @@ dev = [
[project.urls]
"Homepage" = "https://github.com/eclipse-basyx/basyx-python-sdk"

[project.scripts]
aas-compliance-check = "aas_compliance_tool.cli:main"

[tool.setuptools]
packages = { find = { include = ["aas_compliance_tool*"], exclude = ["test*"] } }

Expand Down
Loading