From b3aaa8434feba97f243393b750d73a33f692c1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Wed, 17 Jul 2024 20:10:00 -0600 Subject: [PATCH] Address broken `importlib.resources` in Python 3.9 --- poetry.lock | 2 +- pyproject.toml | 2 +- singer_sdk/helpers/_resources.py | 2 +- singer_sdk/metrics.py | 6 +----- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/poetry.lock b/poetry.lock index 92ea330cd..73a4db60d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2620,4 +2620,4 @@ testing = ["pytest", "pytest-durations"] [metadata] lock-version = "2.0" python-versions = ">=3.8" -content-hash = "91c9f418561bf500a204fa69295a5bb8b66da5b01ea1b77c397d38cb3b749ac4" +content-hash = "6a6acd1298eca878a1a7e0dc47decdb156fdc8eb6622dbba1e6b5422e190cecd" diff --git a/pyproject.toml b/pyproject.toml index dcf67b2e8..eae7ecd64 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ backports-datetime-fromisoformat = { version = ">=2.0.1", python = "<3.11" } click = "~=8.0" fs = ">=2.4.16" importlib-metadata = {version = "<9.0.0", python = "<3.12"} -importlib-resources = {version = ">=5.12.0,!=6.2.0,!=6.3.0,!=6.3.1", python = "<3.9"} +importlib-resources = {version = ">=5.12.0,!=6.2.0,!=6.3.0,!=6.3.1", python = "<3.10"} inflection = ">=0.5.1" joblib = ">=1.3.0" jsonpath-ng = ">=1.5.3" diff --git a/singer_sdk/helpers/_resources.py b/singer_sdk/helpers/_resources.py index 89b3ed269..02f7b30ff 100644 --- a/singer_sdk/helpers/_resources.py +++ b/singer_sdk/helpers/_resources.py @@ -8,7 +8,7 @@ from singer_sdk.helpers._compat import Traversable -if sys.version_info < (3, 9): +if sys.version_info < (3, 10): import importlib_resources else: import importlib.resources as importlib_resources diff --git a/singer_sdk/metrics.py b/singer_sdk/metrics.py index 1b4612023..50d7d3926 100644 --- a/singer_sdk/metrics.py +++ b/singer_sdk/metrics.py @@ -408,11 +408,7 @@ def _get_default_config_path(package: str) -> Traversable: return path if path.is_file() else get_package_files("singer_sdk") / filename -def _setup_logging( - config: t.Mapping[str, t.Any], - *, - package: str | None = None, -) -> None: +def _setup_logging(config: t.Mapping[str, t.Any], *, package: str) -> None: """Setup logging. Args: