Skip to content

Commit

Permalink
expose numeric version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Dec 23, 2023
1 parent bb2d868 commit 5f40e4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions xpra/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# This file is part of Xpra.
# Copyright (C) 2008 Nathaniel Smith <njs@pobox.com>
# Copyright (C) 2009-2022 Antoine Martin <antoine@xpra.org>
# Copyright (C) 2009-2023 Antoine Martin <antoine@xpra.org>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.

__version__ = "6.0"
__version_info__ = (6, 0)
__version__ = ".".join(map(str, __version_info__))
11 changes: 5 additions & 6 deletions xpra/util/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from xpra.common import FULL_INFO

XPRA_VERSION = xpra.__version__ #@UndefinedVariable
XPRA_NUMERIC_VERSION = xpra.__version_info__

CHECK_SSL : bool = envbool("XPRA_VERSION_CHECK_SSL", True)
SSL_CAFILE : str = ""
Expand Down Expand Up @@ -100,14 +101,12 @@ def version_compat_check(remote_version) -> str | None:
except ValueError:
warn(f"Warning: failed to parse remote version {remote_version!r}")
return None
try:
lv = parse_version(XPRA_VERSION)
except ValueError:
warn(f"Warning: failed to parse local version {XPRA_VERSION!r}")
return None
if rv==lv:
if rv==XPRA_NUMERIC_VERSION:
log("identical remote version: %s", remote_version)
return None
if rv[:2]==XPRA_NUMERIC_VERSION[:2]:
log("identical major.minor remote version: %s", remote_version)
return None
if rv[0:2]<(3, 0):
#this is the oldest version we support
msg = f"remote version {rv[:2]} is too old, sorry"
Expand Down

0 comments on commit 5f40e4c

Please sign in to comment.