From 196242d77480b109a24d2ce6bb04af0ab214dd5e Mon Sep 17 00:00:00 2001 From: James Maslek Date: Thu, 13 Apr 2023 10:46:27 -0400 Subject: [PATCH] delete some more stuff --- .github/workflows/nightly-build.yml | 11 +-- .github/workflows/nightly-pypi.yml | 48 ----------- .../core/session/system_handler.py | 85 ------------------- .../styles/user/hub.richstyle.json | 1 - 4 files changed, 1 insertion(+), 144 deletions(-) delete mode 100644 .github/workflows/nightly-pypi.yml delete mode 100644 openbb_terminal/core/session/system_handler.py delete mode 100644 openbb_terminal/miscellaneous/styles/user/hub.richstyle.json diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index c7dc9540d1b..9e0a06275b0 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -45,7 +45,7 @@ jobs: with: workflow: docker-build.yml token: ${{ secrets.GITHUB_TOKEN }} - + trigger-pypi-build: runs-on: ubuntu-latest steps: @@ -54,12 +54,3 @@ jobs: with: workflow: pypi-nightly.yml token: ${{ secrets.GITHUB_TOKEN }} - - trigger-pypi-build: - runs-on: ubuntu-latest - steps: - - name: Trigger PyPI Build - uses: aurelien-baudet/workflow-dispatch@v2 - with: - workflow: nightly-pypi.yml - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/nightly-pypi.yml b/.github/workflows/nightly-pypi.yml deleted file mode 100644 index add039c9ef2..00000000000 --- a/.github/workflows/nightly-pypi.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Deploy to PyPI - Nightly - -on: workflow_dispatch - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - deploy-nightly-pypi: - name: Build and publish nightly distributions 📦 to PyPI - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Setup Python 3.9 - uses: actions/setup-python@v4 - with: - python-version: "3.9" - - - name: Update version in pyproject.toml and Edit docs - run: | - sed -i 's/name = ".*"/name = "openbb-nightly"/' pyproject.toml - sed -i "3s/version = \"\(.*\)\"/version = \"\1.dev$(date +%Y%m%d)\"/" pyproject.toml - head pyproject.toml - sed -i 's/pip install openbb/pip install openbb-nightly/g; s/from openbb_terminal.sdk import openbb/from openbb_terminal.sdk import openbb-nightly/g' ./website/pypi.md - - - - name: Install pypa/build - run: >- - python -m - pip install - build - --user - - - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . - - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.NIGHTLY_PYPI_API_TOKEN }} diff --git a/openbb_terminal/core/session/system_handler.py b/openbb_terminal/core/session/system_handler.py deleted file mode 100644 index aa122b30405..00000000000 --- a/openbb_terminal/core/session/system_handler.py +++ /dev/null @@ -1,85 +0,0 @@ -import atexit -import json -import os -from pathlib import Path - -from pydantic.json import pydantic_encoder - -from openbb_terminal.core.config.paths import ( - SETTINGS_DIRECTORY, -) -from openbb_terminal.core.models import SystemModel -from openbb_terminal.core.session.env_handler import load_env_to_model, reading_env - -SYSTEM_FILE_PATH = SETTINGS_DIRECTORY / "system.json" - - -def handle_system(file_path: Path = SYSTEM_FILE_PATH) -> SystemModel: - """ - Handle the system. - - Reads system data from file if it exists, else reads environment variable data. - Returns a system model built from the loaded data. - - Parameters - ---------- - file_path (Path): The file path. - - Returns - ------- - SystemModel: The system model. - """ - - try: - if os.path.isfile(file_path): - system_data = {} - with open(file_path) as f: - system_data = json.load(f) - if system_data: - return load_env_to_model(system_data, SystemModel) - except Exception: - pass - - __env_dict = reading_env() - system = load_env_to_model(__env_dict, SystemModel) - save_system(system=system, file_path=file_path) - subscribe_delete_system_on_exit(file_path=file_path) - return system - - -def save_system(system: SystemModel, file_path: Path = SYSTEM_FILE_PATH): - """ - Write system to file. - - Parameters - ---------- - system (SystemModel): The system model. - file_path (Path): The file path. - - Returns - ------- - system (SystemModel): The system model. - """ - - try: - with open(file_path, "w") as f: - json_content = json.dumps(system, default=pydantic_encoder) - f.write(json_content) - except Exception: - pass - - -def subscribe_delete_system_on_exit(file_path: Path): - """ - Deletes the system file on exiting the application. - - Parameters - ---------- - file_path (Path): The file path. - """ - - def delete_file(file_path: Path): - if os.path.isfile(file_path): - os.remove(file_path) - - atexit.register(delete_file, file_path=file_path) diff --git a/openbb_terminal/miscellaneous/styles/user/hub.richstyle.json b/openbb_terminal/miscellaneous/styles/user/hub.richstyle.json deleted file mode 100644 index af431837305..00000000000 --- a/openbb_terminal/miscellaneous/styles/user/hub.richstyle.json +++ /dev/null @@ -1 +0,0 @@ -{"src": "rgb(255,255,255)", "cmds": "rgb(102,232,95)", "help": "rgb(98,79,0)", "info": "rgb(224,131,48)", "menu": "rgb(77,236,231)", "param": "rgb(103,80,5)"} \ No newline at end of file