Skip to content

Commit

Permalink
Fix formatting; publish.
Browse files Browse the repository at this point in the history
  • Loading branch information
erhosen committed Feb 26, 2023
1 parent 398eaa5 commit 8befdef
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
args: [--line-length=110, --skip-string-normalization]
Expand All @@ -25,6 +25,6 @@ repos:
- id: debug-statements

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.0.1
hooks:
- id: mypy
2 changes: 1 addition & 1 deletion pydjantic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydjantic.pydjantic import BaseDBConfig, to_django

__version__ = "0.10.0"
__version__ = "0.11.0"

__all__ = ("BaseDBConfig", "to_django")
8 changes: 7 additions & 1 deletion pydjantic/pydjantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ def format_config_from_dsn(cls, value: Optional[str], field: ModelField):
kwargs = {}
# dj_database_url.parse does not accept **kwargs, so we can't blindly feed it with everything
# https://github.com/jazzband/dj-database-url/blob/master/dj_database_url.py#L79
known_dj_database_url_kwargs = ['engine', 'conn_max_age', 'conn_health_checks', 'ssl_require', 'test_options']
known_dj_database_url_kwargs = [
'engine',
'conn_max_age',
'conn_health_checks',
'ssl_require',
'test_options',
]
for kwarg in known_dj_database_url_kwargs:
field_extra = field.field_info.extra.get(kwarg)
if field_extra is not None:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pydjantic"
version = "0.10.0"
version = "0.11.0"
description = "Pydantic Settings for Django"
authors = ["Vladimir Vyazovetskov <[email protected]>"]
license = "MIT"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_db_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class DatabaseConfig(BaseDBConfig):
'PASSWORD': 'password',
'PORT': 5432,
'USER': 'user',
'TEST': {'NAME': 'mytestdb'}
'TEST': {'NAME': 'mytestdb'},
}


Expand Down Expand Up @@ -85,7 +85,7 @@ class DatabaseConfig(BaseSettings):
'PORT': 5432,
'OPTIONS': {},
'CONN_MAX_AGE': 0,
'CONN_HEALTH_CHECKS': False
'CONN_HEALTH_CHECKS': False,
}
}

Expand Down Expand Up @@ -143,6 +143,6 @@ class DatabaseConfig(BaseSettings):
'PORT': 5432,
'OPTIONS': {'sslmode': 'require'},
'CONN_MAX_AGE': 60,
'CONN_HEALTH_CHECKS': False
'CONN_HEALTH_CHECKS': False,
},
}

0 comments on commit 8befdef

Please sign in to comment.