Commit 00da2d0 1 parent 4855093 commit 00da2d0 Copy full SHA for 00da2d0
File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
5
5
6
6
[tool .poetry ]
7
7
name = " jinjax"
8
- version = " 0.47 "
8
+ version = " 0.48 "
9
9
description = " Replace your HTML templates with Python server-Side components"
10
10
authors = [
" Juan-Pablo Scaletti <[email protected] >" ]
11
11
license = " MIT"
Original file line number Diff line number Diff line change 6
6
try :
7
7
from whitenoise import WhiteNoise
8
8
from whitenoise .responders import Redirect , StaticFile
9
- except ImportError as err :
10
- raise ImportError (
11
- "This feature requires the package `whitenoise` to be installed. \n "
12
- + "Run `pip install jinjax[whitenoise]` to do it."
13
- ) from err
14
-
9
+ except ImportError :
10
+ WhiteNoise = object
15
11
16
12
RX_FINGERPRINT = re .compile ("(.*)-([abcdef0-9]{64})" )
17
13
18
14
19
- class ComponentsMiddleware (WhiteNoise ):
15
+ class ComponentsMiddleware (WhiteNoise ): # type: ignore
20
16
"""WSGI middleware for serving components assets"""
21
17
22
18
allowed_ext : tuple [str , ...]
23
19
24
20
def __init__ (self , ** kwargs ) -> None :
21
+ if WhiteNoise is object :
22
+ raise ImportError (
23
+ "The ComponentsMiddleware requires the package `whitenoise`"
24
+ + " to be installed. \n Run `pip install jinjax[whitenoise]` to do it."
25
+ )
25
26
self .allowed_ext = kwargs .pop ("allowed_ext" , ())
26
27
super ().__init__ (** kwargs )
27
28
You can’t perform that action at this time.
0 commit comments