Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop python 3.7 support #248

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.7" , "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]

services:
mongodb:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
hooks:
- id: pyupgrade
args:
- --py37-plus
- --py38-plus
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.280
hooks:
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "starlette-admin"
description = "Fast, beautiful and extensible administrative interface framework for Starlette/FastApi applications"
readme = "README.md"
license = "MIT"
requires-python = ">=3.7"
requires-python = ">=3.8"
keywords = ["sqlalchemy", "sqlmodel", "mongoengine", "odmantic", "starlette", "fastapi", "admin", "dashboard", "datatables"]
authors = [
{ name = "Jocelin Hounon", email = "[email protected]" },
Expand Down Expand Up @@ -49,7 +49,7 @@ test = [
"pytest-asyncio >=0.20.2, <0.22.0",
"mypy ==1.4.1",
"ruff ==0.0.280",
"black ==23.3.0",
"black ==23.7.0",
"httpx >=0.23.3, <0.25.0",
"coverage >=7.0.0, <7.3.0",
"SQLAlchemy-Utils >=0.40.0, <0.42.0",
Expand All @@ -58,7 +58,7 @@ test = [
"phonenumbers >=8.13.3, <8.14.0",
"passlib >=1.7.4, <1.8.0",
"backports.zoneinfo; python_version<'3.9'",
"sqlalchemy-file >=0.4.0, <0.5.0",
"sqlalchemy-file >=0.5.0, <0.6.0",
"fasteners ==0.18",
"PyMySQL[rsa] >=1.0.2, <1.2.0",
"psycopg2-binary >=2.9.5, <3.0.0",
Expand Down Expand Up @@ -189,7 +189,7 @@ ignore = [
"E501", # line too long, handled by black
"N818", # Exception {name} should be named with an Error suffix
]
target-version = "py37"
target-version = "py38"

[tool.ruff.isort]
known-third-party = ["starlette_admin"]
Expand All @@ -215,7 +215,6 @@ ignore_missing_imports = true
module = [
"starlette_admin.contrib.sqla.helpers",
"starlette_admin.contrib.sqla.view",
"starlette_admin.converters"
]
warn_unused_ignores = false

Expand Down
2 changes: 1 addition & 1 deletion starlette_admin/contrib/sqla/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def serialize_value(
def _serialize_sqlalchemy_file_library(
request: Request, value: Any, action: RequestAction, is_multiple: bool
) -> Optional[Union[List[Dict[str, Any]], Dict[str, Any]]]:
from sqlalchemy_file import File
from sqlalchemy_file import File # type: ignore[attr-defined]

if isinstance(value, File) or (
isinstance(value, list) and all(isinstance(f, File) for f in value)
Expand Down
11 changes: 2 additions & 9 deletions starlette_admin/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import decimal
import enum
import inspect
import sys
import typing
from abc import abstractmethod
from typing import (
Expand All @@ -12,6 +11,8 @@
Optional,
Sequence,
Type,
get_args,
get_origin,
)

from starlette_admin.exceptions import NotSupportedAnnotation
Expand All @@ -30,14 +31,6 @@
TimeField,
)

if sys.version_info >= (3, 8): # pragma: no cover
from typing import get_args, get_origin
else: # pragma: no cover
try:
from typing_extensions import get_args, get_origin
except ImportError:
get_args, get_origin = None, None # type: ignore[assignment]


def converts(
*args: Any,
Expand Down