From 822ff34287827d3c53b1db0c6bb32c838c01b1cb Mon Sep 17 00:00:00 2001 From: Benny <96bennyl@gmail.com> Date: Sun, 20 Mar 2022 19:01:04 -0700 Subject: [PATCH] fix: add dynamic version to egg_updater.py --- cve_bin_tool/egg_updater.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cve_bin_tool/egg_updater.py b/cve_bin_tool/egg_updater.py index 40d2ada2e8..9dde15a218 100644 --- a/cve_bin_tool/egg_updater.py +++ b/cve_bin_tool/egg_updater.py @@ -1,12 +1,19 @@ # Copyright (C) 2021 Intel Corporation # SPDX-License-Identifier: GPL-3.0-or-later +import ast import os import sys from io import StringIO from setuptools.dist import Distribution +with open(os.path.join("cve_bin_tool", "version.py")) as f: + for line in f: + if line.startswith("VERSION"): + VERSION = ast.literal_eval(line.strip().split("=")[-1].strip()) + break + def IS_DEVELOP() -> bool: return any( @@ -35,7 +42,7 @@ def update_egg() -> None: script_name="setup.py", script_args=["egg_info"], name="cve-bin-tool", - version="3.0", + version=VERSION, entry_points={ "console_scripts": [ "cve-bin-tool = cve_bin_tool.cli:main",