From 3a1c1f668908a33a7b74a6b4fed5342678767c70 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Mon, 9 Feb 2026 10:59:28 +0100 Subject: [PATCH] Remove dependencies that are not used Remove: - cryptography - pandas - matplotlib - grpcio-health-checking Issue-ID: INT-2347 Change-Id: I9e41e2025567217427704d767641188bb52c4d95 Signed-off-by: Fiete Ostkamp --- requirements.txt | 4 ---- setup.cfg | 3 --- src/onaptests/configuration/settings.py | 40 +++++++++++++++++---------------- src/onaptests/utils/tracing.py | 2 +- 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/requirements.txt b/requirements.txt index 9d6a5a6..923310f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -cryptography==38.0.4 xtesting==0.91.0 avionix>=0.4.5 openstacksdk>=0.61.0 @@ -10,9 +9,6 @@ natural==0.2.0 slack-sdk==3.21.3 pg8000==1.30.1 mysql-connector-python==8.3.0 -pandas==2.2.1 -matplotlib==3.8.3 -grpcio-health-checking==1.71.0 opentelemetry-distro==0.51b0 opentelemetry-instrumentation-requests==0.51b0 opentelemetry-exporter-otlp==1.30.0 diff --git a/setup.cfg b/setup.cfg index 9012be5..59ce305 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,6 @@ packages=find_namespace: setup_requires = pytest-runner==5.2 install_requires = - cryptography==38.0.4 xtesting==0.91.0 avionix>=0.4.5 openstacksdk>=0.61.0 @@ -33,8 +32,6 @@ install_requires = slack-sdk==3.21.3 pg8000==1.30.1 mysql-connector-python==8.3.0 - pandas==2.2.1 - matplotlib==3.8.3 tests_require = mock pytest diff --git a/src/onaptests/configuration/settings.py b/src/onaptests/configuration/settings.py index b0d1ad3..aed04ee 100644 --- a/src/onaptests/configuration/settings.py +++ b/src/onaptests/configuration/settings.py @@ -19,27 +19,26 @@ LOG_CONFIG = { "formatters": { "default": { "class": "logging.Formatter", - "format": "%(asctime)s %(levelname)s %(lineno)d:%(filename)s(%(process)d) - %(message)s" + "format": ( + "%(asctime)s %(levelname)s %(lineno)d:%(filename)s(%(process)d) - %(message)s" + ), } }, "handlers": { "console": { "level": "DEBUG", "class": "logging.StreamHandler", - "formatter": "default" + "formatter": "default", }, "file": { "level": "DEBUG", "class": "logging.FileHandler", "formatter": "default", "filename": "/tmp/pythonsdk.debug.log", - "mode": "w" - } + "mode": "w", + }, }, - "root": { - "level": "DEBUG", - "handlers": ["console", "file"] - } + "root": {"level": "DEBUG", "handlers": ["console", "file"]}, } CLEANUP_FLAG = False CLEANUP_ACTIVITY_TIMER = 5 @@ -52,17 +51,19 @@ K8S_REGION_TYPE = "k8s" TILLER_HOST = "localhost" K8S_CONFIG = None # None means it will use default config (~/.kube/config) K8S_TESTS_NAMESPACE = "onap" # ONAP Kubernetes namespace -K8S_ADDITIONAL_RESOURCES_NAMESPACE = K8S_TESTS_NAMESPACE # Resources created on tests namespace +K8S_ADDITIONAL_RESOURCES_NAMESPACE = ( + K8S_TESTS_NAMESPACE # Resources created on tests namespace +) MSB_K8S_OVERRIDE_VALUES = None # SOCK_HTTP = "socks5h://127.0.0.1:8091" ORCHESTRATION_REQUEST_TIMEOUT = 60.0 * 15 # 15 minutes in seconds SERVICE_DISTRIBUTION_NUMBER_OF_TRIES = 30 -SERVICE_DISTRIBUTION_SLEEP_TIME = 60 +SERVICE_DISTRIBUTION_SLEEP_TIME = 45 EXPOSE_SERVICES_NODE_PORTS = True CDS_NODE_PORT = 30449 IN_CLUSTER = False -VES_BASIC_AUTH = {'username': 'sample1', 'password': 'sample1'} +VES_BASIC_AUTH = {"username": "sample1", "password": "sample1"} IF_VALIDATION = False SDNC_SECRET_NAME = "onap-sdnc-db-secret" SDNC_DB_PRIMARY_HOST = "mariadb-galera.onap.svc.cluster.local" @@ -75,10 +76,12 @@ KUBERNETES_NAMESPACE = "onap" # We need to create a service file with a random service name, # to be sure that we force onboarding -def generate_service_config_yaml_file(service_name: str, - service_template: str, - service_config: str, - generate_random_names: bool = False): +def generate_service_config_yaml_file( + service_name: str, + service_template: str, + service_config: str, + generate_random_names: bool = False, +): """Generate service config YAML file. Service configurations (both models and instances) are stored in YAML files @@ -95,9 +98,8 @@ def generate_service_config_yaml_file(service_name: str, should have a random suffix or not. Defaults to False. """ - env = Environment( - loader=PackageLoader('onaptests', 'templates/vnf-services'), + loader=PackageLoader("onaptests", "templates/vnf-services"), ) template = env.get_template(service_template) @@ -105,10 +107,10 @@ def generate_service_config_yaml_file(service_name: str, # get a random string to randomize the vnf name # Random string with the combination of lower and upper case letters = string.ascii_letters - result_str = ''.join(random.choice(letters) for i in range(6)) + result_str = "".join(random.choice(letters) for i in range(6)) service_name = f"{service_name}_{result_str}" rendered_template = template.render(service_name=service_name) - with open(service_config, 'w+', encoding="utf-8") as file_to_write: + with open(service_config, "w+", encoding="utf-8") as file_to_write: file_to_write.write(rendered_template) diff --git a/src/onaptests/utils/tracing.py b/src/onaptests/utils/tracing.py index 54c8c9a..515f60d 100644 --- a/src/onaptests/utils/tracing.py +++ b/src/onaptests/utils/tracing.py @@ -19,6 +19,6 @@ def otel_expect_not_found() -> None: resource = SomeResource.create(...) """ current_span = trace.get_current_span() - if current_span and current_span.is_recording(): + if current_span: current_span.set_attribute("error", False) current_span.set_attribute("expected_404", True) -- 2.16.6