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 logging
import sys import sys
import warnings import warnings
import importlib.metadata
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
__version__ = importlib.metadata.version("pymisp")
def warning_2024(): def warning_2024():
if sys.version_info < (3, 10): if sys.version_info < (3, 10):

View File

@ -265,9 +265,9 @@ class PyMISP:
@property @property
def pymisp_version_main(self) -> Dict: def pymisp_version_main(self) -> Dict:
"""Get the most recent version of PyMISP from github""" """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: if r.status_code == 200:
version = re.findall("__version__ = '(.*)'", r.text) version = re.findall('version = "(.*)"', r.text)
return {'version': version[0]} return {'version': version[0]}
return {'error': 'Impossible to retrieve the version of the main branch.'} return {'error': 'Impossible to retrieve the version of the main branch.'}

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "pymisp" name = "pymisp"
version = "2.4.176" version = "2.4.178"
description = "Python API for MISP." description = "Python API for MISP."
authors = ["Raphaël Vinot <raphael.vinot@circl.lu>"] authors = ["Raphaël Vinot <raphael.vinot@circl.lu>"]
license = "BSD-2-Clause" license = "BSD-2-Clause"