Skip to content

Commit

Permalink
Fix py39 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Marques committed Jul 14, 2024
1 parent 9fc887b commit 083722c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ env3.*
env
docs_build
site_build
venv
.venv
venv*
.venv*
docs.zip
archive.zip
pytest.log
Expand Down
16 changes: 9 additions & 7 deletions pydantic_settings_aws/models.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
from typing import Optional

from pydantic import BaseModel, ConfigDict, Field


class AwsSecretsArgs(BaseModel):
model_config = ConfigDict(populate_by_name=True)

secrets_name: str = Field(..., alias="SecretId")
secrets_version: str | None = Field(None, alias="VersionId")
secrets_stage: str | None = Field(None, alias="VersionStage")
secrets_version: Optional[str] = Field(None, alias="VersionId")
secrets_stage: Optional[str] = Field(None, alias="VersionStage")


class AwsSession(BaseModel):
model_config = ConfigDict(populate_by_name=True)

aws_region: str | None = Field(None, alias="region_name")
aws_profile: str | None = Field(None, alias="profile_name")
aws_access_key_id: str | None = None
aws_secret_access_key: str | None = None
aws_session_token: str | None = None
aws_region: Optional[str] = Field(None, alias="region_name")
aws_profile: Optional[str] = Field(None, alias="profile_name")
aws_access_key_id: Optional[str] = None
aws_secret_access_key: Optional[str] = None
aws_session_token: Optional[str] = None
2 changes: 1 addition & 1 deletion tests/boto3_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ def get_secret_value(self, SecretId=None, VersionId=None, VersionStage=None):
"VersionStages": [
"string",
],
"CreatedDate": datetime.datetime.now(datetime.UTC)
"CreatedDate": datetime.datetime.utcnow()
}

0 comments on commit 083722c

Please sign in to comment.