diff --git a/linter-requirements.txt b/linter-requirements.txt index c262708..b25090e 100644 --- a/linter-requirements.txt +++ b/linter-requirements.txt @@ -1,5 +1,5 @@ bandit==1.7.7 -black==23.12.1 +black==24.1.1 flake8==7.0.0 isort==5.13.2 pydocstyle[toml]==6.3.0 diff --git a/pictures/models.py b/pictures/models.py index e923869..00192a2 100644 --- a/pictures/models.py +++ b/pictures/models.py @@ -44,9 +44,11 @@ def url(self) -> str: kwargs={ "alt": Path(self.parent_name).stem, "width": self.width, - "ratio": f"{self.aspect_ratio.numerator}x{self.aspect_ratio.denominator}" - if self.aspect_ratio - else None, + "ratio": ( + f"{self.aspect_ratio.numerator}x{self.aspect_ratio.denominator}" + if self.aspect_ratio + else None + ), "file_type": self.file_type, }, ) diff --git a/pictures/utils.py b/pictures/utils.py index 646f11d..a80f55d 100644 --- a/pictures/utils.py +++ b/pictures/utils.py @@ -41,7 +41,11 @@ def _media_query(*, container_width: int = None, **breakpoints: {str: int}): prev_width = width prev_ratio = ratio if prev_ratio: - yield f"{math.floor(prev_ratio * container_width)}px" if container_width else f"{math.floor(prev_ratio * 100)}vw" + yield ( + f"{math.floor(prev_ratio * container_width)}px" + if container_width + else f"{math.floor(prev_ratio * 100)}vw" + ) else: warnings.warn( "Your container is smaller than all your breakpoints.", UserWarning diff --git a/tests/testapp/settings.py b/tests/testapp/settings.py index cddc9b2..087a0e2 100644 --- a/tests/testapp/settings.py +++ b/tests/testapp/settings.py @@ -9,6 +9,7 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ + import os from pathlib import Path