File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ dependencies = [
1212 " SQLAlchemy[asyncio]<2.1.0,>=2.0.0" ,
1313 " SQLAlchemy-Utils" ,
1414 " anyio>=3.0.0,<4" ,
15- " pydantic~=1.10.13 " ,
15+ " pydantic~=2.5.3 " ,
1616 " tenacity~=8.0.1" ,
1717 " sqlapagination" ,
1818 " exceptiongroup" ,
@@ -63,7 +63,15 @@ excludes = [
6363[tool .pytest .ini_options ]
6464addopts = " -rsx --tb=short --loop-scope session"
6565testpaths = [" tests" ]
66- filterwarnings = [" error" ]
66+ filterwarnings = [
67+ " error" ,
68+ # Several pending fixes to be a well-behaved pydantic 2.0 user
69+ " ignore:.*The `parse_obj` method is deprecated.*:pydantic.warnings.PydanticDeprecatedSince20" ,
70+ " ignore:.*The `dict` method is deprecated; use `model_dump` instead.*:pydantic.warnings.PydanticDeprecatedSince20" ,
71+ " ignore:.*Support for class-based `config` is deprecated, use ConfigDict instead.*:pydantic.warnings.PydanticDeprecatedSince20" ,
72+ " ignore:.*Pydantic V1 style `@root_validator` validators are deprecated.*:pydantic.warnings.PydanticDeprecatedSince20" ,
73+ " ignore:.*Field .* has conflict with protected namespace \" model_\" .*:UserWarning" ,
74+ ]
6775asyncio_mode = " auto"
6876py311_task = true
6977log_cli = true
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ class EngineConfig(ConfigBase):
138138 def default (cls ):
139139 return cls (url = "sqlite://" )
140140
141- @root_validator
141+ @root_validator ( pre = True )
142142 def apply_driver_defaults (cls , values ):
143143 url = sa .make_url (values ["url" ])
144144 driver = url .drivername
@@ -221,15 +221,15 @@ class BindConfig(ConfigBase):
221221 session : SessionmakerOptions = Field (default_factory = SessionmakerOptions .default )
222222 engine : EngineConfig = Field (default_factory = EngineConfig .default )
223223
224- @root_validator
224+ @root_validator ( pre = True )
225225 def validate_dialect (cls , values ):
226226 return validate_dialect (cls , values , "sync" )
227227
228228
229229class AsyncBindConfig (BindConfig ):
230230 session : AsyncSessionmakerOptions = Field (default_factory = AsyncSessionmakerOptions .default )
231231
232- @root_validator
232+ @root_validator ( pre = True )
233233 def validate_dialect (cls , values ):
234234 return validate_dialect (cls , values , "async" )
235235
You can’t perform that action at this time.
0 commit comments