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