Skip to content
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/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ repos:
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py39-plus, --keep-runtime-typing]
args: [--py311-plus, --keep-runtime-typing]

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.38.0
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies = [
"ijson",
"jsonseq",
]
requires-python = ">=3.10"
requires-python = ">=3.11"
readme = "README.md"
license = {text = "BSD-3-Clause"}
classifiers = [
Expand All @@ -37,7 +37,6 @@ classifiers = [
"Typing :: Typed",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down
4 changes: 0 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ dnspython==2.8.0
# via email-validator
email-validator==2.3.0
# via aiopenapi3
exceptiongroup==1.3.1 ; python_full_version < '3.11' and sys_platform != 'emscripten'
# via anyio
h11==0.16.0 ; sys_platform != 'emscripten'
# via httpcore2
httpcore2==2.13.1 ; sys_platform != 'emscripten'
Expand Down Expand Up @@ -51,9 +49,7 @@ typing-extensions==4.16.0
# via
# aiopenapi3
# anyio
# exceptiongroup
# httpx2
# multidict
# pydantic
# pydantic-core
# typing-inspection
Expand Down
4 changes: 2 additions & 2 deletions src/aiopenapi3/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ def cmd_validate(args: argparse.Namespace) -> None:
loader = loader_prepare(args, session_factory)

try:
begin = datetime.datetime.now(tz=datetime.timezone.utc)
begin = datetime.datetime.now(tz=datetime.UTC)
try:
api = OpenAPI.load_file(args.input, yarl.URL(args.input), plugins=plugins, loader=loader)
except aiopenapi3.errors.ReferenceResolutionError as e0:
print(f"{e0} {e0.document} {e0.element}")
return
end = datetime.datetime.now(tz=datetime.timezone.utc)
end = datetime.datetime.now(tz=datetime.UTC)
duration = end - begin
except ValueError:
logg.exception("error")
Expand Down
11 changes: 0 additions & 11 deletions src/aiopenapi3/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import inspect
import logging
import re
import sys
import typing
from typing import Annotated, Any, ClassVar, Literal, Optional, TypeGuard, TypeVar, Union, cast

Expand Down Expand Up @@ -86,16 +85,6 @@ def is_basemodel(m) -> bool:
return bool(inspect.isclass(m) and issubclass(m, pydantic.BaseModel))


if sys.version_info < (3, 11):
# pyupgrade 311-plus will remove this
# https://github.com/asottile/pyupgrade/issues/967
def is_basemodel(m) -> bool:
if isinstance(m, typing.GenericAlias):
return False

return bool(inspect.isclass(m) and issubclass(m, pydantic.BaseModel))


@dataclasses.dataclass
class _ClassInfo:
@dataclasses.dataclass
Expand Down
9 changes: 1 addition & 8 deletions src/aiopenapi3/v32/media.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import sys

if sys.version_info < (3, 12):
from typing import Any

from typing_extensions import Self
else:
from typing import Any, Self
from typing import Any, Self

from pydantic import Field

Expand Down
2 changes: 1 addition & 1 deletion tests/forms_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ async def test_DateTime(server, client, form_type):
cls = client._.datetime.operation.requestBody.content[form_type].schema_.get_type()
t = (2026, 8, 29, 15, 4, 22, 32582)
dtl = datetime.datetime(*t) # noqa: DTZ001
dt = dtl.astimezone(datetime.timezone.utc)
dt = dtl.astimezone(datetime.UTC)

data = cls(time=dt.time(), date=dt.date(), datetime=dt, datetimelocal=dtl)

Expand Down
2 changes: 1 addition & 1 deletion tests/plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ def test_Plugins(httpx2_mock, with_plugin_base):
assert item.id == 3
assert item.weight is None # default does not apply as it it unsed
assert item.color == "red" # default does not apply
assert item.created == datetime.datetime.fromtimestamp(4711, tz=datetime.timezone.utc)
assert item.created == datetime.datetime.fromtimestamp(4711, tz=datetime.UTC)
6 changes: 2 additions & 4 deletions tests/schema_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import copy
import typing
import uuid
from datetime import datetime
from datetime import UTC, datetime
from pathlib import Path

import httpx2
Expand Down Expand Up @@ -793,9 +793,7 @@ def test_schema_date_types(with_schema_date_types):
Number = api.components.schemas["Number"].get_type()
String = api.components.schemas["String"].get_type()

from datetime import timezone

now = datetime.now(tz=timezone.utc)
now = datetime.now(tz=UTC)
ts = now.timestamp()
v = Integer.model_validate(c := int(ts))
assert isinstance(v.root, datetime)
Expand Down
Loading
Loading