cookiecutter-data-science/{{ cookiecutter.repo_name }}/test_environment.py

26 lines
662 B
Python
Raw Normal View History

import sys
REQUIRED_PYTHON = "{{ cookiecutter.python_interpreter }}"
def main():
system_major = sys.version_info.major
if REQUIRED_PYTHON == "python":
required_major = 2
elif REQUIRED_PYTHON == "python3":
required_major = 3
else:
raise ValueError("Unrecognized python interpreter: {}".format(
REQUIRED_PYTHON))
if system_major != required_major:
2016-10-05 13:03:25 -07:00
raise TypeError(
"This project requires Python {}. Found: Python {}".format(
required_major, sys.version))
else:
print(">>> Development environment passes all tests!")
if __name__ == '__main__':
2018-02-05 07:38:53 -08:00
main()