Skip to content

Commit

Permalink
chore: Dropped support for Python 3.8 (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Nov 3, 2024
1 parent 31db7f7 commit 61e0eca
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 18 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
matrix:
script: ["test:integration"]
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand Down
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -36,7 +35,6 @@ dynamic = [
"version",
]
dependencies = [
"importlib-resources; python_version<'3.9'",
"singer-sdk~=0.41.0",
]
optional-dependencies.dev = [
Expand Down Expand Up @@ -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]
Expand Down
15 changes: 5 additions & 10 deletions tap_checkly/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]


Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 61e0eca

Please sign in to comment.