2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

Simplify version numbering scheme

This commit is contained in:
Oliver 2021-10-11 18:54:56 +11:00
parent bfb162c688
commit 4628bb8f08
3 changed files with 7 additions and 33 deletions

View File

@ -274,7 +274,9 @@ def send_email(subject, body, recipients, from_email=None):
offload_task( offload_task(
'django.core.mail.send_mail', 'django.core.mail.send_mail',
subject, body, subject,
body,
from_email, from_email,
recipients, recipients,
fail_silently=False,
) )

View File

@ -10,11 +10,6 @@ import common.models
INVENTREE_SW_VERSION = "0.5.1" INVENTREE_SW_VERSION = "0.5.1"
# InvenTree documentation version
# For 'dev' branch this must read "latest"
# For 'stable' branch this should match INVENTREE_SW_VERSION
INVENTREE_DOCS_VERSION = "0.5.1"
# InvenTree API version # InvenTree API version
INVENTREE_API_VERSION = 12 INVENTREE_API_VERSION = 12
@ -106,7 +101,10 @@ def inventreeDocsVersion():
""" """
return INVENTREE_DOCS_VERSION if isInvenTreeDevelopmentVersion():
return "latest"
else:
return INVENTREE_SW_VERSION
def isInvenTreeUpToDate(): def isInvenTreeUpToDate():

View File

@ -18,7 +18,6 @@ if __name__ == '__main__':
version_file = os.path.join(here, '..', 'InvenTree', 'InvenTree', 'version.py') version_file = os.path.join(here, '..', 'InvenTree', 'InvenTree', 'version.py')
version = None version = None
docs_version = None
with open(version_file, 'r') as f: with open(version_file, 'r') as f:
@ -33,17 +32,7 @@ if __name__ == '__main__':
version = results[0] version = results[0]
# Extract the documentation version
results = re.findall(r'INVENTREE_DOCS_VERSION = "(.*)"', text)
if not len(results) == 1:
print(f"Could not find INVENTREE_DOCS_VERSION in '{version_file}'")
sys.exit(1)
docs_version = results[0]
print(f"InvenTree Version: '{version}'") print(f"InvenTree Version: '{version}'")
print(f"Documentation Version: '{docs_version}'")
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-t', '--tag', help='Compare against specified version tag', action='store') parser.add_argument('-t', '--tag', help='Compare against specified version tag', action='store')
@ -86,11 +75,6 @@ if __name__ == '__main__':
print(f"Version number '{version}' does not match required pattern for development branch") print(f"Version number '{version}' does not match required pattern for development branch")
sys.exit(1) sys.exit(1)
# The docs version must be 'latest'
if docs_version != 'latest':
print(f"Documentation version must be 'latest' for development branch")
sys.exit(1)
elif args.release: elif args.release:
""" """
Check that the current version number matches the "release" format Check that the current version number matches the "release" format
@ -112,14 +96,4 @@ if __name__ == '__main__':
print(f"Release tag '{args.tag}' does not match INVENTREE_SW_VERSION '{version}'") print(f"Release tag '{args.tag}' does not match INVENTREE_SW_VERSION '{version}'")
sys.exit(1) sys.exit(1)
# Check that the documentation URL is available
url = f"https://inventree.readthedocs.io/en/{docs_version}"
response = requests.get(url)
print(f"Checking documentation url: {url} - Response {response.status_code}")
if response.status_code != 200:
print(f"ERROR: Received status code {response.status_code}")
sys.exit(1)
sys.exit(0) sys.exit(0)