From b3f9b660fb3c6349af0d89033e8cb2b56661bb5a Mon Sep 17 00:00:00 2001 From: Cody Fincher Date: Mon, 21 Oct 2024 17:34:56 +0000 Subject: [PATCH] fix: remove extra parameter --- litestar_htmx/__metadata__.py | 18 ++++++++++++------ litestar_htmx/plugin.py | 18 ++---------------- pyproject.toml | 2 +- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/litestar_htmx/__metadata__.py b/litestar_htmx/__metadata__.py index 4a9d69b..9b6e7a8 100644 --- a/litestar_htmx/__metadata__.py +++ b/litestar_htmx/__metadata__.py @@ -2,11 +2,17 @@ from __future__ import annotations -import importlib.metadata +from importlib.metadata import PackageNotFoundError, metadata, version -__all__ = ["__version__", "__project__"] +__all__ = ("__version__", "__project__") -__version__ = importlib.metadata.version("litestar_htmx") -"""Version of the project.""" -__project__ = importlib.metadata.metadata("litestar_htmx")["Name"] -"""Name of the project.""" +try: + __version__ = version("litestar_htmx") + """Version of the project.""" + __project__ = metadata("litestar_htmx")["Name"] + """Name of the project.""" +except PackageNotFoundError: # pragma: no cover + __version__ = "0.0.0" + __project__ = "Litestar HTMX" +finally: + del version, PackageNotFoundError, metadata diff --git a/litestar_htmx/plugin.py b/litestar_htmx/plugin.py index d51f562..af7063c 100644 --- a/litestar_htmx/plugin.py +++ b/litestar_htmx/plugin.py @@ -2,7 +2,6 @@ from __future__ import annotations -from dataclasses import dataclass from typing import TYPE_CHECKING from litestar.plugins import InitPluginProtocol @@ -23,26 +22,13 @@ if TYPE_CHECKING: from litestar.config.app import AppConfig - from litestar.template import TemplateConfig - - -@dataclass -class HtmxConfig: - """Configuration for Flash messages.""" - - template_config: TemplateConfig class HTMXPlugin(InitPluginProtocol): """Flash messages Plugin.""" - def __init__(self, config: HtmxConfig): - """Initialize the plugin. - - Args: - config: Configuration for flash messages, including the template engine instance. - """ - self.config = config + def __init__(self): + """Initialize the plugin.""" def on_app_init(self, app_config: AppConfig) -> AppConfig: """Register the message callable on the template engine instance. diff --git a/pyproject.toml b/pyproject.toml index 0d1f634..9eab1b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ maintainers = [ name = "litestar-htmx" readme = "README.md" requires-python = ">=3.8, <4.0" -version = "0.2.1" +version = "0.2.2" [build-system] build-backend = "hatchling.build"