diff --git a/capycli/bom/check_bom.py b/capycli/bom/check_bom.py index 2be203d..c3e4344 100644 --- a/capycli/bom/check_bom.py +++ b/capycli/bom/check_bom.py @@ -11,12 +11,12 @@ import sys import requests +import sw360.sw360_api from colorama import Fore, Style from cyclonedx.model.bom import Bom from cyclonedx.model.component import Component import capycli.common.script_base -import sw360.sw360_api from capycli.common.capycli_bom_support import CaPyCliBom, CycloneDxSupport from capycli.common.print import print_green, print_red, print_text, print_yellow from capycli.main.result_codes import ResultCode diff --git a/capycli/bom/check_bom_item_status.py b/capycli/bom/check_bom_item_status.py index e3cfbc5..ecf9c14 100644 --- a/capycli/bom/check_bom_item_status.py +++ b/capycli/bom/check_bom_item_status.py @@ -12,12 +12,12 @@ from typing import Any, Dict, Optional import requests +import sw360.sw360_api from colorama import Fore, Style from cyclonedx.model.bom import Bom from cyclonedx.model.component import Component import capycli.common.script_base -import sw360.sw360_api from capycli.common.capycli_bom_support import CaPyCliBom, CycloneDxSupport from capycli.common.print import print_red, print_text from capycli.main.result_codes import ResultCode diff --git a/capycli/bom/create_components.py b/capycli/bom/create_components.py index 56b9bec..8df4ac9 100644 --- a/capycli/bom/create_components.py +++ b/capycli/bom/create_components.py @@ -16,13 +16,13 @@ import packageurl import requests +import sw360.sw360_api from colorama import Fore, Style from cyclonedx.model.bom import Bom from cyclonedx.model.component import Component import capycli.common.json_support import capycli.common.script_base -import sw360.sw360_api from capycli.common.capycli_bom_support import CaPyCliBom, CycloneDxSupport, SbomWriter from capycli.common.print import print_green, print_red, print_text, print_yellow from capycli.common.purl_utils import PurlUtils diff --git a/capycli/bom/findsources.py b/capycli/bom/findsources.py index 7923aef..b498337 100644 --- a/capycli/bom/findsources.py +++ b/capycli/bom/findsources.py @@ -10,24 +10,25 @@ import os import re import sys -from typing import Any import time +from typing import Any + import requests import semver +from bs4 import BeautifulSoup +from colorama import Fore, Style # from packageurl import PackageURL from cyclonedx.model import ExternalReferenceType from cyclonedx.model.bom import Bom -from sw360 import SW360Error from cyclonedx.model.component import Component +from sw360 import SW360Error import capycli.common.script_base from capycli import get_logger from capycli.common.capycli_bom_support import CaPyCliBom, CycloneDxSupport, SbomWriter from capycli.common.print import print_green, print_red, print_text, print_yellow from capycli.main.result_codes import ResultCode -from bs4 import BeautifulSoup -from colorama import Fore, Style LOG = get_logger(__name__) diff --git a/capycli/common/component_cache.py b/capycli/common/component_cache.py index 93127a6..7f97192 100644 --- a/capycli/common/component_cache.py +++ b/capycli/common/component_cache.py @@ -11,6 +11,7 @@ import sys import sw360 + from capycli import get_logger from capycli.common.print import print_red, print_text, print_yellow from capycli.common.script_support import ScriptSupport diff --git a/capycli/common/purl_service.py b/capycli/common/purl_service.py index 9c026d8..cbe84da 100644 --- a/capycli/common/purl_service.py +++ b/capycli/common/purl_service.py @@ -7,11 +7,11 @@ # ---------- import packageurl +from sw360 import SW360 from capycli.common.print import print_green, print_text, print_yellow from capycli.common.purl_store import PurlStore from capycli.common.purl_utils import PurlUtils -from sw360 import SW360 class PurlService: diff --git a/capycli/common/script_base.py b/capycli/common/script_base.py index d4cc022..ab09ec7 100644 --- a/capycli/common/script_base.py +++ b/capycli/common/script_base.py @@ -18,9 +18,9 @@ import jwt import requests +import sw360.sw360_api from cyclonedx.model.bom import Bom -import sw360.sw360_api from capycli.common.print import print_red, print_text, print_yellow from capycli.main.result_codes import ResultCode diff --git a/capycli/project/create_bom.py b/capycli/project/create_bom.py index f989f0a..f3c2871 100644 --- a/capycli/project/create_bom.py +++ b/capycli/project/create_bom.py @@ -9,12 +9,12 @@ import logging import sys +import sw360 from cyclonedx.model import ExternalReferenceType, HashAlgorithm from cyclonedx.model.bom import Bom from cyclonedx.model.component import Component import capycli.common.script_base -import sw360 from capycli import get_logger from capycli.common.capycli_bom_support import CaPyCliBom, CycloneDxSupport, SbomCreator from capycli.common.print import print_red, print_text, print_yellow diff --git a/capycli/project/create_project.py b/capycli/project/create_project.py index 7ef6407..12025c2 100644 --- a/capycli/project/create_project.py +++ b/capycli/project/create_project.py @@ -12,10 +12,10 @@ from typing import List import requests +import sw360 from cyclonedx.model.bom import Bom import capycli.common.script_base -import sw360 from capycli import get_logger from capycli.common.capycli_bom_support import CaPyCliBom, CycloneDxSupport from capycli.common.print import print_red, print_text, print_yellow diff --git a/capycli/project/find_project.py b/capycli/project/find_project.py index 4aaf6d9..17e35c4 100644 --- a/capycli/project/find_project.py +++ b/capycli/project/find_project.py @@ -11,9 +11,9 @@ import traceback import requests +import sw360 import capycli.common.script_base -import sw360 from capycli.common.print import print_red, print_text, print_yellow from capycli.main.result_codes import ResultCode diff --git a/capycli/project/get_license_info.py b/capycli/project/get_license_info.py index ad834a8..40b12a8 100644 --- a/capycli/project/get_license_info.py +++ b/capycli/project/get_license_info.py @@ -11,8 +11,9 @@ import os import sys -import capycli.common.script_base import sw360 + +import capycli.common.script_base from capycli.common.json_support import load_json_file from capycli.common.print import print_red, print_text, print_yellow from capycli.common.script_support import ScriptSupport diff --git a/capycli/project/show_ecc.py b/capycli/project/show_ecc.py index 8b6e802..644c8c7 100644 --- a/capycli/project/show_ecc.py +++ b/capycli/project/show_ecc.py @@ -9,8 +9,9 @@ import logging import sys -import capycli.common.script_base import sw360 + +import capycli.common.script_base from capycli.common.json_support import write_json_to_file from capycli.common.print import print_green, print_red, print_text, print_yellow from capycli.main.result_codes import ResultCode diff --git a/capycli/project/show_project.py b/capycli/project/show_project.py index 24222fc..7d839d9 100644 --- a/capycli/project/show_project.py +++ b/capycli/project/show_project.py @@ -9,11 +9,11 @@ import logging import sys +import sw360 from colorama import Fore import capycli.common.json_support import capycli.common.script_base -import sw360 from capycli.common.print import print_red, print_text, print_yellow from capycli.main.result_codes import ResultCode diff --git a/capycli/project/show_vulnerabilities.py b/capycli/project/show_vulnerabilities.py index 1001d61..801d6eb 100644 --- a/capycli/project/show_vulnerabilities.py +++ b/capycli/project/show_vulnerabilities.py @@ -10,11 +10,11 @@ import sys import requests +import sw360 from colorama import Fore, Style import capycli.common.json_support import capycli.common.script_base -import sw360 from capycli.common.print import print_green, print_red, print_text, print_yellow from capycli.main.result_codes import ResultCode diff --git a/tests/test_find_sources.py b/tests/test_find_sources.py index d556aa2..966c3e4 100644 --- a/tests/test_find_sources.py +++ b/tests/test_find_sources.py @@ -7,6 +7,8 @@ # ------------------------------------------------------------------------------- import os +from unittest.mock import MagicMock, patch + import responses import capycli.common.json_support @@ -15,7 +17,6 @@ from capycli.common.capycli_bom_support import CaPyCliBom, CycloneDxSupport from capycli.main.result_codes import ResultCode from tests.test_base import AppArguments, TestBase -from unittest.mock import MagicMock, patch class TestFindSources(TestBase): diff --git a/tests/test_script_base.py b/tests/test_script_base.py index bdcfc56..da9d3fa 100644 --- a/tests/test_script_base.py +++ b/tests/test_script_base.py @@ -9,10 +9,10 @@ import os import responses +from sw360.sw360error import SW360Error from capycli.common.script_base import ScriptBase from capycli.main.result_codes import ResultCode -from sw360.sw360error import SW360Error from tests.test_base import TestBase