Skip to content

Commit

Permalink
fix pre_gen_project error
Browse files Browse the repository at this point in the history
  • Loading branch information
jaehyeon-kim committed Jun 27, 2024
1 parent ca5d358 commit ea5b73f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import sys

from pkg_resources import (
get_distribution,
packaging,
)

MIN_CC_VERSION = "2.0.0"

try:
import cookiecutter # type: ignore
except ImportError:
print(f"ERROR: please install cookiecutter >= {MIN_CC_VERSION}")
sys.exit(1)

cc_version = cookiecutter.__version__
# assert cookiecutter >= 2.0.0
cc_version = packaging.version.parse(get_distribution("cookiecutter").version)
min_version = packaging.version.parse(MIN_CC_VERSION)
if cc_version < min_version:
if cc_version < MIN_CC_VERSION:
print(
f"ERROR: please install cookiecutter >= {MIN_CC_VERSION} (current "
f"version is {cc_version}):\n"
Expand Down

0 comments on commit ea5b73f

Please sign in to comment.