Fix version (#5883)

* Fix version

* Fix linter on terminal
This commit is contained in:
Igor Radovanovic
2023-12-13 10:54:32 +01:00
committed by GitHub
parent 704c2d82de
commit 40f3de132a
2 changed files with 11 additions and 3 deletions

View File

@@ -16,7 +16,12 @@ def get_package_version(package: str):
except pkg_resources.DistributionNotFound:
package += "-nightly"
is_nightly = True
version = pkg_resources.get_distribution(package).version
try:
version = pkg_resources.get_distribution(package).version
except pkg_resources.DistributionNotFound:
package = "openbb-core"
version = pkg_resources.get_distribution(package).version
version += "core"
if is_git_repo(Path(__file__).parent.resolve()) and not is_nightly:
version += "dev"
@@ -42,4 +47,7 @@ def is_git_repo(path: Path):
return False
VERSION = get_package_version(PACKAGE)
try:
VERSION = get_package_version(PACKAGE)
except pkg_resources.DistributionNotFound:
VERSION = "unknown"

View File

@@ -4,7 +4,7 @@ __docformat__ = "numpy"
# pylint: disable=no-member, too-many-branches, too-many-arguments
# pylint: disable=inconsistent-return-statements
# pylint: disable=consider-using-dict-items
# pylint: disable=too-many-lines
import logging
import os
from copy import deepcopy