Fix dependency conflicts and update to FastAPI 0.100.x

- Update FastAPI from 0.96.x to 0.100.x to support Pydantic 2.x
- Update uvicorn from 0.22.x to 0.23.x for compatibility
- Update Pydantic model configurations to use model_config instead of Config class
- Keep Pydantic 2.x version as required by the project
This commit is contained in:
Automated Action 2025-05-27 19:01:24 +00:00
parent 493289730d
commit 2ea89c98f5
3 changed files with 20 additions and 14 deletions

View File

@ -18,8 +18,9 @@ class NewsSource(NewsSourceBase):
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True
model_config = {
"from_attributes": True
}
class NewsCategoryBase(BaseModel):
@ -35,8 +36,9 @@ class NewsCategory(NewsCategoryBase):
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True
model_config = {
"from_attributes": True
}
class NewsArticleBase(BaseModel):
@ -72,8 +74,9 @@ class NewsArticle(NewsArticleBase):
source: Optional[NewsSource] = None
category: Optional[NewsCategory] = None
class Config:
from_attributes = True
model_config = {
"from_attributes": True
}
class SavedArticleBase(BaseModel):
@ -92,8 +95,9 @@ class SavedArticle(SavedArticleBase):
updated_at: datetime
article: Optional[NewsArticle] = None
class Config:
from_attributes = True
model_config = {
"from_attributes": True
}
class UserPreferenceBase(BaseModel):
@ -118,8 +122,9 @@ class UserPreference(UserPreferenceBase):
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True
model_config = {
"from_attributes": True
}
# For API responses

View File

@ -25,8 +25,9 @@ class UserInDBBase(UserBase):
created_at: Optional[datetime] = None
updated_at: Optional[datetime] = None
class Config:
from_attributes = True
model_config = {
"from_attributes": True
}
class User(UserInDBBase):

View File

@ -1,5 +1,5 @@
fastapi>=0.96.0,<0.97.0
uvicorn>=0.22.0,<0.23.0
fastapi>=0.100.0,<0.101.0
uvicorn>=0.23.0,<0.24.0
pydantic>=2.0.0,<3.0.0
pydantic-settings>=2.0.0,<3.0.0
sqlalchemy>=2.0.0,<3.0.0