Adding upstream version 0.48+dfsg.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
aa3901dc08
commit
cece8fcfb0
5 changed files with 11 additions and 11 deletions
2
.github/workflows/run_tests.yml
vendored
2
.github/workflows/run_tests.yml
vendored
|
@ -22,7 +22,7 @@ jobs:
|
|||
name: tests
|
||||
strategy:
|
||||
matrix:
|
||||
python: ["3.10", "3.11", "3.12"]
|
||||
python: ["3.10", "3.11", "3.12", "3.13"]
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
2
.github/workflows/upload-to-pypi.yml
vendored
2
.github/workflows/upload-to-pypi.yml
vendored
|
@ -14,7 +14,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
python-version: 3.12
|
||||
|
||||
- name: "Installs dependencies"
|
||||
run: |
|
||||
|
|
|
@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
|
|||
|
||||
[tool.poetry]
|
||||
name = "jinjax"
|
||||
version = "0.46"
|
||||
version = "0.48"
|
||||
description = "Replace your HTML templates with Python server-Side components"
|
||||
authors = ["Juan-Pablo Scaletti <juanpablo@jpscaletti.com>"]
|
||||
license = "MIT"
|
||||
|
|
|
@ -12,7 +12,6 @@ from .component import Component
|
|||
from .exceptions import ComponentNotFound, InvalidArgument
|
||||
from .html_attrs import HTMLAttrs
|
||||
from .jinjax import JinjaX
|
||||
from .middleware import ComponentsMiddleware
|
||||
from .utils import DELIMITER, SLASH, get_url_prefix, logger
|
||||
|
||||
|
||||
|
|
|
@ -6,22 +6,23 @@ from pathlib import Path
|
|||
try:
|
||||
from whitenoise import WhiteNoise
|
||||
from whitenoise.responders import Redirect, StaticFile
|
||||
except ImportError as err :
|
||||
raise ImportError(
|
||||
"This feature requires the package `whitenoise` to be installed. \n"
|
||||
+ "Run `pip install jinjax[whitenoise]` to do it."
|
||||
) from err
|
||||
|
||||
except ImportError:
|
||||
WhiteNoise = object
|
||||
|
||||
RX_FINGERPRINT = re.compile("(.*)-([abcdef0-9]{64})")
|
||||
|
||||
|
||||
class ComponentsMiddleware(WhiteNoise):
|
||||
class ComponentsMiddleware(WhiteNoise): # type: ignore
|
||||
"""WSGI middleware for serving components assets"""
|
||||
|
||||
allowed_ext: tuple[str, ...]
|
||||
|
||||
def __init__(self, **kwargs) -> None:
|
||||
if WhiteNoise is object:
|
||||
raise ImportError(
|
||||
"The ComponentsMiddleware requires the package `whitenoise`"
|
||||
+ " to be installed. \nRun `pip install jinjax[whitenoise]` to do it."
|
||||
)
|
||||
self.allowed_ext = kwargs.pop("allowed_ext", ())
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue