Skip to content

Commit

Permalink
Merge pull request #25 from mmzeynalli/support/drop-py3.8
Browse files Browse the repository at this point in the history
Dropped python 3.8 support
  • Loading branch information
mmzeynalli authored Jan 15, 2025
2 parents 668c934 + aa53786 commit 52e6db9
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 40 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
exclude:
# Python 3.8 and 3.9 are not available on macOS 14
# Python 3.9 is not available on macOS 14
- os: macos-13
python-version: '3.10'
- os: macos-13
python-version: '3.11'
- os: macos-13
python-version: '3.12'
- os: macos-latest
python-version: '3.8'
- os: macos-latest
python-version: '3.9'
defaults:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,5 @@ cython_debug/
# User Defined
test.py
*.lcov
site
site
.aider*
26 changes: 6 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"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 @@ -43,7 +42,7 @@ classifiers = [
]

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
pydantic = "^2.8.2"
httpx = "^0.27.2"

Expand All @@ -55,37 +54,24 @@ optional = true
pytest = "^8.1.1"
pytest-mock = "^3.14.0"
smokeshow = "^0.4.0"
coverage = [
{ version = "^7.6.3", python = ">=3.9" },
{ version = "7.6.1", python = "3.8" }
]
coverage = "^7.6.3"

[tool.poetry.group.dev.dependencies]
pytest = "^8.1.1"
pytest-mock = "^3.14.0"
mypy = "^1.9.0"
ruff = "^0.3.5"
pre-commit = [
{ version = "^3.8.0", python = ">=3.9" },
{ version = "^3.5.0", python = "3.8" }
]
pre-commit = "^3.8.0"
ptpython = "^3.0.29"
bandit = "^1.7.10"
coverage = [
{ version = "^7.6.3", python = ">=3.9" },
{ version = "7.6.1", python = "3.8" }
]
pylint = [
{ version = "^3.3.1", python = ">=3.9" },
]
coverage = "^7.6.3"
pylint = "^3.3.1"

[tool.poetry.group.docs.dependencies]
mkdocs-material = {extras = ["imaging"], version = "^9.5.36"}
mkdocstrings = {extras = ["python"], version = "^0.26.1"}
mkdocs-panzoom-plugin = "^0.1.3"
griffe-pydantic = [
{ version = "^1.0.0", python = ">=3.9" },
]
griffe-pydantic = "^1.0.0"

[tool.ruff]
target-version = "py38"
Expand Down
10 changes: 5 additions & 5 deletions src/integrify/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import string
from functools import cached_property
from typing import Any, Callable, Coroutine, Optional, Type, Union
from typing import Any, Callable, Coroutine, Optional, Union
from urllib.parse import urljoin

import httpx
Expand Down Expand Up @@ -60,15 +60,15 @@ def add_url(self, route_name: str, url: str, verb: str, base_url: Optional[str]
if base_url:
self.urls[route_name]['base_url'] = base_url

def set_default_handler(self, handler_class: Type['APIPayloadHandler']) -> None:
def set_default_handler(self, handler_class: type['APIPayloadHandler']) -> None:
"""Sorğulara default handler setter-i
Args:
handler_class: Default handler class-ı
"""
self.default_handler = handler_class() # pragma: no cover

def add_handler(self, route_name: str, handler_class: Type['APIPayloadHandler']) -> None:
def add_handler(self, route_name: str, handler_class: type['APIPayloadHandler']) -> None:
"""Endpoint-ə handler əlavə etmək method-u
Args:
Expand Down Expand Up @@ -107,8 +107,8 @@ class APIPayloadHandler:

def __init__(
self,
req_model: Optional[Type[PayloadBaseModel]] = None,
resp_model: Optional[Type[_ResponseT]] = None,
req_model: Optional[type[PayloadBaseModel]] = None,
resp_model: Optional[type[_ResponseT]] = None,
):
"""
Args:
Expand Down
3 changes: 1 addition & 2 deletions src/integrify/epoint/handlers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import base64
import json
from typing import Type

import httpx

Expand Down Expand Up @@ -32,7 +31,7 @@


class BasePayloadHandler(APIPayloadHandler):
def __init__(self, req_model: Type[PayloadBaseModel], resp_model: Type[_ResponseT]):
def __init__(self, req_model: type[PayloadBaseModel], resp_model: type[_ResponseT]):
super().__init__(req_model, resp_model)

def pre_handle_payload(self, *args, **kwds):
Expand Down
7 changes: 1 addition & 6 deletions src/integrify/epoint/helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import base64
import json
import sys
from functools import partial
from hashlib import sha1

Expand All @@ -9,11 +8,7 @@

__all__ = ['generate_signature', 'decode_callback_data']

# Python 3.8 support
if sys.version_info >= (3, 9):
_sha1 = partial(sha1, usedforsecurity=False)
else:
_sha1 = sha1 # pragma: no cover
_sha1 = partial(sha1, usedforsecurity=False)


def generate_signature(data: str) -> str:
Expand Down
4 changes: 2 additions & 2 deletions src/integrify/schemas.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from enum import Enum
from typing import ClassVar, Generic, Set, TypeVar, Union
from typing import ClassVar, Generic, TypeVar, Union

from pydantic import BaseModel, Field, field_validator

Expand Down Expand Up @@ -37,7 +37,7 @@ def convert_to_dict(cls, v: Union[str, bytes]):


class PayloadBaseModel(BaseModel):
URL_PARAM_FIELDS: ClassVar[Set[str]] = set()
URL_PARAM_FIELDS: ClassVar[set[str]] = set()

@classmethod
def from_args(cls, *args, **kwds):
Expand Down

0 comments on commit 52e6db9

Please sign in to comment.