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

fix: support pydantic 2.7.0 #176

Merged
merged 4 commits into from
Apr 12, 2024
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.3.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
rev: v0.3.4
hooks:
- id: ruff
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.8.0'
rev: 'v1.9.0'
hooks:
- id: mypy
additional_dependencies: [pydantic, types-requests, types-pytz, types-setuptools, types-urllib3, StrEnum]
5 changes: 1 addition & 4 deletions horde_sdk/ai_horde_api/apimodels/workers/_workers_all.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from collections.abc import Iterator
from typing import ClassVar

from pydantic import AliasChoices, ConfigDict, Field, RootModel
from pydantic import AliasChoices, Field, RootModel
from typing_extensions import override

from horde_sdk.ai_horde_api.apimodels.base import BaseAIHordeRequest
Expand Down Expand Up @@ -130,8 +129,6 @@ def __hash__(self) -> int:


class AllWorkersDetailsResponse(HordeResponse, RootModel[list[WorkerDetailItem]]):
model_config: ClassVar[ConfigDict] = {}

# @tazlin: The typing of __iter__ in BaseModel seems to assume that RootModel wouldn't also be a parent class.
# without a `type: ignore``, mypy feels that this is a bad override. This is probably a sub-optimal solution
# on my part with me hoping to come up with a more elegant path in the future.
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ tests = ["*.json"]

[tool.ruff]
line-length = 119
exclude = ["codegen"]

[tool.ruff.lint]
select = [
"A",
"I",
Expand Down Expand Up @@ -70,9 +73,8 @@ ignore = [
"D408",
"D409",
"D413",]
exclude = ["codegen"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"conftest.py" = ["E402"]

Expand Down
12 changes: 6 additions & 6 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pytest==8.0.0
mypy==1.8.0
black==24.2.0
ruff==0.2.1
tox~=4.12.1
pre-commit~=3.6.1
pytest==8.1.1
mypy==1.9.0
black==24.3.0
ruff==0.3.4
tox~=4.14.2
pre-commit~=3.7.0
build>=0.10.0
coverage>=7.2.7

Expand Down
Loading