Added version file to common. It's also executable so it's accessible from shell.

This commit is contained in:
Shay Nehmad 2020-02-09 11:20:12 +02:00
parent 85c70a3e71
commit bd9400403d
1 changed files with 22 additions and 0 deletions

22
monkey/common/version.py Normal file
View File

@ -0,0 +1,22 @@
# To get the version from shell, run `python ./version.py` (see `python ./version.py -h` for details).
import argparse
MAJOR = "1"
MINOR = "8"
PATCH = "0"
BUILD = "dev"
def get_version(build=BUILD):
return f"{MAJOR}.{MINOR}.{PATCH}+{build}"
def print_version():
parser = argparse.ArgumentParser()
parser.add_argument("-b", "--build", default=BUILD, help="Choose the build string for this version.", type=str)
args = parser.parse_args()
print(get_version(args.build))
if __name__ == '__main__':
print_version()