diff --git a/pdm.lock b/pdm.lock index cd89c354..f553c803 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev", "docs", "tests", "types", "docs-img"] strategy = ["cross_platform", "static_urls"] lock_version = "4.4.1" -content_hash = "sha256:0ffb0798281580ff482b2732430f7dd67c6b9b6c1580163113a1938c7d979bbd" +content_hash = "sha256:f8524aaec5381fcc4a3dcf46a3e6a107e9ef03aa357842f383b1ce8968d0c419" [[package]] name = "aiohttp" @@ -835,14 +835,15 @@ files = [ [[package]] name = "django-components" -version = "0.61" +version = "0.74" +requires_python = "<4.0,>=3.8" summary = "A way to create simple reusable template components in Django." dependencies = [ - "Django>=3.2", + "Django>=4.2", ] files = [ - {url = "https://files.pythonhosted.org/packages/58/47/2c17307f20b25c1e0a6ee4beedda141184cc33dcb84a56d2f080ba979eaf/django_components-0.61-py3-none-any.whl", hash = "sha256:c172ad43eaf305395bb899e8d5925cca48b620aa65962b8035a0d3e30e4b4aa0"}, - {url = "https://files.pythonhosted.org/packages/f6/5f/1947168d32485f0eb313de3a27fb89f45f61ba5650266310918e4ad4f0b2/django_components-0.61.tar.gz", hash = "sha256:c5d5fab7fb7f3011d73a85264834c131c301b9d14c900cba366f8d16b67b519c"}, + {url = "https://files.pythonhosted.org/packages/5b/4b/ff6d3bf1db31a4bf525786dc7ec77d7df908d50aed4069adfb2112ec9bca/django_components-0.74-py3-none-any.whl", hash = "sha256:5bc1ac71495095985b08615ec4c348c00c99f4f840e666fff67e708149b8f0d5"}, + {url = "https://files.pythonhosted.org/packages/fd/04/02a749f0847f41309d33d6f7307c4f1ebcf71b174bfb63b23c60ecf376b7/django_components-0.74.tar.gz", hash = "sha256:864435896bcc0a7aac049eadc97b2e21f225b3d9e34bc689d45405226a51c199"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index c1edd62e..a09a4d32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ "dateparser>=1.2.0", "django-tables2>=2.6.0", "pdpyras>=5.1.3", - "django-components>=0.61", + "django-components>=0.74", "django-htmx>=1.17.2", "django-simple-menu>=2.1.3", "markdown>=3.5.1", diff --git a/src/firefighter/firefighter/settings/components/common.py b/src/firefighter/firefighter/settings/components/common.py index d997eac9..7903c567 100644 --- a/src/firefighter/firefighter/settings/components/common.py +++ b/src/firefighter/firefighter/settings/components/common.py @@ -270,6 +270,7 @@ def get_django_username(x: dict[str, str]) -> str | None: # Components COMPONENTS = { "autodiscover": False, + "context_behavior": "django", # Like before django-components 0.67 "libraries": [ "firefighter.components.avatar.avatar", "firefighter.components.card.card", diff --git a/stubs/django_components/__init__.pyi b/stubs/django_components/__init__.pyi deleted file mode 100644 index 8303056d..00000000 --- a/stubs/django_components/__init__.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from _typeshed import Incomplete -from django_components.utils import search as search - -default_app_config: str - -def autodiscover() -> None: ... -def import_file(path: Incomplete) -> None: ... diff --git a/stubs/django_components/component.pyi b/stubs/django_components/component.pyi deleted file mode 100644 index c8b080a7..00000000 --- a/stubs/django_components/component.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from _typeshed import Incomplete -from django.forms.widgets import MediaDefiningClass -from django.views import View -from django_components.component_registry import ComponentRegistry as ComponentRegistry -from django_components.component_registry import register as register -from django_components.component_registry import registry as registry -from django_components.logger import logger as logger -from django_components.templatetags.component_tags import ( - FILLED_SLOTS_CONTENT_CONTEXT_KEY as FILLED_SLOTS_CONTENT_CONTEXT_KEY, -) -from django_components.templatetags.component_tags import ( - DefaultFillContent as DefaultFillContent, -) -from django_components.templatetags.component_tags import FillContent as FillContent -from django_components.templatetags.component_tags import ( - FilledSlotsContext as FilledSlotsContext, -) -from django_components.templatetags.component_tags import ( - IfSlotFilledConditionBranchNode as IfSlotFilledConditionBranchNode, -) -from django_components.templatetags.component_tags import ( - NamedFillContent as NamedFillContent, -) -from django_components.templatetags.component_tags import SlotName as SlotName -from django_components.templatetags.component_tags import SlotNode as SlotNode -from django_components.utils import search as search - -class SimplifiedInterfaceMediaDefiningClass(MediaDefiningClass): - def __new__( - mcs, # noqa: N804 - name: Incomplete, - bases: Incomplete, - attrs: Incomplete, - ) -> Incomplete: ... - -class Component(View, metaclass=SimplifiedInterfaceMediaDefiningClass): ... diff --git a/stubs/django_components/component_registry.pyi b/stubs/django_components/component_registry.pyi deleted file mode 100644 index 65009ae5..00000000 --- a/stubs/django_components/component_registry.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from collections.abc import Callable -from typing import TypeVar - -from django_components import component - -_TC = TypeVar("_TC", bound=type[component.Component]) - -class ComponentRegistry: - def __init__(self) -> None: ... - def register( - self, name: str | None = None, component: component.Component | None = None - ) -> None: ... - def unregister(self, name: str) -> None: ... - def get(self, name: str) -> type[component.Component]: ... - def all(self) -> dict[str, type[component.Component]]: ... - def clear(self) -> None: ... - -registry: ComponentRegistry - -def register(name: str) -> Callable[[_TC], _TC]: ...