Skip to content

Commit ebe7a6e

Browse files
committed
Closes #206
1 parent 723bfbd commit ebe7a6e

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

hooks/pre_gen_project.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
MODULE_NAME: Final = '{{ cookiecutter.project_name }}'
77

88

9-
def validate_project_name() -> None:
9+
def _validate_project_name() -> None:
1010
"""
1111
This validator is used to ensure that `project_name` is valid.
1212
@@ -29,7 +29,27 @@ def validate_project_name() -> None:
2929
raise ValueError(' '.join(message).format(MODULE_NAME))
3030

3131

32-
validators = (validate_project_name,)
32+
def _validate_deps() -> None:
33+
"""Ensure that all deps are installed."""
34+
try:
35+
import lice # noqa: F401, PLC0415
36+
except ImportError:
37+
raise RuntimeError(
38+
'lice is not installed, please install it before proceeding',
39+
) from None
40+
41+
try:
42+
import jinja2_git # noqa: F401, PLC0415
43+
except ImportError:
44+
raise RuntimeError(
45+
'jinja2_git is not installed, please install it before proceeding',
46+
) from None
47+
48+
49+
validators = (
50+
_validate_project_name,
51+
_validate_deps,
52+
)
3353

3454
for validator in validators:
3555
try:

0 commit comments

Comments
 (0)