Skip to content

Commit d3d04fb

Browse files
yawpitchcmccandless
authored andcommitted
generate_tests: allow newer Python versions (#2134)
* generate_tests: allow newer Python versions Current version forces 3.7, but one of the few pains of being on Arch Linux is that _suddenly_ you're on 3.8. * generate_tests: relax to 3.6
1 parent 223733b commit d3d04fb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

bin/generate_tests.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3.7
1+
#!/usr/bin/env python3
22
"""
33
Generates exercise test suites using an exercise's canonical-data.json
44
(found in problem-specifications) and $exercise/.meta/template.j2.
@@ -12,6 +12,13 @@
1212
generate_tests.py --check Checks if test files are out of sync with templates
1313
generate_tests.py --check two-fer Checks if two-fer test file is out of sync with template
1414
"""
15+
import sys
16+
17+
_py = sys.version_info
18+
if _py.major < 3 or (_py.major == 3 and _py.minor < 6):
19+
print("Python version must be at least 3.6")
20+
sys.exit(1)
21+
1522
import argparse
1623
import difflib
1724
import filecmp
@@ -22,7 +29,6 @@
2229
import posixpath
2330
import re
2431
import shutil
25-
import sys
2632
from glob import glob
2733
from itertools import repeat
2834
from string import punctuation, whitespace
@@ -32,7 +38,7 @@
3238

3339
from jinja2 import Environment, FileSystemLoader, TemplateNotFound, UndefinedError
3440

35-
VERSION = "0.2.0"
41+
VERSION = "0.2.1"
3642

3743
DEFAULT_SPEC_LOCATION = os.path.join("..", "problem-specifications")
3844
RGX_WORDS = re.compile(r"[-_\s]|(?=[A-Z])")

0 commit comments

Comments
 (0)