-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate to new verstion of fastAPI with large breaking changes in Pyd…
…antic
- Loading branch information
1 parent
822832b
commit 5330ceb
Showing
28 changed files
with
127 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ flake8==6.0.0 | |
pytest==7.2.1 | ||
httpx==0.23.3 | ||
coverage==7.2.3 | ||
polyfactory==2.0.0 | ||
polyfactory==2.7.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
redis==4.4.4 | ||
fastapi==0.97.0 | ||
uvicorn[standard]==0.20.0 | ||
fastapi==0.101.0 | ||
uvicorn[standard]==0.23.2 | ||
pyjwt[crypto]==2.6.0 | ||
fastapi_mail==1.2.5 | ||
cfenv==0.5.3 | ||
SQLAlchemy==2.0.5.post1 | ||
psycopg2==2.9.5 | ||
alembic==1.10.2 | ||
PyMuPDF==1.21.1 | ||
pydantic-settings==2.0.2 | ||
email-validator==2.0.0.post2 | ||
python-multipart==0.0.6 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
from pydantic import BaseSettings, EmailStr | ||
from typing import Tuple, Type | ||
from pydantic import EmailStr | ||
from typing import Dict, Any | ||
from cfenv import AppEnv | ||
from pydantic_settings import BaseSettings, PydanticBaseSettingsSource, SettingsConfigDict | ||
|
||
|
||
def vcap_services_settings(settings: BaseSettings) -> Dict[str, Any]: | ||
|
@@ -55,7 +57,10 @@ class Settings(BaseSettings): | |
SMTP_USER: str | None | ||
SMTP_SERVER: str | ||
SMTP_PORT: int | ||
EMAIL_FROM: EmailStr = EmailStr("[email protected]") | ||
SMTP_STARTTLS: bool | ||
SMTP_SSL_TLS: bool | ||
|
||
EMAIL_FROM: EmailStr = "[email protected]" | ||
EMAIL_FROM_NAME: str = "GSA SmartPay" | ||
EMAIL_SUBJECT: str = "GSA SmartPay Training" | ||
|
||
|
@@ -74,18 +79,26 @@ class Settings(BaseSettings): | |
AUTH_CLIENT_ID: str | ||
AUTH_AUTHORITY_URL: str | ||
|
||
class Config: | ||
env_file = '.env' | ||
env_file_encoding = 'utf-8' | ||
|
||
@classmethod | ||
def customise_sources(cls, init_settings, env_settings, file_secret_settings): | ||
return ( | ||
init_settings, | ||
env_settings, | ||
file_secret_settings, | ||
vcap_services_settings, | ||
) | ||
model_config = SettingsConfigDict( | ||
env_file='.env', | ||
env_file_encoding='utf-8' | ||
) | ||
|
||
@classmethod | ||
def customise_sources( | ||
cls, | ||
settings_cls: Type[BaseSettings], | ||
init_settings: PydanticBaseSettingsSource, | ||
env_settings: PydanticBaseSettingsSource, | ||
dotenv_settings: PydanticBaseSettingsSource, | ||
file_secret_settings: PydanticBaseSettingsSource | ||
) -> Tuple[PydanticBaseSettingsSource, ...]: | ||
return ( | ||
init_settings, | ||
env_settings, | ||
file_secret_settings, | ||
vcap_services_settings, | ||
) | ||
|
||
|
||
settings = Settings() # type: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
from pydantic import BaseModel | ||
from pydantic import ConfigDict, BaseModel | ||
|
||
|
||
class ReportUserXAgency(BaseModel): | ||
user_id: int | ||
agency_id: int | ||
|
||
class Config: | ||
orm_mode = True | ||
model_config = ConfigDict(from_attributes=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.