command line build

This commit is contained in:
Danglewood
2025-04-02 10:34:05 -07:00
parent 62883cdaf7
commit 6dc1de2b85

View File

@@ -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