Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Frosty2500 committed Dec 14, 2024
1 parent eaa59e3 commit 68ba6c0
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 28 deletions.
9 changes: 5 additions & 4 deletions compliance_tool/aas_compliance_tool/cli.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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 . 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 .state_manager import ComplianceToolStateManager, Status


def parse_cli_arguments() -> argparse.ArgumentParser:
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion compliance_tool/aas_compliance_tool/state_manager.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion compliance_tool/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2019-2021 the Eclipse BaSyx Authors
# Copyright (c) 2024-2021 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.
Expand Down
16 changes: 8 additions & 8 deletions compliance_tool/test/test_aas_compliance_tool.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand All @@ -25,14 +23,16 @@

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')
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)

Expand Down
6 changes: 3 additions & 3 deletions compliance_tool/test/test_compliance_check_aasx.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions compliance_tool/test/test_compliance_check_json.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions compliance_tool/test/test_compliance_check_xml.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions compliance_tool/test/test_state_manager.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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


Expand Down

0 comments on commit 68ba6c0

Please sign in to comment.