2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 11:35:41 +00:00

Merge branch 'master' of https://github.com/inventree/InvenTree into plugin-2037

This commit is contained in:
Matthias
2021-10-12 22:23:45 +02:00
65 changed files with 31335 additions and 27922 deletions

View File

@ -9,6 +9,7 @@ import sys
import re
import os
import argparse
import requests
if __name__ == '__main__':
@ -16,9 +17,14 @@ if __name__ == '__main__':
version_file = os.path.join(here, '..', 'InvenTree', 'InvenTree', 'version.py')
version = None
with open(version_file, 'r') as f:
results = re.findall(r'INVENTREE_SW_VERSION = "(.*)"', f.read())
text = f.read()
# Extract the InvenTree software version
results = re.findall(r'INVENTREE_SW_VERSION = "(.*)"', text)
if not len(results) == 1:
print(f"Could not find INVENTREE_SW_VERSION in {version_file}")
@ -26,6 +32,8 @@ if __name__ == '__main__':
version = results[0]
print(f"InvenTree Version: '{version}'")
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--tag', help='Compare against specified version tag', action='store')
parser.add_argument('-r', '--release', help='Check that this is a release version', action='store_true')
@ -57,6 +65,8 @@ if __name__ == '__main__':
e.g. "0.5 dev"
"""
print(f"Checking development branch")
pattern = "^\d+(\.\d+)+ dev$"
result = re.match(pattern, version)
@ -71,6 +81,8 @@ if __name__ == '__main__':
e.g. "0.5.1"
"""
print(f"Checking release branch")
pattern = "^\d+(\.\d+)+$"
result = re.match(pattern, version)