Skip to content

Commit

Permalink
retrieve version info directly from pyproject.toml; remove duplicativ…
Browse files Browse the repository at this point in the history
…e openssa/VERSION file
  • Loading branch information
TheVinhLuong102 committed Dec 15, 2023
1 parent c6c5a4f commit d858b14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 0 additions & 1 deletion openssa/VERSION

This file was deleted.

19 changes: 12 additions & 7 deletions openssa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import os

with open(os.path.join(os.path.dirname(__file__), "VERSION"), "r", encoding="utf-8") as f:
__version__ = f.read().strip()


from importlib.metadata import version
from collections.abc import Sequence
from pathlib import Path
import tomllib

from openssa.core.ooda_rag.heuristic import TaskDecompositionHeuristic
from openssa.core.ooda_rag.solver import OodaSSA
Expand All @@ -26,3 +22,12 @@
from openssa.utils.config import Config
from openssa.utils.logs import Logs, logger, mlogger
from openssa.utils.utils import Utils


with open(file=Path(__file__).parent.parent / 'pyproject.toml', mode='rb') as f:
__version__: str = tomllib.load(f)['tool']['poetry']['version']


__all__: Sequence[str] = (
'__version__',
)

0 comments on commit d858b14

Please sign in to comment.