From 49de7eafacc85c753fc67f45a6457087060357e9 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Sun, 22 Sep 2024 17:18:36 +0200 Subject: [PATCH] Add KubeSpawner.version_info --- kubespawner/__init__.py | 2 +- kubespawner/_version.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kubespawner/__init__.py b/kubespawner/__init__.py index 89b7541d..9443a475 100644 --- a/kubespawner/__init__.py +++ b/kubespawner/__init__.py @@ -11,5 +11,5 @@ # We export KubeSpawner specifically here. This simplifies import for users. # Users can simply import kubespawner.KubeSpawner in their applications # instead of the more verbose import kubespawner.spawner.KubeSpawner. -from ._version import __version__ +from ._version import __version__, version_info from .spawner import KubeSpawner diff --git a/kubespawner/_version.py b/kubespawner/_version.py index a602d581..1d9d048d 100644 --- a/kubespawner/_version.py +++ b/kubespawner/_version.py @@ -2,3 +2,6 @@ # pyproject.toml, according to instructions in RELEASE.md. # __version__ = "6.2.1.dev" + +# version_info looks like (1, 2, 3, "dev") if __version__ is 1.2.3.dev +version_info = tuple(int(p) if p.isdigit() else p for p in __version__.split("."))