diff --git a/ci/version_retriever.py b/ci/version_retriever.py new file mode 100755 index 0000000..7649987 --- /dev/null +++ b/ci/version_retriever.py @@ -0,0 +1,22 @@ +#!/usr/bin/python3 + +import importlib +import subprocess +import sys + +# Insert path to roadmapper package in system path +git_repo_root = subprocess.Popen(['/bin/git', 'rev-parse', '--show-toplevel'], stdout=subprocess.PIPE) \ + .communicate()[0] \ + .rstrip() \ + .decode('utf-8') +sys.path.insert(1, git_repo_root) + + +def get_current_version() -> str: + roadmapper_version_module = importlib.import_module("src.roadmapper.version") + current_version = getattr(roadmapper_version_module, "__version__") + return current_version + + +if __name__ == "__main__": + print(get_current_version()) diff --git a/pyproject.toml b/pyproject.toml index aa92a79..51c897c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,7 @@ dependencies = ['Pillow>=10.0.0', 'python-dateutil>=2.8.2', 'drawsvg>=2.2.0'] [tool.setuptools.packages.find] where = ["src"] # list of folders that contain the packages (["."] by default) exclude = [ + "ci", "demo", "generate_gallery", "test_cases",