Skip to content

Commit

Permalink
✨ Upgrade pyngo to use Pydantic to v2.9 (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongquan committed Sep 13, 2024
1 parent feac687 commit 88f0acd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 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
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 88f0acd

Please sign in to comment.