diff --git a/singer_sdk/helpers/_resources.py b/singer_sdk/helpers/_resources.py index 02f7b30ff..980fdc0f9 100644 --- a/singer_sdk/helpers/_resources.py +++ b/singer_sdk/helpers/_resources.py @@ -1,6 +1,6 @@ from __future__ import annotations -import sys +import importlib.resources import typing as t if t.TYPE_CHECKING: @@ -8,11 +8,6 @@ from singer_sdk.helpers._compat import Traversable -if sys.version_info < (3, 10): - import importlib_resources -else: - import importlib.resources as importlib_resources - def get_package_files(package: str | ModuleType) -> Traversable: """Load a file from a package. @@ -24,4 +19,4 @@ def get_package_files(package: str | ModuleType) -> Traversable: Returns: The file as a Traversable object. """ - return importlib_resources.files(package) + return importlib.resources.files(package) diff --git a/singer_sdk/testing/templates.py b/singer_sdk/testing/templates.py index 302fc7efd..8a21f639c 100644 --- a/singer_sdk/testing/templates.py +++ b/singer_sdk/testing/templates.py @@ -3,10 +3,10 @@ from __future__ import annotations import contextlib +import importlib.resources import typing as t import warnings -from singer_sdk.helpers._compat import importlib_resources from singer_sdk.testing import target_test_streams if t.TYPE_CHECKING: @@ -337,4 +337,4 @@ def singer_filepath(self) -> Traversable: Returns: The expected Path to this tests singer file. """ - return importlib_resources.files(target_test_streams) / f"{self.name}.singer" + return importlib.resources.files(target_test_streams) / f"{self.name}.singer"