From 61e0eca0e2d10c4bc733af45dbbacdbb03f726c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= <16805946+edgarrmondragon@users.noreply.github.com> Date: Sun, 3 Nov 2024 10:04:24 -0600 Subject: [PATCH] chore: Dropped support for Python 3.8 (#267) --- .github/workflows/test.yml | 1 - .gitignore | 27 +++++++++++++++++++++++++++ .pre-commit-config.yaml | 6 +++--- pyproject.toml | 5 +---- tap_checkly/client.py | 15 +++++---------- 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fd17b9..a7820d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,6 @@ jobs: matrix: script: ["test:integration"] python-version: - - "3.8" - "3.9" - "3.10" - "3.11" diff --git a/.gitignore b/.gitignore index 9dc53db..f08c0b7 100644 --- a/.gitignore +++ b/.gitignore @@ -131,3 +131,30 @@ dmypy.json # Pyre type checker .pyre/ + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 41bdc5f..30e2b52 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,18 +17,18 @@ repos: - id: trailing-whitespace - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.2.4" + rev: "v2.5.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.6.9" + rev: "v0.7.2" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] - id: ruff-format - repo: https://github.com/pre-commit/pre-commit - rev: v4.0.0 + rev: v4.0.1 hooks: - id: validate_manifest diff --git a/pyproject.toml b/pyproject.toml index dfe3fe9..077620b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,11 +21,10 @@ maintainers = [ authors = [ { name = "Edgar Ramírez-Mondragón", email = "edgarrm358@gmail.com" }, ] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -36,7 +35,6 @@ dynamic = [ "version", ] dependencies = [ - "importlib-resources; python_version<'3.9'", "singer-sdk~=0.41.0", ] optional-dependencies.dev = [ @@ -133,7 +131,6 @@ lint.isort.required-imports = [ lint.pydocstyle.convention = "google" [tool.deptry.package_module_name_map] -importlib-resources = "importlib_resources" mypy = "mypy" [tool.deptry.per_rule_ignores] diff --git a/tap_checkly/client.py b/tap_checkly/client.py index 535933c..f3a40d2 100644 --- a/tap_checkly/client.py +++ b/tap_checkly/client.py @@ -2,35 +2,30 @@ from __future__ import annotations +import importlib.resources import json -import sys import typing as t from abc import ABCMeta, abstractmethod -from functools import lru_cache +from functools import cache from singer_sdk import RESTStream from singer_sdk._singerlib import resolve_schema_references from singer_sdk.authenticators import BearerTokenAuthenticator -if sys.version_info >= (3, 9): - import importlib.resources as importlib_resources -else: - import importlib_resources - if t.TYPE_CHECKING: from singer_sdk.helpers.types import Context PAGE_SIZE = 100 -@lru_cache(maxsize=None) +@cache def load_openapi() -> dict[str, t.Any]: """Load the OpenAPI specification from the package. Returns: The OpenAPI specification as a dict. """ - with importlib_resources.files("tap_checkly").joinpath("openapi.json").open() as f: + with importlib.resources.files("tap_checkly").joinpath("openapi.json").open() as f: return json.load(f) # type: ignore[no-any-return] @@ -94,7 +89,7 @@ def _resolve_openapi_ref(self) -> dict[str, t.Any]: return resolve_schema_references(schema) @property - @lru_cache(maxsize=None) # noqa: B019 + @cache # noqa: B019 def schema(self) -> dict[str, t.Any]: """Return the schema for this stream.