changeset 4079:10b6ad569157

version: use standard Python's `dev0` instead of Libervia specific `D` for dev version
author Goffi <goffi@goffi.org>
date Tue, 06 Jun 2023 12:41:53 +0200
parents 15055a00162c
children 0ea6b34f8f18
files libervia/backend/__init__.py libervia/backend/core/constants.py libervia/backend/core/main.py libervia/backend/tools/utils.py libervia/tui/base.py setup.py
diffstat 6 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/backend/__init__.py	Fri Jun 02 18:21:15 2023 +0200
+++ b/libervia/backend/__init__.py	Tue Jun 06 12:41:53 2023 +0200
@@ -15,12 +15,9 @@
 
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
-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()
--- a/libervia/backend/core/constants.py	Fri Jun 02 18:21:15 2023 +0200
+++ b/libervia/backend/core/constants.py	Tue Jun 06 12:41:53 2023 +0200
@@ -36,7 +36,7 @@
     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"
 
--- a/libervia/backend/core/main.py	Fri Jun 02 18:21:15 2023 +0200
+++ b/libervia/backend/core/main.py	Tue Jun 06 12:41:53 2023 +0200
@@ -113,7 +113,7 @@
         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
--- a/libervia/backend/tools/utils.py	Fri Jun 02 18:21:15 2023 +0200
+++ b/libervia/backend/tools/utils.py	Tue Jun 06 12:41:53 2023 +0200
@@ -321,7 +321,6 @@
                     )
                 )
             else:
-                version = version.replace(".dev0", "D")
                 if version != C.APP_VERSION:
                     log.warning(
                         "Incompatible version ({version}) and pkg_version ({pkg_version})"
--- a/libervia/tui/base.py	Fri Jun 02 18:21:15 2023 +0200
+++ b/libervia/tui/base.py	Tue Jun 06 12:41:53 2023 +0200
@@ -483,7 +483,7 @@
                     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:
--- a/setup.py	Fri Jun 02 18:21:15 2023 +0200
+++ b/setup.py	Tue Jun 06 12:41:53 2023 +0200
@@ -73,7 +73,7 @@
 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 @@
 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(