diff --git a/pymisp/__init__.py b/pymisp/__init__.py index 5d63c8d..e3f07c0 100644 --- a/pymisp/__init__.py +++ b/pymisp/__init__.py @@ -1,10 +1,13 @@ -__version__ = '2.4.176' import logging import sys import warnings +import importlib.metadata + logger = logging.getLogger(__name__) +__version__ = importlib.metadata.version("pymisp") + def warning_2024(): if sys.version_info < (3, 10): diff --git a/pymisp/api.py b/pymisp/api.py index 11baf0a..83935ff 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -265,9 +265,9 @@ class PyMISP: @property def pymisp_version_main(self) -> Dict: """Get the most recent version of PyMISP from github""" - r = requests.get('https://raw.githubusercontent.com/MISP/PyMISP/main/pymisp/__init__.py') + r = requests.get('https://raw.githubusercontent.com/MISP/PyMISP/main/pyproject.toml') if r.status_code == 200: - version = re.findall("__version__ = '(.*)'", r.text) + version = re.findall('version = "(.*)"', r.text) return {'version': version[0]} return {'error': 'Impossible to retrieve the version of the main branch.'} diff --git a/pyproject.toml b/pyproject.toml index f34d8da..1258197 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pymisp" -version = "2.4.176" +version = "2.4.178" description = "Python API for MISP." authors = ["Raphaƫl Vinot "] license = "BSD-2-Clause"