File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " twitter_openapi_python"
3- version = " 0.0.12 "
3+ version = " 0.0.13 "
44description = " Twitter OpenAPI"
55authors = [
" fa0311 <[email protected] >" ]
66license = " proprietary" # or "AGPL-3.0-only"
@@ -12,7 +12,7 @@ include = ["twitter_openapi_python/py.typed"]
1212
1313[tool .poetry .dependencies ]
1414python = " ^3.7"
15- pydantic = " ^1.10.5, <2 "
15+ pydantic = " >=2.6 "
1616
1717twitter-openapi-python-generated = " 0.0.7"
1818
Original file line number Diff line number Diff line change 77PYTHON_REQUIRES = ">=3.7"
88REQUIRES = [
99 "twitter_openapi_python_generated == 0.0.6" ,
10- "pydantic >= 1.10.5, < 2 " ,
10+ "pydantic >= 2.6 " ,
1111]
1212
1313setup (
Original file line number Diff line number Diff line change 33# flake8: noqa
44
55
6- from twitter_openapi_python .models .base import BaseModel , GenericModel
6+ from twitter_openapi_python .models .base import BaseModel
77from twitter_openapi_python .models .header import ApiUtilsHeader
88from twitter_openapi_python .models .initial_state import (
99 InitialStateApiUtilsRaw ,
Original file line number Diff line number Diff line change 1- from pydantic import BaseModel as PydanticBaseModel
2- from pydantic .generics import GenericModel as PydanticGenericModel
1+ from typing import TypeVar
32
3+ from pydantic import BaseModel as PydanticBaseModel
44
5- class BaseModel (PydanticBaseModel ):
6- class Config :
7- arbitrary_types_allowed = True
5+ T = TypeVar ("T" )
86
97
10- class GenericModel (PydanticGenericModel ):
11- class Config :
12- arbitrary_types_allowed = True
8+ class BaseModel (PydanticBaseModel ):
9+ model_config = {"arbitrary_types_allowed" : True }
Original file line number Diff line number Diff line change 33import twitter_openapi_python_generated as twitter
44from pydantic import Field
55
6- from twitter_openapi_python .models import ApiUtilsHeader , BaseModel , GenericModel
6+ from twitter_openapi_python .models import ApiUtilsHeader , BaseModel
77
88T1 = TypeVar ("T1" )
99T2 = TypeVar ("T2" )
@@ -13,7 +13,7 @@ class TwitterApiUtilsRaw(BaseModel):
1313 response : twitter .ApiResponse = Field ()
1414
1515
16- class TwitterApiUtilsResponse (GenericModel , Generic [T1 ]):
16+ class TwitterApiUtilsResponse (BaseModel , Generic [T1 ]):
1717 raw : TwitterApiUtilsRaw = Field ()
1818 data : T1 = Field ()
1919 header : ApiUtilsHeader = Field ()
Original file line number Diff line number Diff line change 44import twitter_openapi_python_generated .models as models
55from pydantic import Field
66
7- from twitter_openapi_python .models import BaseModel , GenericModel
7+ from twitter_openapi_python .models import BaseModel
88
99T = TypeVar ("T" )
1010
@@ -34,7 +34,7 @@ class UserApiUtilsData(BaseModel):
3434 user : models .User = Field ()
3535
3636
37- class TimelineApiUtilsResponse (GenericModel , Generic [T ]):
37+ class TimelineApiUtilsResponse (BaseModel , Generic [T ]):
3838 raw : ApiUtilsRaw = Field ()
3939 cursor : CursorApiUtilsResponse = Field ()
4040 data : List [T ] = Field (default_factory = list )
You can’t perform that action at this time.
0 commit comments