chg: Bump version, make __version__ dynamic

pull/1087/head
Raphaël Vinot 2023-10-24 15:03:46 +02:00
parent 4ed9781c76
commit 5d39d81152
3 changed files with 7 additions and 4 deletions

View File

@ -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):

View File

@ -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.'}

View File

@ -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 <raphael.vinot@circl.lu>"]
license = "BSD-2-Clause"