Skip to content

Commit

Permalink
Add python version guard
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianleh committed Feb 6, 2024
1 parent 58f63c9 commit b2a3603
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .hooks/Name_validator.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/usr/bin/env python3

import re
import os
import sys
import sys


MIN_PYTHON = (3, 10)
if sys.version_info < MIN_PYTHON:
print(f"Your python version is {sys.version_info.major}.{sys.version_info.minor}. {MIN_PYTHON[0]}.{MIN_PYTHON[1]} is required")
exit(3)


args = sys.argv[1:]

Expand Down
7 changes: 7 additions & 0 deletions .hooks/Nocheck_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
import os
import sys


MIN_PYTHON = (3, 10)
if sys.version_info < MIN_PYTHON:
print(f"Your python version is {sys.version_info.major}.{sys.version_info.minor}. {MIN_PYTHON[0]}.{MIN_PYTHON[1]} is required")
exit(3)


b_color_yellow = '\033[93m'
b_color_reset = '\033[0m'

Expand Down
5 changes: 5 additions & 0 deletions .hooks/Search_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
import os
import sys

MIN_PYTHON = (3, 10)
if sys.version_info < MIN_PYTHON:
print(f"Your python version is {sys.version_info.major}.{sys.version_info.minor}. {MIN_PYTHON[0]}.{MIN_PYTHON[1]} is required")
exit(3)

args = sys.argv[1:]

usage = "./Name_validator.py [--interactive]"
Expand Down
8 changes: 8 additions & 0 deletions .hooks/Z_X_rules_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

import re
import os
import sys


MIN_PYTHON = (3, 10)
if sys.version_info < MIN_PYTHON:
print(f"Your python version is {sys.version_info.major}.{sys.version_info.minor}. {MIN_PYTHON[0]}.{MIN_PYTHON[1]} is required")
exit(3)


b_color_yellow = '\033[93m'
b_color_reset = '\033[0m'
Expand Down

0 comments on commit b2a3603

Please sign in to comment.