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

[Feature] Add An openbb-build Script To openbb-core Package #6692

Merged
merged 7 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions openbb_platform/core/openbb_core/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Script to build the OpenBB platform static assets."""

# flake8: noqa: S603
# pylint: disable=import-outside-toplevel

import subprocess
import sys


def main():
"""Build the OpenBB platform static assets."""
message = "\nOpenBB build script not found, installing from PyPI...\n"
deeleeramone marked this conversation as resolved.
Show resolved Hide resolved
try:
from openbb import build

build()
except (
ImportError,
ModuleNotFoundError,
AttributeError,
) as e:
print(message) # noqa: T201
subprocess.run(
[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):
raise RuntimeError(
"Failed to find the OpenBB build script. Install with `pip install openbb --no-deps`"
) from e


if __name__ == "__main__":
main()
Loading
Loading