From 64580150c51f12c655b3b98133fa996274576113 Mon Sep 17 00:00:00 2001 From: lumbric Date: Mon, 13 May 2024 15:18:38 +0200 Subject: [PATCH] Fix wrong documentation for convert_factor --- syfop/version.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/syfop/version.py b/syfop/version.py index e3f91c1..3b0e747 100644 --- a/syfop/version.py +++ b/syfop/version.py @@ -9,8 +9,12 @@ def get_version(): # - if it is a shallow clone with --depth 1 try: git_tag = subprocess.check_output(["git", "describe", "--tags"], stderr=subprocess.STDOUT) - except subprocess.CalledProcessError as e: - raise RuntimeError(f"Unable to get version from Git: {e}: {e.output.decode()}") + except subprocess.CalledProcessError: + # TODO I'm giving up on this one. No idea how to do it the right way. + # readthedocs fails to get the tag if it is more than 50 commits away from HEAD... + # https://readthedocs.org/projects/syfop/builds/24362900/ + git_tag = "v0.0.0" + # raise RuntimeError(f"Unable to get version from Git: {e}: {e.output.decode()}") # TODO we don't check if the tag is a valid version string (e.g. v0.1.0). git_tag = git_tag.decode().strip()