From 8ae4c3502846d7d61436201ccaef1b41ac62f8ab Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Sat, 21 Jun 2025 21:04:06 +0300 Subject: [PATCH] Features: 1) Add `yapf` dependency with configuration in `pyproject.toml`; 2) Introduce `readonly_fields` for `uuid` and `slug` in `ProductAdmin`; Fixes: 1) Update `markdown` to 3.8.2 and `pygments` to 2.19.2; Extra: 1) Minor formatting updates in admin path definitions; 2) Update `poetry.lock` for dependency changes. --- core/admin.py | 8 +++++--- poetry.lock | 28 +++++++++++++++++++++------- pyproject.toml | 6 +++++- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/core/admin.py b/core/admin.py index de78b5e3..7713f228 100644 --- a/core/admin.py +++ b/core/admin.py @@ -157,6 +157,10 @@ class BrandAdmin(BasicModelAdmin, TabbedTranslationAdmin): "name", "categories__name", ) + readonly_fields = ( + "uuid", + "slug", + ) class ProductImageInline(TabularInline): @@ -430,9 +434,7 @@ class ConstanceAdmin(BaseConstanceAdmin): self.admin_site.admin_view(self.changelist_view), name=f"{info}_changelist", ), - path( - "", self.admin_site.admin_view(self.changelist_view), name=f"{info}_add" - ), + path("", self.admin_site.admin_view(self.changelist_view), name=f"{info}_add"), ] diff --git a/poetry.lock b/poetry.lock index d1edc2e6..5c6b8ddb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2853,13 +2853,13 @@ source = ["Cython (>=3.0.11,<3.1.0)"] [[package]] name = "markdown" -version = "3.8.1" +version = "3.8.2" description = "Python implementation of John Gruber's Markdown." optional = false python-versions = ">=3.9" files = [ - {file = "markdown-3.8.1-py3-none-any.whl", hash = "sha256:46cc0c0f1e5211ab2e9d453582f0b28a1bfaf058a9f7d5c50386b99b588d8811"}, - {file = "markdown-3.8.1.tar.gz", hash = "sha256:a2e2f01cead4828ee74ecca9623045f62216aef2212a7685d6eb9163f590b8c1"}, + {file = "markdown-3.8.2-py3-none-any.whl", hash = "sha256:5c83764dbd4e00bdd94d85a19b8d55ccca20fe35b2e678a1422b380324dd5f24"}, + {file = "markdown-3.8.2.tar.gz", hash = "sha256:247b9a70dd12e27f67431ce62523e675b866d254f900c4fe75ce3dda62237c45"}, ] [package.extras] @@ -3871,13 +3871,13 @@ files = [ [[package]] name = "pygments" -version = "2.19.1" +version = "2.19.2" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.8" files = [ - {file = "pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c"}, - {file = "pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f"}, + {file = "pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b"}, + {file = "pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887"}, ] [package.extras] @@ -5094,6 +5094,20 @@ files = [ {file = "wrapt-1.17.2.tar.gz", hash = "sha256:41388e9d4d1522446fe79d3213196bd9e3b301a336965b9e27ca2788ebd122f3"}, ] +[[package]] +name = "yapf" +version = "0.43.0" +description = "A formatter for Python code" +optional = false +python-versions = ">=3.7" +files = [ + {file = "yapf-0.43.0-py3-none-any.whl", hash = "sha256:224faffbc39c428cb095818cf6ef5511fdab6f7430a10783fdfb292ccf2852ca"}, + {file = "yapf-0.43.0.tar.gz", hash = "sha256:00d3aa24bfedff9420b2e0d5d9f5ab6d9d4268e72afbf59bb3fa542781d5218e"}, +] + +[package.dependencies] +platformdirs = ">=3.5.1" + [[package]] name = "zeep" version = "4.3.1" @@ -5152,4 +5166,4 @@ worker = ["celery", "celery-prometheus-exporter", "django-celery-beat", "django- [metadata] lock-version = "2.0" python-versions = ">=3.12,<3.13" -content-hash = "db1001cbb7cbb20f5a927eb20c69e706bf6620cdc60e8334bede11439ce12c21" +content-hash = "2af805bf62515a47ea6f4649913482e4af8f8831a1236e1fa1400ba82dd9b4e0" diff --git a/pyproject.toml b/pyproject.toml index 5970e8e4..0225f953 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,6 +76,7 @@ ruff = "0.12.0" sentry-sdk = { extras = ["django", "celery", "opentelemetry", "redis"], version = "2.27.0" } six = "1.17.0" swapper = "1.4.0" +yapf = "^0.43.0" zeep = "4.3.1" [tool.poetry.group.dev.dependencies] @@ -115,4 +116,7 @@ per-file-ignores = { "__init__.py" = ["E402", "F401"] } [tool.ruff.format] quote-style = "double" -indent-style = "space" \ No newline at end of file +indent-style = "space" + +[tool.yapf] +based_on_style = "pep8" \ No newline at end of file