From 5d39d81152b386ca190c09cb2c9347ba2de77384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 24 Oct 2023 15:03:46 +0200 Subject: [PATCH] chg: Bump version, make __version__ dynamic --- pymisp/__init__.py | 5 ++++- pymisp/api.py | 4 ++-- pyproject.toml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) 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"