From 3c47b6c782ac79d930c0a3720380566629200522 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 29 Mar 2021 16:49:18 +0100 Subject: [PATCH] Fix semantic_version appversion issues in update.py and setup.py --- setup.py | 13 +++++++------ update.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 3e67f846..525dc313 100755 --- a/setup.py +++ b/setup.py @@ -53,7 +53,8 @@ else: assert False, f'Unsupported platform {sys.platform}' # Split version, as py2exe wants the 'base' for version -semver = semantic_version.Version.coerce(appversion()) +semver = appversion() +appversion_str = str(semver) base_appversion = str(semver.truncate('patch')) if dist_dir and len(dist_dir) > 1 and isdir(dist_dir): @@ -154,8 +155,8 @@ if sys.platform == 'darwin': 'CFBundleName': applongname, 'CFBundleIdentifier': f'uk.org.marginal.{appname.lower()}', 'CFBundleLocalizations': get_cfbundle_localizations(), - 'CFBundleShortVersionString': appversion(), - 'CFBundleVersion': appversion(), + 'CFBundleShortVersionString': appversion_str, + 'CFBundleVersion': appversion_str, 'CFBundleURLTypes': [ { 'CFBundleTypeRole': 'Viewer', @@ -229,7 +230,7 @@ elif sys.platform == 'win32': setup( name=applongname, - version=appversion(), + version=appversion_str, windows=[ { 'dest_base': appname, @@ -238,7 +239,7 @@ setup( 'company_name': 'EDCD', # Used by WinSparkle 'product_name': appname, # Used by WinSparkle 'version': base_appversion, - 'product_version': appversion(), + 'product_version': appversion_str, 'copyright': copyright, 'other_resources': [(24, 1, open(f'{appname}.manifest').read())], } @@ -250,7 +251,7 @@ setup( 'company_name': 'EDCD', 'product_name': appname, 'version': base_appversion, - 'product_version': appversion(), + 'product_version': appversion_str, 'copyright': copyright, 'other_resources': [(24, 1, open(f'{appcmdname}.manifest').read())], } diff --git a/update.py b/update.py index c025609a..00fe9e6d 100644 --- a/update.py +++ b/update.py @@ -81,7 +81,7 @@ class Updater(object): # NB: It 'accidentally' supports pre-release due to how it # splits and compares strings: # - self.updater.win_sparkle_set_app_build_version(appversion_nobuild()) + self.updater.win_sparkle_set_app_build_version(str(appversion_nobuild())) # set up shutdown callback global root