Skip to content

Commit eb410bf

Browse files
authored
fix: add dynamic version to egg_updater.py (fixes #1602) (#1606)
1 parent f938646 commit eb410bf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cve_bin_tool/egg_updater.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
# Copyright (C) 2021 Intel Corporation
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

4+
import ast
45
import os
56
import sys
67
from io import StringIO
78

89
from setuptools.dist import Distribution
910

11+
with open(os.path.join("cve_bin_tool", "version.py")) as f:
12+
for line in f:
13+
if line.startswith("VERSION"):
14+
VERSION = ast.literal_eval(line.strip().split("=")[-1].strip())
15+
break
16+
1017

1118
def IS_DEVELOP() -> bool:
1219
return any(
@@ -35,7 +42,7 @@ def update_egg() -> None:
3542
script_name="setup.py",
3643
script_args=["egg_info"],
3744
name="cve-bin-tool",
38-
version="3.0",
45+
version=VERSION,
3946
entry_points={
4047
"console_scripts": [
4148
"cve-bin-tool = cve_bin_tool.cli:main",

0 commit comments

Comments
 (0)