From a8eb8624232bef5db664f6adcafa68e9c616c435 Mon Sep 17 00:00:00 2001 From: teh_coderer Date: Wed, 21 Jun 2023 08:58:31 -0400 Subject: [PATCH] hotfix/ no username on reset (#5161) * fix no username on reset * bump windows to 3.0.2.0 * 3.1.0.0 * Update terminal_helper.py * Update widget_helpers.py * Update poetry.lock * fix dashboards/reports on installer --------- Co-authored-by: andrewkenreich Co-authored-by: James Maslek --- .github/workflows/windows10_build.yml | 6 +++--- build/nsis/setup.nsi | 8 ++++---- build/pyinstaller/version.rc | 4 ++-- openbb_terminal/core/session/sdk_session.py | 1 + openbb_terminal/helper_funcs.py | 2 +- openbb_terminal/reports/reports_model.py | 3 +++ openbb_terminal/reports/widget_helpers.py | 4 +++- openbb_terminal/terminal_controller.py | 2 +- openbb_terminal/terminal_helper.py | 6 ++++-- poetry.lock | 2 +- 10 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/windows10_build.yml b/.github/workflows/windows10_build.yml index 13f35d69be2..fe67fb24ba2 100644 --- a/.github/workflows/windows10_build.yml +++ b/.github/workflows/windows10_build.yml @@ -16,7 +16,7 @@ concurrency: jobs: Windows-Build: name: Windows10 Build ENV - runs-on: windows-2019 + runs-on: windows-latest # Configuring ------------- steps: - name: Setup Windows Git Configuration # This is under the assumption that git is already installed on the system @@ -30,13 +30,13 @@ jobs: - name: Set up Python & Create OpenBB Environment uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.10' - name: Create and start virtual environment run: | python -m venv venv --upgrade-deps source venv/Scripts/activate - python -m pip install setuptools==64.0.2 wheel + python -m pip install setuptools==65.4.1 wheel python -m pip install -r requirements-full.txt python -m pip uninstall papermill -y python -m pip install git+https://github.com/nteract/papermill.git@main diff --git a/build/nsis/setup.nsi b/build/nsis/setup.nsi index 2880fcea498..aa402f0e201 100644 --- a/build/nsis/setup.nsi +++ b/build/nsis/setup.nsi @@ -10,18 +10,18 @@ !define NAME "OpenBB Terminal" !define COMPANY "OpenBB" !define APPFILE "OpenBBTerminal.exe" - !define VERSION "3.0.1" + !define VERSION "3.1.0" !define SLUG "${NAME} v${VERSION}" ;-------------------------------- ; Info for Installer.exe - VIProductVersion 3.0.1.0 + VIProductVersion 3.1.0.0 VIAddVersionKey ProductName "OpenBB Terminal" VIAddVersionKey Comments "An installer for OpenBB Terminal. For additional details, visit OpenBB.co" VIAddVersionKey CompanyName OpenBB.co VIAddVersionKey FileDescription "OpenBB Terminal Program" - VIAddVersionKey FileVersion 3.0.1.0 - VIAddVersionKey ProductVersion 3.0.1.0 + VIAddVersionKey FileVersion 3.1.0.0 + VIAddVersionKey ProductVersion 3.1.0.0 VIAddVersionKey InternalName "OpenBB Terminal" ;-------------------------------- diff --git a/build/pyinstaller/version.rc b/build/pyinstaller/version.rc index 1a99ad72455..44d1c42f6ba 100644 --- a/build/pyinstaller/version.rc +++ b/build/pyinstaller/version.rc @@ -32,10 +32,10 @@ VSVersionInfo( [StringStruct('Comments', 'The OpenBB Terminal. For additional details, visit OpenBB.co'), StringStruct('CompanyName', 'OpenBB'), StringStruct('FileDescription', 'OpenBB Terminal Program'), - StringStruct('FileVersion', '3.0.1.0'), + StringStruct('FileVersion', '3.1.0.0'), StringStruct('InternalName', 'OpenBB Terminal'), StringStruct('ProductName', 'OpenBB Terminal'), - StringStruct('ProductVersion', '3.0.1.0')]) + StringStruct('ProductVersion', '3.1.0.0')]) ]), VarFileInfo([VarStruct('Translation', [1033, 1200])]) ] diff --git a/openbb_terminal/core/session/sdk_session.py b/openbb_terminal/core/session/sdk_session.py index 8f99ac12e86..e531794317e 100644 --- a/openbb_terminal/core/session/sdk_session.py +++ b/openbb_terminal/core/session/sdk_session.py @@ -126,6 +126,7 @@ def whoami(): local_user = is_local() if not local_user: console_print(f"[info]email:[/info] {current_user.profile.email}") + console_print(f"[info]username:[/info] {current_user.profile.username}") console_print(f"[info]uuid:[/info] {current_user.profile.uuid}") else: print_guest_block_msg() diff --git a/openbb_terminal/helper_funcs.py b/openbb_terminal/helper_funcs.py index 6a591e3c145..6a5987af2ab 100644 --- a/openbb_terminal/helper_funcs.py +++ b/openbb_terminal/helper_funcs.py @@ -2265,7 +2265,7 @@ def query_LLM_remote(query_text: str): data = {"prompt": query_text, "accessToken": get_current_user().profile.token} - ask_obbrequest_data = request(url, method="POST", json=data, timeout=10).json() + ask_obbrequest_data = request(url, method="POST", json=data, timeout=15).json() if "error" in ask_obbrequest_data: console.print(f"[red]{ask_obbrequest_data['error']}[/red]") diff --git a/openbb_terminal/reports/reports_model.py b/openbb_terminal/reports/reports_model.py index 0434b4b5f21..7b5facf57b0 100644 --- a/openbb_terminal/reports/reports_model.py +++ b/openbb_terminal/reports/reports_model.py @@ -411,7 +411,10 @@ def ipykernel_launcher(module_file: str, module_hist_file: str): module_hist_file: str History manager file. """ + # pylint: disable=import-outside-toplevel + import matplotlib # noqa + matplotlib.use("agg") IPKernelApp.launch_instance( argv=[ "-f", diff --git a/openbb_terminal/reports/widget_helpers.py b/openbb_terminal/reports/widget_helpers.py index aaba017cc28..dea9cd35cf4 100644 --- a/openbb_terminal/reports/widget_helpers.py +++ b/openbb_terminal/reports/widget_helpers.py @@ -352,7 +352,9 @@ def header( """ try: - plotly_script += f"""""" + plotly_script += ( + f"""""" + ) except Exception: plotly_script += ( "" diff --git a/openbb_terminal/terminal_controller.py b/openbb_terminal/terminal_controller.py index b8908e78052..12cde979297 100644 --- a/openbb_terminal/terminal_controller.py +++ b/openbb_terminal/terminal_controller.py @@ -1083,7 +1083,7 @@ def main( """ if kwargs["module"] == "ipykernel_launcher": bootup() - ipykernel_launcher(kwargs["module_file"], kwargs["module_hist_file"]) + return ipykernel_launcher(kwargs["module_file"], kwargs["module_hist_file"]) if debug: set_system_variable("DEBUG_MODE", True) diff --git a/openbb_terminal/terminal_helper.py b/openbb_terminal/terminal_helper.py index 8e7797d0d29..8836860cede 100644 --- a/openbb_terminal/terminal_helper.py +++ b/openbb_terminal/terminal_helper.py @@ -10,7 +10,7 @@ import webbrowser # IMPORTATION STANDARD from contextlib import contextmanager -from typing import Dict, List, Optional +from typing import Any, Dict, List, Optional import matplotlib.pyplot as plt @@ -373,10 +373,12 @@ def reset(queue: Optional[List[str]] = None): try: # save the current user user_profile = get_current_user().profile - session: Dict[str, str] = { + session: Dict[str, Any] = { "access_token": user_profile.token, "token_type": user_profile.token_type, "uuid": user_profile.uuid, + "username": user_profile.username, + "remember": user_profile.remember, } # remove the hub routines diff --git a/poetry.lock b/poetry.lock index f7b5a6da17a..5ef0e62ecd2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -9707,4 +9707,4 @@ optimization = ["Riskfolio-Lib"] [metadata] lock-version = "2.0" python-versions = "^3.8.1,<3.11, !=3.9.7" -content-hash = "8fda0a5968218020cf85c39956d6eb6e3e9780aac53e697dd6b81f4e686622eb" +content-hash = "58b8a23e28572359e1a9c2623c1f6ff2f2c9cae369ee40c2748909e73f3862af"