Skip to content

Commit

Permalink
Fix pre_gen_project.py file because of missed adjustment of python ve…
Browse files Browse the repository at this point in the history
…rsion.
  • Loading branch information
Christian Baur committed Jan 8, 2025
1 parent 2950298 commit 25f6adc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
import platform
import re
import sys
from distutils.version import StrictVersion
from packaging.version import Version
import warnings

import cookiecutter


with warnings.catch_warnings():
warnings.simplefilter("ignore", category=DeprecationWarning)
# check Python version (3.8 or higher)
if StrictVersion(platform.python_version()) < StrictVersion("3.8.0"):
# check Python version (3.9 or higher)
if Version(platform.python_version()) < Version("3.9.0"):
print(f"ERROR: You are using Python {platform.python_version()},",
"but Python 3.8 or higher is required to use this template")
"but Python 3.9 or higher is required to use this template")
sys.exit(1)
# check cookiecutter version (1.7.2 or higher)
if StrictVersion(cookiecutter.__version__) < StrictVersion('1.7.2'):
print(f"ERROR: You are using cookiecutter {cookiecutter.__version__}"
if Version(cookiecutter.__version__) < Version('1.7.2'):
print(f"ERROR: You are using cookiecutter {cookiecutter.__version__}"
"but cookiecutter 1.7.2 or higher is required to use this template")
sys.exit(1)

Expand Down

0 comments on commit 25f6adc

Please sign in to comment.