From dbdc2fd692351f3feae9a5efe076136c1b61b5bd Mon Sep 17 00:00:00 2001 From: oriyalp Date: Thu, 2 Nov 2023 00:37:13 +0200 Subject: [PATCH] use version file --- networkz/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/networkz/__init__.py b/networkz/__init__.py index 59e4a80..7c84d72 100644 --- a/networkz/__init__.py +++ b/networkz/__init__.py @@ -2,11 +2,15 @@ import os import pathlib -__version__ = "1.0.6" - # Get the current directory of the __init__.py file current_directory = os.path.dirname(__file__) +version_file_path = os.path.join(current_directory, "VERSION") + +# Read the version from the version file +with open(version_file_path, "r") as version_file: + __version__ = version_file.read().strip() + # Append the 'algorithms' directory to the __path__ attribute __path__.append(os.path.join(current_directory, 'algorithms'))