Skip to content

Commit

Permalink
Merge remote-tracking branch 'compliance-tool/main' into add_complian…
Browse files Browse the repository at this point in the history
…ce-tool

Add compliance-tool to basyx-python-sdk.
  • Loading branch information
Frosty2500 committed Sep 16, 2024
2 parents fef92d0 + 978b3bc commit 200ac64
Show file tree
Hide file tree
Showing 63 changed files with 26,986 additions and 0 deletions.
94 changes: 94 additions & 0 deletions compliance-tool/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: ci

on: [push, pull_request]

env:
X_PYTHON_VERSION: "3.12"

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.10", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install coverage
pip install -r requirements.txt
- name: Test with coverage + unittest
run: |
coverage run --source=aas_compliance_tool -m unittest
- name: Report test coverage
if: ${{ always() }}
run: |
coverage report -m
static-analysis:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.X_PYTHON_VERSION }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pycodestyle mypy
pip install -r requirements.txt
- name: Check typing with MyPy
run: |
mypy aas_compliance_tool test
- name: Check code style with PyCodestyle
run: |
pycodestyle --count --max-line-length 120 aas_compliance_tool test
readme-codeblocks:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.X_PYTHON_VERSION }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pycodestyle mypy codeblocks
pip install -r requirements.txt
- name: Check typing with MyPy
run: |
mypy <(codeblocks python README.md)
- name: Check code style with PyCodestyle
run: |
codeblocks --wrap python README.md | pycodestyle --count --max-line-length 120 -
- name: Run readme codeblocks with Python
run: |
codeblocks python README.md | python
package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ env.X_PYTHON_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.X_PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Create source and wheel dist
run: |
python setup.py sdist bdist_wheel
30 changes: 30 additions & 0 deletions compliance-tool/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: release

on:
release:
types: [published]

jobs:
publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Create source and wheel dist
run: |
python setup.py sdist bdist_wheel
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
27 changes: 27 additions & 0 deletions compliance-tool/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Python caching
**/__pycache__/
*.pyc
/.mypy_cache/

# Typical virtualenv dir
/venv/

# IDE settings
/.idea/

# Python distribution artifacts
/build/
/dist/
/*.egg-info/
/docs/build/

# Coverage artifacts
/.coverage
/htmlcov/
/docs/build/

# customized config files
/test/test_config.ini

# Do not ship the dynamicylly packaged aasx files in the `test/files`
/test/files/*.aasx
21 changes: 21 additions & 0 deletions compliance-tool/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 IAT, RWTH Aachen University

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 18 additions & 0 deletions compliance-tool/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Declared Project License
------------------------
The artifacts of this project are made available under the terms of the MIT License.
Please refer to the LICENSE file for more information.


Third-party Work in this Repository
-----------------------------------
This project includes XSD and JSON Schema files, developed by IDTA and published
at https://github.com/admin-shell-io/aas-specs/

under the terms of the Creative Commons Attribution 4.0 International (CC-BY-4.0)
https://github.com/admin-shell-io/aas-specs/?tab=CC-BY-4.0-1-ov-file#readme

These files are located at
- `aas_compliance_tool/schemas/aasJSONSchema.json` and
- `aas_compliance_tool/schemas/aasXMLSchema.xsd`.

17 changes: 17 additions & 0 deletions compliance-tool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# AAS Compliance Tool
An AAS compliance checker based on the [Eclipse BaSyx Python SDK](https://github.com/eclipse-basyx/basyx-python-sdk) for testing XML and JSON files.
Following functionalities are supported:

* create an xml or json file compliant to the official schema containing example Asset Administration Shell elements
* create an aasx file with xml or json files compliant to the official schema containing example Asset Administration
Shell elements
* check if a given xml or json file is compliant to the official schema
* check if a given xml, json or aasx file is readable even if it is not compliant to the offical schema
* 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

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.

For further usage information consider the `aas_compliance_tool`-package or invoke with
`python -m aas_compliance_tool.cli --help` respectively `aas-compliance-check --help`.
Empty file.
Loading

0 comments on commit 200ac64

Please sign in to comment.