Skip to content

Commit

Permalink
Merge pull request #176 from Haidra-Org/main
Browse files Browse the repository at this point in the history
fix: support pydantic 2.7.0
  • Loading branch information
tazlin authored Apr 12, 2024
2 parents 810a02c + cbc91f2 commit df21d59
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
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

0 comments on commit df21d59

Please sign in to comment.