From 189460486f31484a0af8ed7bc01b75b3d4951b4a Mon Sep 17 00:00:00 2001 From: Shrey Dixit Date: Wed, 20 Mar 2024 09:51:21 +0100 Subject: [PATCH] updated version calc --- msapy/__init__.py | 12 ++---------- pyproject.toml | 2 +- tests/test_version.py | 5 +++++ 3 files changed, 8 insertions(+), 11 deletions(-) create mode 100644 tests/test_version.py diff --git a/msapy/__init__.py b/msapy/__init__.py index d05747b..3367cc1 100644 --- a/msapy/__init__.py +++ b/msapy/__init__.py @@ -1,12 +1,4 @@ from msapy import msa, utils, checks -import toml -import os -package_dir = os.path.abspath(os.path.dirname(__file__)) -pyproject_path = os.path.join(package_dir, "..", "pyproject.toml") - -try: - __version__ = toml.load(pyproject_path)["tool"]["poetry"]["version"] -except Exception as e: - __version__ = "unknown" - print(f"Warning: Could not load version from pyproject.toml: {e}") \ No newline at end of file +__all__ = ["msa", "utils", "checks"] +__version__ = "1.7.1" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b009ca5..2a7efb4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "msapy" -version = "1.7" +version = "1.7.1" description = "Multi-perturbation Shapley value Analysis (MSA)" homepage = "https://github.com/kuffmode/msa" repository = "https://github.com/kuffmode/msa" diff --git a/tests/test_version.py b/tests/test_version.py new file mode 100644 index 0000000..2ced7da --- /dev/null +++ b/tests/test_version.py @@ -0,0 +1,5 @@ +import toml +import msapy + +def test_version(): + assert msapy.__version__ == toml.load("pyproject.toml")["tool"]["poetry"]["version"] \ No newline at end of file