forked from ucbds-infra/otter-grader
/
version.py
34 lines (28 loc) · 1.01 KB
/
version.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
Otter-Grader version and printable logo
"""
import sys
from textwrap import dedent
__version__ = "3.0.0.b3"
LOGO_WITH_VERSION = f"""\
_________ __ __
/ _____ \ __| |__ __| |__
| / \ | |__ __| |__ __| _______ _ _____
| | | | | | | | | ___ | | |/ ____|
| | | | | | | | | |___| | | /
| | | | | | | | | ______| | |
| \_____/ | | |_ | |_ | |_____ | |
\_________/ \ __| \ __| \______| |__|
v{__version__}
"""
def print_version_info(logo=False):
"""
Prints the Otter logo and version information to stdout
Args:
logo (``bool``, optional): whether to print the logo
"""
if logo:
print(LOGO_WITH_VERSION)
print(dedent(f"""\
Python version: {".".join(str(v) for v in sys.version_info[:3])}
Otter-Grader version: {__version__}"""))