Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add dynamic version to egg_updater.py #1606

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion cve_bin_tool/egg_updater.py
Original file line number Diff line number Diff line change
@@ -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(
Expand Down Expand Up @@ -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",
Expand Down