Skip to content

Commit 84f2f93

Browse files
committed
feat: v3 - Move litestar-htmx to a package extra (#4063)
Remove litestar-htmx from default dependencies
1 parent 71412f9 commit 84f2f93

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

docs/getting-started.rst

+3
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ Installation
6565
:ref:`Polyfactory to generate OpenAPI examples <usage/openapi/schema_generation:Generating examples>`
6666
:code:`pip install litestar[structlog]`
6767

68+
:doc:`HTMX plugin </usage/htmx>`
69+
:code:`pip install litestar[htmx]`
70+
6871
Standard Installation (includes Uvicorn and Jinja2 templating):
6972
:code:`pip install litestar[standard]`
7073

docs/release-notes/whats-new-3.rst

+7
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,10 @@ This does not change any behaviour, as this parameter was previously ignored.
289289
The `polyfactory <https://polyfactory.litestar.dev/>`_ library is not included by
290290
default anymore, and has been moved to the ``litestar[polyfactory]`` package extra. It
291291
is also included in ``litestar[full]``.
292+
293+
294+
``litestar-htmx`` package removed from default dependencies
295+
-----------------------------------------------------------
296+
297+
The `litestar-htmx <https://github.com/litestar-org/litestar-htmx/>`_ package powering
298+
the :doc:`HTMX plugin </usage/htmx>` has been moved to the ``litestar[htmx]`` extra.

docs/usage/htmx.rst

+3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ HTMX is a JavaScript library that gives you access to AJAX, CSS Transitions, Web
88
This section assumes that you have prior knowledge of HTMX.
99
If you want to learn HTMX, we recommend consulting their `official tutorial <https://htmx.org/docs>`_.
1010

11+
1112
HTMXPlugin
1213
------------
1314

1415
a Litestar plugin ``HTMXPlugin`` is available to easily configure the default request class for all Litestar routes.
1516

17+
It can be installed via the ``litestar[htmx]`` package extra.
18+
1619
.. code-block:: python
1720
1821
from litestar.plugins.htmx import HTMXPlugin

pyproject.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ dependencies = [
4343
"rich>=13.0.0",
4444
"rich-click",
4545
"multipart>=1.2.0",
46-
# default litestar plugins
47-
"litestar-htmx>=0.4.0",
4846
]
4947
description = "Litestar - A production-ready, highly performant, extensible ASGI API Framework"
5048
keywords = ["api", "rest", "asgi", "litestar", "starlite"]
@@ -82,8 +80,8 @@ brotli = ["brotli"]
8280
cli = ["jsbeautifier", "uvicorn[standard]", "uvloop>=0.18.0; sys_platform != 'win32'"]
8381
cryptography = ["cryptography"]
8482
full = [
85-
"litestar[annotated-types,attrs,brotli,cli,cryptography,jinja,jwt,mako,minijinja,opentelemetry,piccolo,polyfactory,picologging,prometheus,pydantic,redis,sqlalchemy,standard,structlog,valkey]; python_version < \"3.13\"",
86-
"litestar[annotated-types,attrs,brotli,cli,cryptography,jinja,jwt,mako,minijinja,opentelemetry,piccolo,polyfactory,prometheus,pydantic,redis,sqlalchemy,standard,structlog,valkey]; python_version >= \"3.13\"",
83+
"litestar[annotated-types,attrs,brotli,cli,cryptography,jinja,jwt,mako,minijinja,opentelemetry,piccolo,polyfactory,picologging,prometheus,pydantic,redis,sqlalchemy,standard,structlog,valkey,htmx]; python_version < \"3.13\"",
84+
"litestar[annotated-types,attrs,brotli,cli,cryptography,jinja,jwt,mako,minijinja,opentelemetry,piccolo,polyfactory,prometheus,pydantic,redis,sqlalchemy,standard,structlog,valkey,htmx]; python_version >= \"3.13\"",
8785
]
8886
jinja = ["jinja2>=3.1.2"]
8987
jwt = ["cryptography", "pyjwt>=2.9.0"]
@@ -110,6 +108,7 @@ standard = [
110108
structlog = ["structlog"]
111109
valkey = ["valkey[libvalkey]>=6.0.2"]
112110
polyfactory = ["polyfactory>=2.6.3"]
111+
htmx = ["litestar-htmx>=0.4.0"]
113112

114113
[project.scripts]
115114
litestar = "litestar.__main__:run_cli"

uv.lock

+8-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)