Skip to content

Commit

Permalink
Update dependency pydantic to v2.10.1 (#13)
Browse files Browse the repository at this point in the history
* Update dependency pydantic to v2.10.0

* Chore(): Websockets version pinning

* Chore(Lint): Fix linting issues

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: ali ugur <[email protected]>
  • Loading branch information
renovate[bot] and alithethird authored Nov 25, 2024
1 parent a19233c commit ab551f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cosl
jsonschema >=4.19,<4.20
ops >= 2.6
pydantic==2.9.2
pydantic==2.10.0
2 changes: 1 addition & 1 deletion src/paas_charm/django/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DjangoConfig(FrameworkConfig):

debug: bool | None = Field(alias="django-debug", default=None)
secret_key: str | None = Field(alias="django-secret-key", default=None, min_length=1)
allowed_hosts: str | None = Field(alias="django-allowed-hosts", default=[])
allowed_hosts: str | list[str] | None = Field(alias="django-allowed-hosts", default=[])

model_config = ConfigDict(extra="ignore")

Expand Down
6 changes: 4 additions & 2 deletions src/paas_charm/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ def secret_key_id(cls, data: dict[str, str | int | bool | dict[str, str] | None]
"""
# Bandit thinks the following are secrets which they are not
secret_key_field = "secret_key" # nosec B105
if secret_key_field not in cls.model_fields:
# Mypy thinks model_fields does not have get attribute
if not cls.model_fields.get(secret_key_field, None): # type: ignore
secret_key_field = "app_secret_key" # nosec B105
secret_key_config_name = cls.model_fields[secret_key_field].alias
# Mypy thinks model_fields does not have get attribute
secret_key_config_name = cls.model_fields.get(secret_key_field).alias # type: ignore
if not secret_key_config_name:
raise NotImplementedError("framework configuration secret_key field has no alias")
secret_key_id_config_name = f"{secret_key_config_name}-id"
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ deps =
cosl
boto3
juju==3.5.2.0
websockets<14.0 # https://github.com/juju/python-libjuju/issues/1184
git+https://github.com/canonical/saml-test-idp.git
-r{toxinidir}/requirements.txt
-r{toxinidir}/tests/integration/flask/requirements.txt
Expand Down

0 comments on commit ab551f2

Please sign in to comment.