Source code for wolfgpu.version

"""
Author: HECE - University of Liege, Stéphane Champailler, Pierre Archambeau
Date: 2024

Copyright (c) 2024 University of Liege. All rights reserved.

This script and its content are protected by copyright law. Unauthorized
copying or distribution of this file, via any medium, is strictly prohibited.
"""

import re
from pathlib import Path

[docs] _VERSION_FILE = Path(__file__).parent.resolve() / "data" / "release.txt"
[docs] def _read_version() -> str: lines = multilines_version() m = re.match(r"^Version +(\S+).*$", lines[0]) if m: return m.group(1) return lines[0]
[docs] def long_version() -> str: """ A longer version string with information about date of release. """ lines = multilines_version() return lines[0]
[docs] def multilines_version() -> [str]: """ A full version information. With actual version number, release date and git SHA of release. """ if _VERSION_FILE.exists(): with _VERSION_FILE as fin: with open(_VERSION_FILE) as fin: lines = [line.strip() for line in fin.readlines()] return lines return ["development"]
# PEP-8 way of making a version number available. # A version string like 1.1.4dev3 __version__ = _read_version()