mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-25 18:53:26 +00:00
command line build
This commit is contained in:
@@ -10,14 +10,12 @@ import sys
|
||||
def main():
|
||||
"""Build the OpenBB platform static assets."""
|
||||
try:
|
||||
from openbb import build
|
||||
|
||||
build()
|
||||
import openbb # noqa
|
||||
except (
|
||||
ImportError,
|
||||
ModuleNotFoundError,
|
||||
AttributeError,
|
||||
) as e:
|
||||
):
|
||||
print( # noqa: T201
|
||||
"\nOpenBB build script not found, installing from PyPI...\n",
|
||||
)
|
||||
@@ -25,14 +23,15 @@ def main():
|
||||
[sys.executable, "-m", "pip", "install", "openbb", "--no-deps"],
|
||||
check=True,
|
||||
)
|
||||
|
||||
try:
|
||||
subprocess.run(
|
||||
[sys.executable, "-c", "import openbb; openbb.build()"],
|
||||
check=True,
|
||||
)
|
||||
except (subprocess.CalledProcessError, AttributeError):
|
||||
except Exception as e:
|
||||
raise RuntimeError(
|
||||
"Failed to find the OpenBB build script. Install with `pip install openbb --no-deps`"
|
||||
f"Failed to build the OpenBB platform static assets. \n{e}"
|
||||
) from e
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user