diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98ffbb415..33180a2e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -193,7 +193,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.10", "3.12"] + python-version: ["3.9", "3.12"] defaults: run: working-directory: ./compliance_tool @@ -227,10 +227,10 @@ jobs: working-directory: ./compliance_tool steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ env.X_PYTHON_VERSION }} + - name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }} uses: actions/setup-python@v5 with: - python-version: ${{ env.X_PYTHON_VERSION }} + python-version: ${{ env.X_PYTHON_MIN_VERSION }} - name: Install Python dependencies # install the local sdk in editable mode so it does not get overwritten run: | @@ -253,10 +253,10 @@ jobs: working-directory: ./compliance_tool steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ env.X_PYTHON_VERSION }} + - name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }} uses: actions/setup-python@v5 with: - python-version: ${{ env.X_PYTHON_VERSION }} + python-version: ${{ env.X_PYTHON_MIN_VERSION }} - name: Install Python dependencies # install the local sdk in editable mode so it does not get overwritten run: | @@ -282,10 +282,10 @@ jobs: working-directory: ./compliance_tool steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ env.X_PYTHON_VERSION }} + - name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }} uses: actions/setup-python@v5 with: - python-version: ${{ env.X_PYTHON_VERSION }} + python-version: ${{ env.X_PYTHON_MIN_VERSION }} - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/compliance_tool/__init__.py b/1.0.0 similarity index 100% rename from compliance_tool/__init__.py rename to 1.0.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ce3a4fd6b..95ec0a74f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -94,7 +94,7 @@ the further steps via the comments. In order to effectively communicate, there are some conventions to respect when writing commit messages and pull requests. -Similarily to when creating an issue, the commit title, as well as the PR title should +Similarly to when creating an issue, the commit title, as well as the PR title should be as short as possible, ideally 72 characters or fewer using imperative language. If a specific module is affected, please mention it at the beginning of the title. diff --git a/README.md b/README.md index f271c4d5b..82e56055f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ These are the currently implemented specifications: | Specification | Version | |---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Part 1: Metamodel | [v3.0.1 (01001-3-1)](https://industrialdigitaltwin.org/wp-content/uploads/2024/06/IDTA-01001-3-0-1_SpecificationAssetAdministrationShell_Part1_Metamodel.pdf) | +| Part 1: Metamodel | [v3.0.1 (01001-3-0-1)](https://industrialdigitaltwin.org/wp-content/uploads/2024/06/IDTA-01001-3-0-1_SpecificationAssetAdministrationShell_Part1_Metamodel.pdf) | | Schemata (JSONSchema, XSD) | [v3.0.8 (IDTA-01001-3-0-1_schemasV3.0.8)](https://github.com/admin-shell-io/aas-specs/releases/tag/IDTA-01001-3-0-1_schemasV3.0.8) | | Part 2: API | [v3.0 (01002-3-0)](https://industrialdigitaltwin.org/en/wp-content/uploads/sites/2/2023/06/IDTA-01002-3-0_SpecificationAssetAdministrationShell_Part2_API_.pdf) | | Part 3a: Data Specification IEC 61360 | [v3.0 (01003-a-3-0)](https://industrialdigitaltwin.org/wp-content/uploads/2023/04/IDTA-01003-a-3-0_SpecificationAssetAdministrationShell_Part3a_DataSpecification_IEC61360.pdf) | diff --git a/compliance_tool/README.md b/compliance_tool/README.md index 40face78e..185e157a0 100644 --- a/compliance_tool/README.md +++ b/compliance_tool/README.md @@ -6,7 +6,7 @@ Following functionalities are supported: * 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 a given xml, json or aasx file is readable even if it is not compliant to the official 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 diff --git a/compliance_tool/aas_compliance_tool/cli.py b/compliance_tool/aas_compliance_tool/cli.py index cfd008140..6aab09d45 100644 --- a/compliance_tool/aas_compliance_tool/cli.py +++ b/compliance_tool/aas_compliance_tool/cli.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 the Eclipse BaSyx Authors +# Copyright (c) 2024 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. @@ -19,11 +19,12 @@ from basyx.aas.adapter import aasx from basyx.aas.adapter.xml import write_aas_xml_file -from basyx.aas.compliance_tool import compliance_check_xml as compliance_tool_xml, \ - compliance_check_json as compliance_tool_json, compliance_check_aasx as compliance_tool_aasx +from aas_compliance_tool import compliance_check_xml as compliance_tool_xml, \ + compliance_check_json as compliance_tool_json, \ + compliance_check_aasx as compliance_tool_aasx from basyx.aas.adapter.json import write_aas_json_file from basyx.aas.examples.data import create_example, create_example_aas_binding, TEST_PDF_FILE -from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status +from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status def parse_cli_arguments() -> argparse.ArgumentParser: @@ -71,7 +72,7 @@ def parse_cli_arguments() -> argparse.ArgumentParser: 'f or file_compare: checks if two given files contain the same aas elements in any order') parser.add_argument('file_1', help="path to file 1") parser.add_argument('file_2', nargs='?', default=None, help="path to file 2: is required if action f or files is " - "choosen") + "chosen") parser.add_argument('-v', '--verbose', help="Print detailed information for each check. Multiple -v options " "increase the verbosity. 1: Detailed error information, 2: Additional " "detailed success information", action='count', default=0) diff --git a/compliance_tool/aas_compliance_tool/compliance_check_aasx.py b/compliance_tool/aas_compliance_tool/compliance_check_aasx.py index 74c0a3356..d2f76a83d 100644 --- a/compliance_tool/aas_compliance_tool/compliance_check_aasx.py +++ b/compliance_tool/aas_compliance_tool/compliance_check_aasx.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 the Eclipse BaSyx Authors +# Copyright (c) 2024 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. @@ -19,14 +19,14 @@ import pyecma376_2 -from . import compliance_check_json, compliance_check_xml +from aas_compliance_tool import compliance_check_json, compliance_check_xml from basyx.aas import model from basyx.aas.adapter import aasx from basyx.aas.adapter.xml import xml_deserialization from basyx.aas.adapter.json import json_deserialization from basyx.aas.examples.data import example_aas, create_example_aas_binding from basyx.aas.examples.data._helper import AASDataChecker, DataChecker -from .state_manager import ComplianceToolStateManager, Status +from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status def check_deserialization(file_path: str, state_manager: ComplianceToolStateManager, diff --git a/compliance_tool/aas_compliance_tool/compliance_check_json.py b/compliance_tool/aas_compliance_tool/compliance_check_json.py index 1469e8355..808563cb8 100644 --- a/compliance_tool/aas_compliance_tool/compliance_check_json.py +++ b/compliance_tool/aas_compliance_tool/compliance_check_json.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 the Eclipse BaSyx Authors +# Copyright (c) 2024 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. @@ -20,7 +20,7 @@ from basyx.aas.adapter.json import json_deserialization from basyx.aas.examples.data import example_aas, create_example from basyx.aas.examples.data._helper import AASDataChecker -from .state_manager import ComplianceToolStateManager, Status +from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status JSON_SCHEMA_FILE = os.path.join(os.path.dirname(__file__), 'schemas/aasJSONSchema.json') diff --git a/compliance_tool/aas_compliance_tool/compliance_check_xml.py b/compliance_tool/aas_compliance_tool/compliance_check_xml.py index 51fb06068..34121a837 100644 --- a/compliance_tool/aas_compliance_tool/compliance_check_xml.py +++ b/compliance_tool/aas_compliance_tool/compliance_check_xml.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 the Eclipse BaSyx Authors +# Copyright (c) 2024 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. @@ -20,7 +20,7 @@ from basyx.aas.adapter.xml import xml_deserialization from basyx.aas.examples.data import example_aas, create_example from basyx.aas.examples.data._helper import AASDataChecker -from .state_manager import ComplianceToolStateManager, Status +from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status XML_SCHEMA_FILE = os.path.join(os.path.dirname(__file__), 'schemas/aasXMLSchema.xsd') diff --git a/compliance_tool/aas_compliance_tool/state_manager.py b/compliance_tool/aas_compliance_tool/state_manager.py index 3116fe150..3201f01ab 100644 --- a/compliance_tool/aas_compliance_tool/state_manager.py +++ b/compliance_tool/aas_compliance_tool/state_manager.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 the Eclipse BaSyx Authors +# Copyright (c) 2024 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. diff --git a/compliance_tool/setup.py b/compliance_tool/setup.py new file mode 100644 index 000000000..e69de29bb diff --git a/compliance_tool/test/files/test_demo_full_example.json b/compliance_tool/test/files/test_demo_full_example.json index 31fde424d..68e154f73 100644 --- a/compliance_tool/test/files/test_demo_full_example.json +++ b/compliance_tool/test/files/test_demo_full_example.json @@ -499,7 +499,7 @@ }, { "language": "de", - "text": "Ein Beispiel-BillofMaterial-Submodel f\u00fcr eine Test-Anwendung" + "text": "Ein Beispiel-BillOfMaterial-Submodel f\u00fcr eine Test-Anwendung" } ], "modelType": "Submodel", @@ -1309,7 +1309,7 @@ }, { "language": "de", - "text": "Beispielswert f\u00fcr ein MulitLanguageProperty-Element" + "text": "Beispielwert f\u00fcr ein MultiLanguageProperty-Element" } ], "valueId": { @@ -2281,7 +2281,7 @@ }, { "language": "de", - "text": "Beispiel MulitLanguageProperty Element" + "text": "Beispiel MultiLanguageProperty Element" } ], "modelType": "MultiLanguageProperty", @@ -2301,7 +2301,7 @@ }, { "language": "de", - "text": "Beispielswert f\u00fcr ein MulitLanguageProperty-Element" + "text": "Beispielwert f\u00fcr ein MultiLanguageProperty-Element" } ] }, @@ -2825,7 +2825,7 @@ }, { "language": "de", - "text": "Beispiel MulitLanguageProperty Element" + "text": "Beispiel MultiLanguageProperty Element" } ], "modelType": "MultiLanguageProperty", diff --git a/compliance_tool/test/files/test_demo_full_example.xml b/compliance_tool/test/files/test_demo_full_example.xml index 39fae5599..759e3c403 100644 --- a/compliance_tool/test/files/test_demo_full_example.xml +++ b/compliance_tool/test/files/test_demo_full_example.xml @@ -486,7 +486,7 @@ de - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + Ein Beispiel-BillOfMaterial-Submodel für eine Test-Anwendung @@ -1424,7 +1424,7 @@ de - Beispielswert für ein MulitLanguageProperty-Element + Beispielwert für ein MultiLanguageProperty-Element @@ -2109,7 +2109,7 @@ de - Beispiel MulitLanguageProperty Element + Beispiel MultiLanguageProperty Element @@ -2128,7 +2128,7 @@ de - Beispielswert für ein MulitLanguageProperty-Element + Beispielwert für ein MultiLanguageProperty-Element @@ -2632,7 +2632,7 @@ de - Beispiel MulitLanguageProperty Element + Beispiel MultiLanguageProperty Element diff --git a/compliance_tool/test/files/test_demo_full_example_json_aasx/aasx/data.json b/compliance_tool/test/files/test_demo_full_example_json_aasx/aasx/data.json index 7172735e6..7ddb5f17c 100644 --- a/compliance_tool/test/files/test_demo_full_example_json_aasx/aasx/data.json +++ b/compliance_tool/test/files/test_demo_full_example_json_aasx/aasx/data.json @@ -507,7 +507,7 @@ }, { "language": "de", - "text": "Ein Beispiel-BillofMaterial-Submodel f\u00fcr eine Test-Anwendung" + "text": "Ein Beispiel-BillOfMaterial-Submodel f\u00fcr eine Test-Anwendung" } ], "modelType": "Submodel", @@ -1317,7 +1317,7 @@ }, { "language": "de", - "text": "Beispielswert f\u00fcr ein MulitLanguageProperty-Element" + "text": "Beispielwert f\u00fcr ein MultiLanguageProperty-Element" } ], "valueId": { @@ -2289,7 +2289,7 @@ }, { "language": "de", - "text": "Beispiel MulitLanguageProperty Element" + "text": "Beispiel MultiLanguageProperty Element" } ], "modelType": "MultiLanguageProperty", @@ -2309,7 +2309,7 @@ }, { "language": "de", - "text": "Beispielswert f\u00fcr ein MulitLanguageProperty-Element" + "text": "Beispielwert f\u00fcr ein MultiLanguageProperty-Element" } ] }, @@ -2833,7 +2833,7 @@ }, { "language": "de", - "text": "Beispiel MulitLanguageProperty Element" + "text": "Beispiel MultiLanguageProperty Element" } ], "modelType": "MultiLanguageProperty", diff --git a/compliance_tool/test/files/test_demo_full_example_wrong_attribute.json b/compliance_tool/test/files/test_demo_full_example_wrong_attribute.json index 8f816697d..d748e7908 100644 --- a/compliance_tool/test/files/test_demo_full_example_wrong_attribute.json +++ b/compliance_tool/test/files/test_demo_full_example_wrong_attribute.json @@ -499,7 +499,7 @@ }, { "language": "de", - "text": "Ein Beispiel-BillofMaterial-Submodel f\u00fcr eine Test-Anwendung" + "text": "Ein Beispiel-BillOfMaterial-Submodel f\u00fcr eine Test-Anwendung" } ], "modelType": "Submodel", @@ -1309,7 +1309,7 @@ }, { "language": "de", - "text": "Beispielswert f\u00fcr ein MulitLanguageProperty-Element" + "text": "Beispielwert f\u00fcr ein MultiLanguageProperty-Element" } ], "valueId": { @@ -2281,7 +2281,7 @@ }, { "language": "de", - "text": "Beispiel MulitLanguageProperty Element" + "text": "Beispiel MultiLanguageProperty Element" } ], "modelType": "MultiLanguageProperty", @@ -2301,7 +2301,7 @@ }, { "language": "de", - "text": "Beispielswert f\u00fcr ein MulitLanguageProperty-Element" + "text": "Beispielwert f\u00fcr ein MultiLanguageProperty-Element" } ] }, @@ -2825,7 +2825,7 @@ }, { "language": "de", - "text": "Beispiel MulitLanguageProperty Element" + "text": "Beispiel MultiLanguageProperty Element" } ], "modelType": "MultiLanguageProperty", diff --git a/compliance_tool/test/files/test_demo_full_example_wrong_attribute.xml b/compliance_tool/test/files/test_demo_full_example_wrong_attribute.xml index 061ee58b6..94c47d36b 100644 --- a/compliance_tool/test/files/test_demo_full_example_wrong_attribute.xml +++ b/compliance_tool/test/files/test_demo_full_example_wrong_attribute.xml @@ -486,7 +486,7 @@ de - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + Ein Beispiel-BillOfMaterial-Submodel für eine Test-Anwendung @@ -1424,7 +1424,7 @@ de - Beispielswert für ein MulitLanguageProperty-Element + Beispielwert für ein MultiLanguageProperty-Element @@ -2109,7 +2109,7 @@ de - Beispiel MulitLanguageProperty Element + Beispiel MultiLanguageProperty Element @@ -2128,7 +2128,7 @@ de - Beispielswert für ein MulitLanguageProperty-Element + Beispielwert für ein MultiLanguageProperty-Element @@ -2632,7 +2632,7 @@ de - Beispiel MulitLanguageProperty Element + Beispiel MultiLanguageProperty Element diff --git a/compliance_tool/test/files/test_demo_full_example_xml_aasx/aasx/data.xml b/compliance_tool/test/files/test_demo_full_example_xml_aasx/aasx/data.xml index c0eb40769..cb203c9d8 100644 --- a/compliance_tool/test/files/test_demo_full_example_xml_aasx/aasx/data.xml +++ b/compliance_tool/test/files/test_demo_full_example_xml_aasx/aasx/data.xml @@ -494,7 +494,7 @@ de - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + Ein Beispiel-BillOfMaterial-Submodel für eine Test-Anwendung @@ -1432,7 +1432,7 @@ de - Beispielswert für ein MulitLanguageProperty-Element + Beispielwert für ein MultiLanguageProperty-Element @@ -2117,7 +2117,7 @@ de - Beispiel MulitLanguageProperty Element + Beispiel MultiLanguageProperty Element @@ -2136,7 +2136,7 @@ de - Beispielswert für ein MulitLanguageProperty-Element + Beispielwert für ein MultiLanguageProperty-Element @@ -2640,7 +2640,7 @@ de - Beispiel MulitLanguageProperty Element + Beispiel MultiLanguageProperty Element diff --git a/compliance_tool/test/files/test_demo_full_example_xml_wrong_attribute_aasx/aasx/data.xml b/compliance_tool/test/files/test_demo_full_example_xml_wrong_attribute_aasx/aasx/data.xml index 5e952db2f..7f2531f6c 100644 --- a/compliance_tool/test/files/test_demo_full_example_xml_wrong_attribute_aasx/aasx/data.xml +++ b/compliance_tool/test/files/test_demo_full_example_xml_wrong_attribute_aasx/aasx/data.xml @@ -494,7 +494,7 @@ de - Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung + Ein Beispiel-BillOfMaterial-Submodel für eine Test-Anwendung @@ -1432,7 +1432,7 @@ de - Beispielswert für ein MulitLanguageProperty-Element + Beispielwert für ein MultiLanguageProperty-Element @@ -2117,7 +2117,7 @@ de - Beispiel MulitLanguageProperty Element + Beispiel MultiLanguageProperty Element @@ -2136,7 +2136,7 @@ de - Beispielswert für ein MulitLanguageProperty-Element + Beispielwert für ein MultiLanguageProperty-Element @@ -2640,7 +2640,7 @@ de - Beispiel MulitLanguageProperty Element + Beispiel MultiLanguageProperty Element diff --git a/compliance_tool/test/test_aas_compliance_tool.py b/compliance_tool/test/test_aas_compliance_tool.py index 8cd3004db..972bcf366 100644 --- a/compliance_tool/test/test_aas_compliance_tool.py +++ b/compliance_tool/test/test_aas_compliance_tool.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 the Eclipse BaSyx Authors +# Copyright (c) 2024 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. @@ -13,8 +13,6 @@ import io import tempfile - -import basyx.aas.compliance_tool from basyx.aas import model from basyx.aas.adapter import aasx from basyx.aas.adapter.json import read_aas_json_file @@ -25,14 +23,21 @@ def _run_compliance_tool(*compliance_tool_args, **kwargs) -> subprocess.CompletedProcess: """ - This function runs the compliance tool using subprocess.run() while adjusting the PYTHONPATH environment variable - and setting the stdout and stderr parameters of subprocess.run() to PIPE. + This function runs the compliance tool using subprocess.run() + and sets the stdout and stderr parameters of subprocess.run() to PIPE. Positional arguments are passed to the compliance tool, while keyword arguments are passed to subprocess.run(). """ env = os.environ.copy() - env['PYTHONPATH'] = "{}:{}".format(os.environ.get('PYTHONPATH', ''), - os.path.join(os.path.dirname(basyx.__file__), os.pardir)) - compliance_tool_path = os.path.join(os.path.dirname(basyx.aas.compliance_tool.__file__), 'cli.py') + parent_dir = os.path.join( + os.path.dirname(os.path.dirname(__file__)), + 'aas_compliance_tool' + ) + env["PYTHONPATH"] = parent_dir + os.pathsep + env.get("PYTHONPATH", "") + compliance_tool_path = os.path.join( + os.path.dirname(os.path.dirname(__file__)), + 'aas_compliance_tool', + 'cli.py' + ) return subprocess.run([sys.executable, compliance_tool_path] + list(compliance_tool_args), stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, **kwargs) diff --git a/compliance_tool/test/test_compliance_check_aasx.py b/compliance_tool/test/test_compliance_check_aasx.py index 78d9e04b7..fa2e15b29 100644 --- a/compliance_tool/test/test_compliance_check_aasx.py +++ b/compliance_tool/test/test_compliance_check_aasx.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 the Eclipse BaSyx Authors +# Copyright (c) 2024 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. @@ -7,8 +7,8 @@ import os import unittest -from basyx.aas.compliance_tool import compliance_check_aasx as compliance_tool -from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status +from aas_compliance_tool import compliance_check_aasx as compliance_tool +from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status class ComplianceToolAASXTest(unittest.TestCase): @@ -20,7 +20,9 @@ def test_check_deserialization(self) -> None: compliance_tool.check_deserialization(file_path_1, manager) self.assertEqual(2, len(manager.steps)) self.assertEqual(Status.FAILED, manager.steps[0].status) - self.assertIn("is not a valid ECMA376-2 (OPC) file", manager.format_step(0, verbose_level=1)) + # we should expect a FileNotFound error here since the file does not exist and that is the first error + # aasx.py will throw if you try to open a file that does not exist. + self.assertIn("No such file or directory:", manager.format_step(0, verbose_level=1)) self.assertEqual(Status.NOT_EXECUTED, manager.steps[1].status) # Todo add more tests for checking wrong aasx files diff --git a/compliance_tool/test/test_compliance_check_json.py b/compliance_tool/test/test_compliance_check_json.py index b6201d108..651895b9c 100644 --- a/compliance_tool/test/test_compliance_check_json.py +++ b/compliance_tool/test/test_compliance_check_json.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 the Eclipse BaSyx Authors +# Copyright (c) 2024 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. @@ -7,8 +7,8 @@ import os import unittest -import basyx.aas.compliance_tool.compliance_check_json as compliance_tool -from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status +from aas_compliance_tool import compliance_check_json as compliance_tool +from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status class ComplianceToolJsonTest(unittest.TestCase): diff --git a/compliance_tool/test/test_compliance_check_xml.py b/compliance_tool/test/test_compliance_check_xml.py index a1658e508..5afe06870 100644 --- a/compliance_tool/test/test_compliance_check_xml.py +++ b/compliance_tool/test/test_compliance_check_xml.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 the Eclipse BaSyx Authors +# Copyright (c) 2024 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. @@ -7,8 +7,8 @@ import os import unittest -import basyx.aas.compliance_tool.compliance_check_xml as compliance_tool -from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status +from aas_compliance_tool import compliance_check_xml as compliance_tool +from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status class ComplianceToolXmlTest(unittest.TestCase): diff --git a/compliance_tool/test/test_state_manager.py b/compliance_tool/test/test_state_manager.py index fc1c8260e..398f08e13 100644 --- a/compliance_tool/test/test_state_manager.py +++ b/compliance_tool/test/test_state_manager.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 the Eclipse BaSyx Authors +# Copyright (c) 2024 the Eclipse BaSyx Authors # # This program and the accompanying materials are made available under the terms of the MIT License, available in # the LICENSE file of this project. @@ -7,7 +7,7 @@ import logging import unittest -from basyx.aas.compliance_tool.state_manager import ComplianceToolStateManager, Status +from aas_compliance_tool.state_manager import ComplianceToolStateManager, Status from basyx.aas.examples.data._helper import DataChecker diff --git a/sdk/README.md b/sdk/README.md index fde12b465..91f62616e 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -38,19 +38,23 @@ file. ## Dependencies The BaSyx Python SDK requires the following Python packages to be installed for production usage. These dependencies are listed in -`setup.py` to be fetched automatically when installing with `pip`: +`pyproject.toml` to be fetched automatically when installing with `pip`: * `lxml` (BSD 3-clause License, using `libxml2` under MIT License) * `python-dateutil` (BSD 3-clause License) * `pyecma376-2` (Apache License v2.0) * `urllib3` (MIT License) * `Werkzeug` (BSD 3-clause License) - -Optional production usage dependencies: -* For using the Compliance Tool to validate JSON files against the JSON Schema: `jsonschema` and its -dependencies (MIT License, Apache License, PSF License) - -Development/testing/documentation/example dependencies (see `requirements.txt`): -* `jsonschema` and its dependencies (MIT License, Apache License, PSF License) +* `jsonschema` (MIT License, Apache License, PSF License) +* `types-python-dateutil` (Apache License v2.0) +* `schemathesis` (MIT License) +* `hypothesis` (MPL v2.0) +* `lxml-stubs` (Apache License) + +Development/testing/documentation/example dependencies: +* `mypy` (MIT License) +* `pycodestyle` (MIT License) +* `codeblocks` (Apache License v2.0) +* `coverage` (Apache License v2.0) Dependencies for building the documentation (see `docs/add-requirements.txt`): * `Sphinx` and its dependencies (BSD 2-clause License, MIT License, Apache License) @@ -130,7 +134,3 @@ For further examples and tutorials, check out the `basyx.aas.examples`-package. ### Documentation A detailed, complete API documentation is available on Read the Docs: https://basyx-python-sdk.readthedocs.io - -### Compliance Tool - -The compliance tool functionality moved to [github.com/rwth-iat/aas-compliance-tool](https://github.com/rwth-iat/aas-compliance-tool). diff --git a/sdk/basyx/aas/examples/tutorial_serialization_deserialization.py b/sdk/basyx/aas/examples/tutorial_serialization_deserialization.py index 6e1f6a889..6c99409a7 100755 --- a/sdk/basyx/aas/examples/tutorial_serialization_deserialization.py +++ b/sdk/basyx/aas/examples/tutorial_serialization_deserialization.py @@ -10,6 +10,7 @@ from basyx.aas import model import basyx.aas.adapter.xml +import basyx.aas.adapter.json # 'Details of the Asset Administration Shell' specifies multiple official serialization formats for AAS data. In this # tutorial, we show how the Eclipse BaSyx Python library can be used to serialize AAS objects into JSON or XML and to diff --git a/server/README.md b/server/README.md index b0e6b80db..339226c53 100644 --- a/server/README.md +++ b/server/README.md @@ -7,7 +7,7 @@ The server currently implements the following interfaces: - [Submodel Repository Service][5] It uses the [HTTP API][1] and the [AASX][7], [JSON][8], and [XML][9] Adapters of the [BaSyx Python SDK][3], to serve regarding files from a given directory. -The files are only read, chages won't persist. +The files are only read, changes won't persist. Alternatively, the container can also be told to use the [Local-File Backend][2] instead, which stores AAS and Submodels as individual JSON files and allows for persistent changes (except supplementary files, i.e. files referenced by `File` submodel elements). See [below](#options) on how to configure this.