From b7618e12f75de351127edc562f6d66f9b47e0931 Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 6 Jun 2023 12:41:53 +0200 Subject: [PATCH] version: use standard Python's `dev0` instead of Libervia specific `D` for dev version --- libervia/backend/__init__.py | 5 +---- libervia/backend/core/constants.py | 2 +- libervia/backend/core/main.py | 2 +- libervia/backend/tools/utils.py | 1 - libervia/tui/base.py | 2 +- setup.py | 4 ++-- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/libervia/backend/__init__.py b/libervia/backend/__init__.py index dd6fde54..45baecbe 100644 --- a/libervia/backend/__init__.py +++ b/libervia/backend/__init__.py @@ -15,12 +15,9 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -import os.path from sat_tmp import wokkel -version_file = os.path.join(os.path.dirname(__file__), "VERSION") -with open(version_file) as f: - __version__ = f.read().strip() +__version__ = "0.9.0.dev0" if not wokkel.installed: wokkel.install() diff --git a/libervia/backend/core/constants.py b/libervia/backend/core/constants.py index 9a6346e6..7b003259 100644 --- a/libervia/backend/core/constants.py +++ b/libervia/backend/core/constants.py @@ -36,7 +36,7 @@ class Const(object): APP_NAME_FULL = f"{APP_NAME} ({APP_COMPONENT})" APP_VERSION = ( backend.__version__ - ) # Please add 'D' at the end of version in sat/VERSION for dev versions + ) APP_RELEASE_NAME = "La Ruche" APP_URL = "https://libervia.org" diff --git a/libervia/backend/core/main.py b/libervia/backend/core/main.py index c7ed37c7..2fb16658 100644 --- a/libervia/backend/core/main.py +++ b/libervia/backend/core/main.py @@ -113,7 +113,7 @@ class LiberviaBackend(service.Service): In developement mode, release name and extra data are returned too """ version = self.version - if version[-1] == "D": + if version.split(".")[-1] == "dev0": # we are in debug version, we add extra data try: return self._version_cache diff --git a/libervia/backend/tools/utils.py b/libervia/backend/tools/utils.py index 8f65e145..716a8b47 100644 --- a/libervia/backend/tools/utils.py +++ b/libervia/backend/tools/utils.py @@ -321,7 +321,6 @@ def get_repository_data(module, as_string=True, is_path=False): ) ) else: - version = version.replace(".dev0", "D") if version != C.APP_VERSION: log.warning( "Incompatible version ({version}) and pkg_version ({pkg_version})" diff --git a/libervia/tui/base.py b/libervia/tui/base.py index 02518976..a3ff7898 100644 --- a/libervia/tui/base.py +++ b/libervia/tui/base.py @@ -483,7 +483,7 @@ class LiberviaTUIApp(QuickApp, InputHistory): self.loop.widget = self.__saved_overlay self.__saved_overlay = None - elif input_ == a_key['DEBUG'] and 'D' in self.bridge.version_get(): #Debug only for dev versions + elif input_ == a_key['DEBUG'] and '.dev0' in self.bridge.version_get(): #Debug only for dev versions self.debug() elif input_ == a_key['CONTACTS_HIDE']: #user wants to (un)hide the contact lists try: diff --git a/setup.py b/setup.py index d76ff62b..59c96922 100644 --- a/setup.py +++ b/setup.py @@ -73,7 +73,7 @@ DBUS_DIR = 'dbus-1/services' DBUS_FILE = 'misc/org.libervia.Libervia.service' with open(os.path.join(DIR_NAME, 'VERSION')) as f: VERSION = f.read().strip() -is_dev_version = VERSION.endswith('D') +is_dev_version = VERSION.endswith('.dev0') if is_dev_version: install_requires.append("setuptools_scm") @@ -81,7 +81,7 @@ if is_dev_version: def sat_dev_version(): """Use mercurial data to compute version""" def version_scheme(version): - return VERSION.replace('D', '.dev0') + return VERSION def local_scheme(version): return "+{rev}.{distance}".format(