From d3d6bbe6f97112ed89d9a18b46bf64a443e356d1 Mon Sep 17 00:00:00 2001 From: Henrique Joaquim Date: Fri, 25 Nov 2022 12:51:09 +0000 Subject: [PATCH] renamed the package to OpenBB and added git check (#3572) --- openbb_terminal/feature_flags.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openbb_terminal/feature_flags.py b/openbb_terminal/feature_flags.py index 6c8e552992d..14e9d0c6479 100644 --- a/openbb_terminal/feature_flags.py +++ b/openbb_terminal/feature_flags.py @@ -26,6 +26,13 @@ load_dotenv(USER_ENV_FILE) load_dotenv(REPOSITORY_ENV_FILE, override=True) load_dotenv(PACKAGE_ENV_FILE, override=True) +try: + __import__("git") +except ImportError: + WITH_GIT = False +else: + WITH_GIT = True + # Retry unknown commands with `load` RETRY_WITH_LOAD = load_env_vars("OPENBB_RETRY_WITH_LOAD", strtobool, False, "featflags") @@ -135,7 +142,10 @@ GUESS_EASTER_EGG_FILE = str( ) try: - version = pkg_resources.get_distribution("OpenBBTerminal").version + if not WITH_GIT: + version = pkg_resources.get_distribution("OpenBB").version + else: + raise Exception("Using git") except Exception: version = "2.0.0rc1" VERSION = str(os.getenv("OPENBB_VERSION", version))