Skip to content

Commit

Permalink
fix: remove extra plugin parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin authored Oct 21, 2024
2 parents 95ecf7d + b3f9b66 commit 2064108
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
18 changes: 12 additions & 6 deletions litestar_htmx/__metadata__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 2 additions & 16 deletions litestar_htmx/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING

from litestar.plugins import InitPluginProtocol
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2064108

Please sign in to comment.