File tree 4 files changed +68
-64
lines changed
4 files changed +68
-64
lines changed Original file line number Diff line number Diff line change 9
9
ignore :
10
10
- dependency-name : black
11
11
versions :
12
- - 21.4b0
13
- - 21.4b1
12
+ - 23.12.1
14
13
- dependency-name : faker
15
14
versions :
16
15
- 5.8.0
@@ -39,7 +38,7 @@ updates:
39
38
- 1.26.3
40
39
- dependency-name : pytest
41
40
versions :
42
- - 6.2.2
41
+ - 7.4.3
43
42
- dependency-name : isort
44
43
versions :
45
- - 5.7.0
44
+ - 5.13.2
Original file line number Diff line number Diff line change 1
1
"""Class-based Flask app configuration."""
2
- from os import environ , path , system
2
+ import subprocess
3
+ from os import environ , path
3
4
4
5
from dotenv import load_dotenv
5
6
@@ -25,13 +26,17 @@ class Config:
25
26
26
27
# Flask-Assets
27
28
if ENVIRONMENT == "development" :
28
- LESS_BIN = system ("which lessc" )
29
- ASSETS_DEBUG = False
30
- LESS_RUN_IN_DEBUG = False
29
+ # Check if `lessc` is installed
30
+ LESS_BIN = subprocess .call ("which lessc" , shell = True )
31
31
if LESS_BIN is None :
32
- raise ValueError (
33
- "Application running in `development` mode cannot create assets without `lessc` installed."
34
- )
32
+ raise ValueError ("Flask requires `lessc` to be installed to compile styles." )
33
+ else :
34
+ # Check if `nodejs` is installed
35
+ NODE_JS = subprocess .call ("which node" , shell = True )
36
+ if NODE_JS is None :
37
+ raise ValueError (
38
+ "Application running in `development` mode cannot create assets without `node` installed."
39
+ )
35
40
36
41
# Hardcoded data
37
42
PRODUCT_DATA_FILEPATH = f"{ BASE_DIR } /data/products.json"
Original file line number Diff line number Diff line change 1
- black == 23.12.0 ; python_version >= "3.10" and python_version < "4.0"
1
+ black == 23.12.1 ; python_version >= "3.10" and python_version < "4.0"
2
2
blinker == 1.7.0 ; python_version >= "3.10" and python_version < "4.0"
3
3
click == 8.1.7 ; python_version >= "3.10" and python_version < "4.0"
4
4
colorama == 0.4.6 ; python_version >= "3.10" and python_version < "4.0" and platform_system == "Windows"
@@ -16,7 +16,7 @@ lesscpy==0.15.1 ; python_version >= "3.10" and python_version < "4.0"
16
16
markupsafe == 2.1.3 ; python_version >= "3.10" and python_version < "4.0"
17
17
mccabe == 0.7.0 ; python_version >= "3.10" and python_version < "4.0"
18
18
mypy-extensions == 1.0.0 ; python_version >= "3.10" and python_version < "4.0"
19
- mypy == 1.7.1 ; python_version >= "3.10" and python_version < "4.0"
19
+ mypy == 1.8.0 ; python_version >= "3.10" and python_version < "4.0"
20
20
packaging == 23.2 ; python_version >= "3.10" and python_version < "4.0"
21
21
pathspec == 0.12.1 ; python_version >= "3.10" and python_version < "4.0"
22
22
platformdirs == 4.1.0 ; python_version >= "3.10" and python_version < "4.0"
You can’t perform that action at this time.
0 commit comments