From c9f44b27902da17e0182d3c987101cab675354a3 Mon Sep 17 00:00:00 2001 From: Varsha GS Date: Thu, 31 Jul 2025 11:33:44 +0530 Subject: [PATCH] Remove `six` from project dependencies Signed-off-by: Varsha GS --- pyproject.toml | 1 - src/instana/span/base_span.py | 5 ++--- tests/clients/test_google-cloud-pubsub.py | 7 +++---- tests/clients/test_google-cloud-storage.py | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 19ca2507..bcd86863 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,6 @@ dependencies = [ "autowrapt>=1.0", "fysom>=2.1.2", "requests>=2.6.0", - "six>=1.12.0", "urllib3>=1.26.5", "opentelemetry-api>=1.27.0", "opentelemetry-semantic-conventions>=0.48b0", diff --git a/src/instana/span/base_span.py b/src/instana/span/base_span.py index 0d8491c2..b0c58080 100644 --- a/src/instana/span/base_span.py +++ b/src/instana/span/base_span.py @@ -1,7 +1,6 @@ # (c) Copyright IBM Corp. 2024 from typing import TYPE_CHECKING, Type -import six from instana.log import logger from instana.util import DictionaryOfStan @@ -83,12 +82,12 @@ def _validate_attribute(self, key, value): try: # Attribute keys must be some type of text or string type - if isinstance(key, (six.text_type, six.string_types)): + if isinstance(key, str): validated_key = key[0:1024] # Max key length of 1024 characters if isinstance( value, - (bool, float, int, list, dict, six.text_type, six.string_types), + (bool, float, int, list, dict, str), ): validated_value = value else: diff --git a/tests/clients/test_google-cloud-pubsub.py b/tests/clients/test_google-cloud-pubsub.py index 678fc64d..db262e70 100644 --- a/tests/clients/test_google-cloud-pubsub.py +++ b/tests/clients/test_google-cloud-pubsub.py @@ -7,7 +7,6 @@ from typing import Generator import pytest -import six from google.api_core.exceptions import AlreadyExists from google.cloud.pubsub_v1 import PublisherClient, SubscriberClient from google.cloud.pubsub_v1.publisher import exceptions @@ -51,7 +50,7 @@ def test_publish(self) -> None: ) time.sleep(2.0) # for sanity result = future.result() - assert isinstance(result, six.string_types) + assert isinstance(result, str) spans = self.recorder.queued_spans() gcps_span, test_span = spans[0], spans[1] @@ -80,7 +79,7 @@ def test_publish_as_root_exit_span(self) -> None: ) time.sleep(2.0) # for sanity result = future.result() - assert isinstance(result, six.string_types) + assert isinstance(result, str) spans = self.recorder.queued_spans() assert len(spans) == 1 @@ -161,7 +160,7 @@ def test_subscribe(self) -> None: future = self.publisher.publish( self.topic_path, b"Test Message to PubSub", origin="instana" ) - assert isinstance(future.result(), six.string_types) + assert isinstance(future.result(), str) time.sleep(2.0) # for sanity diff --git a/tests/clients/test_google-cloud-storage.py b/tests/clients/test_google-cloud-storage.py index 15ce2e22..51b560ba 100644 --- a/tests/clients/test_google-cloud-storage.py +++ b/tests/clients/test_google-cloud-storage.py @@ -14,7 +14,7 @@ from opentelemetry.trace import SpanKind from mock import patch, Mock -from six.moves import http_client +from http import client as http_client from google.cloud import storage from google.api_core import iam, page_iterator