Skip to content

Commit

Permalink
Upgrade pydantic to v2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
hongquan committed Sep 13, 2024
1 parent 634749e commit 01c903e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Model(BaseModel):
data = {"foo": "Cat"}

try:
Model.parse_obj(data)
Model.model_validate(data)
except ValidationError as e:
print(drf_error_details(e))
```
Expand Down
2 changes: 1 addition & 1 deletion pyngo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Pydantic Package for Adding Models into a Django or Django Rest Framework Project"""

__version__ = "2.2.0"
__version__ = "2.2.1"

from .errors import drf_error_details
from .openapi import ParameterDict, openapi_params
Expand Down
14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ classifiers = [

dependencies = [
"typing-extensions >=3.7.4,<4.13.0",
"pydantic>=2.8.2,<2.9.0",
"pydantic>=2.8.2,<2.10.0",
"Django >=3.2.0,<6.0.0",
]

Expand All @@ -51,7 +51,7 @@ Funding = 'https://github.com/sponsors/yezz123'
lint = [
"pre-commit==3.8.0",
"mypy==1.11.2",
"ruff==0.6.2",
"ruff==0.6.4",
]
test = [
"pytest==8.3.2",
Expand All @@ -67,7 +67,8 @@ path = "pyngo/__init__.py"

[tool.ruff]
line-length = 120
mccabe = { max-complexity = 14 }

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
Expand All @@ -81,14 +82,15 @@ ignore = [
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]
mccabe = { max-complexity = 14 }

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

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-third-party = ["pydantic", "typing_extensions"]

[tool.ruff.pyupgrade]
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true

[tool.coverage.run]
Expand Down

0 comments on commit 01c903e

Please sign in to comment.