Files
OpenBB/.github/workflows
tehcoderer 11be14a3d4 Squashed commit of the following:
commit c8c7d836ea
Merge: 1165e57b40 564d08edd8
Author: Theodore Aptekarev <aptekarev@gmail.com>
Date:   Sat Aug 5 15:09:10 2023 +0300

    Merge branch 'develop' into feature/openbb-sdk-v4

commit 564d08edd8
Author: Pratyush Shukla <ps4534@nyu.edu>
Date:   Fri Aug 4 23:25:47 2023 +0530

    add `--india` flag to `stocks/load` (#5281)

    * add `--india` flag to `stocks/load`

    Add ticker, set `india` and voila!

    * updated "help"

    * added check for `.ns`, `.NS` in ticker

    * consolidated conditions into 1 line

commit 1165e57b40
Author: montezdesousa <montezdesousa@gmail.com>
Date:   Fri Aug 4 10:56:20 2023 +0100

    make some provider args optional

commit afbd4a69aa
Author: montezdesousa <montezdesousa@gmail.com>
Date:   Fri Aug 4 10:45:28 2023 +0100

    rename some fetcher vars

commit 8f0b748270
Author: montezdesousa <montezdesousa@gmail.com>
Date:   Fri Aug 4 10:37:43 2023 +0100

    move helpers and descriptions to util.py directory

commit 41e800ad6a
Author: James Maslek <jmaslek11@gmail.com>
Date:   Fri Aug 4 05:06:15 2023 -0400

    Custom request for all providers (#5280)

    * breakpoint 1

    * breakpoint pt 1

    * Finish fred request

    * Add **kwargs to all fmp funcs

    * Moved all fmp funcs to custom request

    * benzinga requests

    * add polygon requests

    * remove comment

    * move make_request to helpers

    ---------

    Co-authored-by: montezdesousa <montezdesousa@gmail.com>

commit dbc6751843
Merge: ce5b93ae4e f1eee44cab
Author: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
Date:   Fri Aug 4 07:37:11 2023 +0100

    Merge branch 'develop' into feature/openbb-sdk-v4

commit ce5b93ae4e
Author: James Maslek <jmaslek11@gmail.com>
Date:   Thu Aug 3 19:59:51 2023 -0400

    Custom args to package builder (#5282)

commit ed07f6ad4c
Author: montezdesousa <montezdesousa@gmail.com>
Date:   Fri Aug 4 00:46:12 2023 +0100

    200 breaks polygon

commit f1eee44cab
Author: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Date:   Thu Aug 3 13:58:47 2023 -0700

    Feature/options_views: Add a Variety of Views/Charts to Extend the OptionsChains Class (#5222)

    * add options_chains_view

    * vsurf charts

    * skew for strike vs contract

    * doc string

    * add chart_volatility

    * linting

    * codespell

    * mypy

    * types

    * tmx mypy

    * update test file

    * add synthetic long/short to strategies

    * updates test_options_chains_model.py

    * updates some docstrings

    * update documentation

    * actually commit the documentation page

    * update documentation screenshots

    * try catch for 403 error

    * add tests for options_chains_view

    * int64

    * SPX error handling

    * add cboe options dashboard for terminal

    * codespell

    * enable mouse scroll wheel zoom for charts

    * declare key values for all widgets

    * add some more streamlit charts and tables

    * fix test_yfinance_view.py

    * conflict resolution

    * test

    ---------

    Co-authored-by: James Maslek <jmaslek11@gmail.com>

commit d575c5d52a
Author: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Date:   Thu Aug 3 12:56:44 2023 -0700

    Fwd P/E regex fix (#5273)

commit 373c4f1ea7
Author: DidierRLopes <dro.lopes@campus.fct.unl.pt>
Date:   Thu Aug 3 10:25:47 2023 -0500

    Update all_api_keys.json (#5277)

    * Update all_api_keys.json

    * Update CONTRIBUTING.md

    * Create json-yaml-validate

    * Update release-drafter.yml

    * Update json-yaml-validate

    * fix test

    * add json lint to general

    * Update tsconfig.json

    * Add a json_validate exclude to not check tests and certain known violations

    * fix workflow

    * not sure why this didnt exclude?

    ---------

    Co-authored-by: James Maslek <jmaslek11@gmail.com>

commit 70f70a81b4
Author: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Date:   Thu Aug 3 12:43:55 2023 +0100

    Hotfix/sdk py38 (#5279)

    * replace unsupported Annotated, MappingProxyType, is_annotated_dc

    * fix package builder

commit 61afffb1f5
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:56:40 2023 +0100

    typing

commit 0b3b30eccc
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:51:07 2023 +0100

    rename exception for better localization

commit 49fe650117
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:43:54 2023 +0100

    update provider readme

commit 1e0a3c36c4
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:43:19 2023 +0100

    update provider readme

commit 9a1b4a8fba
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:42:02 2023 +0100

    update provider readme

commit 6b93a603dc
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 16:37:54 2023 +0100

    update provider readme

commit 13d95452c3
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 15:50:20 2023 +0100

    to follow the convention

commit e3d65b502f
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 14:49:19 2023 +0100

    filter

commit cc5a334258
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Aug 2 14:42:14 2023 +0100

    cleanup filters

commit be864d01f3
Author: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Date:   Wed Aug 2 14:17:20 2023 +0100

    Feature/provider refactoring (#5266)

    * remove comment

    * replace registry description

    * black and add some todos

    * remove unused var

    * allow description and move provider to title

    * fix the data field descriptions

    * refactor globalnews

    * added `"limit"` to metadata descriptions

    * fix cpi command and refactor

    * refactored `AnalystEstimates`

    * add concat param

    * refactored `AvailableIndices` for `economy.available_indices`

    * sort and set index to date

    * place it inside exception

    * move literals to core

    * rename descriptions dict

    * add descriptions to cpi data

    * change description

    * black

    * refactored `CompanyOverview` for `stocks.fa.overview`

    * Updated `DATA_DESCRIPTIONS` in provider metadata

    * Updated `symbol` description in `DATA_DESCRIPTIONS`

    * fix stock_news alias

    * pass standard limit

    * fix stock news

    * fix to datframe

    * rebuild python interface

    * refactored `CryptoEOD` for `crypto.load`

    * added Field descriptions

    * fix polygon stock_news

    * fix stock_news data

    * ruff

    * refactored `DividendCalendar` for `stocks.fa.cal`

    * refactored `EarningsCalendar` for `stocks.fa.cal`

    * refactored `EarningsCallTranscript` for `stocks.fa.transcript`

    * refactored `ExecutiveCompensation` for `stocks.fa.comp`

    * first round, refactor registry, executor, map

    * ruff

    * Allow alias in the provider models for provider specific params

    * Updated stock news to use alias in query

    * small fixes

    * fix interface bug

    * black

    * exceptions and typing

    * ruff

    * fix docstring

    * sort providers

    * push static assets without docstrings

    * date Field and optional dates params in `CryptoEOD` for fmp and polygon

    * refactored `ForexEOD` for `forex.load`

    * add comment

    * refactored `ForexPairs` and added Polygon provider

    * removed `_price` models from fmp and polygon

    * Updated `economy.index` to use `MajorIndicesEOD`

    * removed `_price` from sdk models

    * refactored `MajorIndicesEOD` for `economy.index`

    * refactored `StockEOD` for `stocks.load`

    * regenerate sdk

    * ruff

    * fix bug with global_news

    * typing

    * add docstrings to registry map

    * update docstrings

    * add executor query arg

    * follow convention

    * docstring

    * inject provider interface instead

    * doc

    * safer this way

    * docs

    * add abstractmethod decorator

    * add explicit fetcher property model_name

    * remove mode_name prop

    * get model name from query params

    * force extra params or data to be optional

    * replace fetcher list by fetcher dict and black

    * explicit depps in prov interface

    * explicit depps in prov interface

    * no formatted creds

    * no formatted creds

    * dep injection

    * dep injection

    * private methods

    * just verify credentials

    * docstring

    * typing and cut doc

    * typing

    * typing

    * typing

    * no overkill

    * ruff

    * don't block if model not found, just warn

    * don't block if model not found, just warn

    * don't block if model not found, just warn

    * empty list if creds None

    * check creds before request

    * just return the data

    * typing

    * move query params

    * ruff

    * move queryparams

    * move queryparams

    * move queryparams

    * fix a bunch o polygon models

    * ruff

    * partial fix fmp models

    * ruff

    * refactor more fmps

    * create dict by alias

    * refactor more fmp endpoints

    * bug

    * add params to transform query

    * ruff

    * fix fmp bugs

    * has to be annotation

    * rewrite static

    * typing

    * append return type to map

    * support return for generic data type

    * remove return type for openbb provider

    * add todo

    * fix small fred typing error

    * add more return type info

    * better message

    * handle multiple types of data (the fetcher should declare them later)

    * add comment

    * ruff

    * handle returns with generic for now (check juan solution)

    * fix bug with generic

    * fix fmp fetchr dict

    * fill return type in the provider lib for docstrings

    * polygon stock news

    * Update economy_router.py (#5254)

    * remove return type stuff

    * adapt cpi and overview

    * rewrite python interface

    * fix to_dataframe

    * limit stocks eod output

    * rename method

    * mypy

    * mypy

    * mypy chart style

    * mypy provider

    * mypy ignores

    * mypy credentials

    * Added Statements Growth endpoints from FMP

    * account mypy fix

    * privatize account method

    * one more mypy

    * remove mypy ignore

    * rename private method

    * Linting

    * Docstring generation

    * Linting

    * move provider.py into __init__.py

    * add default to required_credentials -> None

    * refactored `KeyExecutives` for `stocks.fa.mgmt`

    * refactored `HistoricalEmployees` for `stocks.fa.emp`

    * provider docstring

    * docstring

    * refactored `HistoricalStockSplits` for `stocks.fa.split`

    * standardised date in stockeod

    * refactored ``InstitutionalOwnership` for `stocks.fa.own`

    * removed unused imports

    * add `check_fields=False` in `@validator`

    * historical dividens

    * remove unused helper

    * move single used helpers to where they are used

    * move single used helpers to where they are used

    * move single used helpers to where they are used

    * standardise date, vwap in crypto eod and forex eod

    * rename __commands__ to __extensions__

    * change coverage separator

    * the map cannot change sep

    * sry

    * sry again

    * remove comment

    * refactored `MajorIndicesConstituents` for `economy.const`

    * add some descriptions about provider

    * refactored `PriceTargetConsensus` for `stocks.fa.pt`

    * refactored `PriceTarget` for `stocks.fa.pta`

    * refactored `RevenueBusinessLine` for `stocks.fa.revseg`

    * change metadata file name

    * docstring

    * remove unecessary arg

    * ruff & black

    * refactored `RevenueGeographic` for `stocks.fa.revgeo`

    * refactored `RiskPremium` for `economy.risk`

    * refactored `SECFilings` for `stocks.dd.sec`

    * refactored `ShareStatistics` for `stocks.fa.shrs`

    * refactored `StockInsiderTrading` for `stocks.fa.ins`

    * peers

    * stock splits

    * refactored `KeyMetrics` for `stocks.fa.metrics`

    * refactored `StockMultiples` for `stocks.multiples`

    * refactor income statement

    * rebuild

    * fmp balance

    * added `StocksOwnership` to `stocks.fa.own`

    * added `InstitutionalOwnership` to `stocks.fa.ins_own`

    * refactored `StocksOwnership` for `stocks.fa.own`

    * cleanup

    * refactored `TreasuryRates` for `fixedincome.treasury`

    * reorder balance items

    * fix polygon bs

    * refactored `IncomeStatement` for `stocks.fa.balance`

    * refactored base and types

    * added static files

    * cleanup

    * cleanup

    * refactored `CashFlowStatement` for `stocks.fa.cash`

    * added `stocks/fa` static file

    * black and ruff

    ---------

    Co-authored-by: Pratyush Shukla <ps4534@nyu.edu>
    Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>

commit 2066d7d4be
Merge: fe1073da09 07537199af
Author: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
Date:   Wed Aug 2 05:37:20 2023 +0100

    Merge branch 'develop' into feature/openbb-sdk-v4

commit 07537199af
Author: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Date:   Tue Aug 1 17:27:59 2023 +0100

    Move hub api keys ts (#5267)

    * move hub api keys ts

    * json instead

    * update contributing.md

    * Update all_api_keys.json

    ---------

    Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>

commit ae91a3f9b9
Author: teh_coderer <me@tehcoderer.com>
Date:   Tue Aug 1 11:05:29 2023 -0500

    Hotfix  `economy/overview` rates displaying as dates (#5269)

    * fix: `economy/overview` rates displaying as dates

    * Fix Test

    ---------

    Co-authored-by: James Maslek <jmaslek11@gmail.com>

commit 3b5fc53cc7
Author: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Date:   Tue Aug 1 06:41:21 2023 -0700

    Adds details/image for installing C++ Build Tools (#5268)

    * Adds details/image for installing C++ Build Tools

    * Update installation_updates.md with screenshots

    * Update installation_updates.md

    Screenshots for MS C++ Build Tools

commit fe1073da09
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Tue Aug 1 12:29:42 2023 +0100

    only allow setup for allowed system fields

commit c8f82e1f8f
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Tue Aug 1 12:04:16 2023 +0100

    reorder system settings attrs

commit 21c69a510f
Merge: 379a5518fa d212a8e270
Author: Theodore Aptekarev <aptekarev@gmail.com>
Date:   Mon Jul 31 20:17:30 2023 +0300

    Merge branch 'develop' into feature/openbb-sdk-v4

commit d212a8e270
Author: Danglewood <85772166+deeleeramone@users.noreply.github.com>
Date:   Mon Jul 31 09:05:22 2023 -0700

    hotfix/gdp-units - better GDP units (#5262)

    * better GDP units

    * mypy

    * remove not needed dict

    * test_oecd_view.py

    * test_oecd_model.py

commit dc30ab3d36
Author: teh_coderer <me@tehcoderer.com>
Date:   Fri Jul 28 21:13:42 2023 -0500

    Hotfix/ locking when deploying streamlit app (#5261)

    * fix locking when deploying streamlit app

    * Update streamlit_run.py

    * Update streamlit_run.py

commit 379a5518fa
Author: hjoaquim <h.joaquim@campus.fct.unl.pt>
Date:   Fri Jul 28 10:00:39 2023 +0100

    small comment on show() implementation

commit 849e6134ee
Merge: 27e1728027 73348c0872
Author: Theodore Aptekarev <aptekarev@gmail.com>
Date:   Thu Jul 27 19:23:10 2023 +0300

    Merge branch 'develop' into feature/openbb-sdk-v4

commit 27e1728027
Merge: afe4c480a2 41d1359202
Author: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
Date:   Thu Jul 27 15:04:19 2023 +0100

    Merge branch 'develop' into feature/openbb-sdk-v4

commit afe4c480a2
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Jul 26 14:33:37 2023 +0100

    fix comment

commit 531fa104c8
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Jul 26 14:32:00 2023 +0100

    rename method and add description

commit cc1a84b4d0
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Jul 26 13:15:55 2023 +0100

    change method description

commit ff31d9ab87
Author: Diogo Sousa <montezdesousa@gmail.com>
Date:   Wed Jul 26 12:52:54 2023 +0100

    check sdk token expiration on login
2023-08-06 19:42:40 -04:00
..
2023-04-11 18:53:05 +00:00
2023-05-10 13:59:35 +00:00
2023-04-11 18:53:05 +00:00
2023-04-11 18:53:05 +00:00
2023-08-06 19:42:40 -04:00
2023-05-10 13:59:35 +00:00
2023-04-18 20:20:58 +00:00
2023-03-01 08:47:12 -05:00
2023-04-11 18:53:05 +00:00

OpenBB Workflows

This directory contains the workflows for the OpenBB 🦋 Project. The workflows are:

Workflows Summary Branches
branch-name-check.yml Checks if the branch name is valid and follows the naming convention. all branches
build-release.yml Builds the project and runs the tests. main, release/*
docker-build.yml Builds the docker image and pushes it to the docker hub. all branches (only pushes to docker hub on main)
draft-release.yml Creates a draft release when a new tag is pushed. -
gh-pages.yml Builds the documentation and deploy to github pages. main and release/*
integration-test.yml Runs the integration tests. all branches
labels-issue.yml Creates an issue when a new bug is reported. -
labels-PR.yml Adds labels to the issues and pull requests. -
linting.yml Runs the linters. all branches
macos-build.yml Builds the project on M1 Macs. develop, main, release/*
macos-ml.yml Builds the project on Mac OS X Full Clean Build with ML. main
nightly-build.yml Builds the project and runs the integration tests every night on the develop branch. develop
pypi.yml Publishes the package to PyPI. all branches (only pushes to PyPI on main)
pypi-nightly.yml Publishes the package to PyPI every night on the develop branch. develop
unit-test.yml Runs the unit tests. all branches
windows_ml.yml Builds the project on Windows 10 Full Clean Build with ML. main
windows10_build.yml Builds the project on Windows 10. all branches

Branch Name Check Workflow

Objective: To check if pull request branch names follow the GitFlow naming convention before merging.

Triggered by: A pull request event where the target branch is either develop or main.

Branches checked: The source branch of a pull request and the target branch of a pull request.

Steps:

  1. Extract branch names: Using the jq tool, the source and target branch names are extracted from the pull request event. The branch names are then stored in environment variables and printed as output.

  2. Show Output result for source-branch and target-branch: The source and target branch names are printed to the console.

  3. Check branch name for develop PRs: If the target branch is develop, then the source branch is checked against a regular expression to ensure that it follows the GitFlow naming convention. If the branch name is invalid, a message is printed to the console and the workflow exits with a status code of 1.

  4. Check branch name for main PRs: If the target branch is main, then the source branch is checked against a regular expression to ensure that it is either a hotfix or a release branch. If the branch name is invalid, a message is printed to the console and the workflow exits with a status code of 1.

Note: The GitFlow naming convention for branches is as follows:

  • Feature branches: feature/
  • Hotfix branches: hotfix/
  • Release branches: release/<major.minor.patch>(rc)

Build Release Workflow

This GitHub Actions workflow is responsible for building and releasing software for multiple platforms (Windows, M1 MacOS, Intel MacOS, and Docker). The workflow has four jobs:

  • trigger-windows-build
  • trigger-macos-build
  • trigger-intel-build
  • trigger-docker-build

Each job uses the aurelien-baudet/workflow-dispatch action to trigger another workflow, respectively windows10_build.yml, m1_macos_build.yml, intel_macos_build.yml, and docker.yml. The GITHUB_TOKEN is passed as a secret so that the triggered workflows have access to the necessary permissions. The wait-for-completion-timeout is set to 2 hours, which is the maximum amount of time the job will wait for the triggered workflow to complete.

Docker Workflow

This GitHub Actions workflow is responsible for building and pushing the docker image to the itHub Container Registry. This workflow is triggered when a new change is pushed to the main branch of the repository, and the Docker image is published to the GitHub Container Registry.

Steps

  1. Checkout Code: This step checks out the code from the GitHub repository.

  2. Login to GitHub Container Registry: This step logs into the GitHub Container Registry using the GitHub Actions token.

  3. Setup Commit Hash: This step sets the commit hash of the code that is being built.

  4. Build Env File: This step builds the environment file for the Docker image.

  5. Building the Docker Image: This step builds the Docker image using the scripts in the build/docker directory.

  6. Publishing the Docker Image: This step publishes the Docker image to the GitHub Container Registry. The Docker image is only pushed to the registry if the branch being built is main.

Release Drafter Workflow

This GitHub Actions workflow is designed to automatically generate and update draft releases in a GitHub repository. The workflow is triggered when it is manually dispatched, allowing you to control when the draft releases are updated.

GH Pages Workflow

This GitHub Actions workflow is responsible for building the documentation and deploying it to GitHub Pages. This workflow is triggered when a new change is pushed to the main or release branch of the repository, and the documentation is published to GitHub Pages.

Integration Test Workflow

This GitHub Action is used to run integration tests on your code repository. It is triggered on pushes to the release/* or main branches, and it runs on the latest version of Ubuntu.

The workflow consists of the following steps:

  1. Check out the code from the repository
  2. Set up Python 3.9
  3. Install Poetry, a package and dependency manager for Python
  4. Load a cached virtual environment created by Poetry, to speed up the process if possible
  5. Install dependencies specified in the poetry.lock file
  6. Run the integration tests using the terminal.py script
  7. Upload a summary of the test results to Slack

The results of the tests are captured in a file called result.txt. The summary of the tests, including information about failed tests, is then uploaded to Slack using the adrey/slack-file-upload-action GitHub Action.

Linting Workflow

This GitHub Actions workflow is responsible for running linting checks on the codebase. This workflow is triggered on pull request events such as opened, synchronize, and edited, and push events on branches with names that start with feature/, hotfix/, or release/. The workflow also sets a number of environment variables and uses Github Actions caching to improve performance.

It consists of two jobs: code-linting and markdown-link-check.

The first job, code-linting, runs on an Ubuntu machine and performs several linting tasks on the code in the repository, including:

  • Checking out the code from the repository
  • Setting up Python 3.9
  • Installing a number of Python packages necessary for the linting tasks
  • Running bandit to check for security vulnerabilities
  • Running black to check the code formatting
  • Running codespell to check the spelling of comments, strings, and variable names
  • Running ruff to check the use of Python
  • Running mypy to check the type annotations
  • Running pyupgrade to upgrade Python 2 code to Python 3
  • Running pylint to perform static analysis of the code

The second job, markdown-link-check, runs on an Ubuntu machine and performs linting of the markdown files in the repository. It uses a Docker container avtodev/markdown-lint to perform the linting.

MacOS Build Workflow

This GitHub Actions workflow is used to build a version of the OpenBB Terminal for M1 MacOS. The build process includes installing necessary dependencies, building the terminal application using PyInstaller, creating a DMG file for distribution, and running integration tests on the built application.

Jobs

The workflow consists of a single job named Build which runs on self-hosted MacOS systems with ARM64 architecture. The job performs the following steps:

  1. Checkout: The main branch of the repository is checked out, allowing for the commit hashes to line up.
  2. Git Log: The log of the Git repository is displayed.
  3. Install create-dmg: The create-dmg tool is installed using Homebrew.
  4. Clean Previous Path: The previous PATH environment variable is cleared and restored to its default values.
  5. Setup Conda Caching: The miniconda environment is set up using a caching mechanism for faster workflow execution after the first run.
  6. Setup Miniconda: Miniconda is set up using the conda-3-9-env-full.yaml environment file, with channels conda-forge and defaults, and with the build_env environment activated.
  7. Run Poetry: Poetry is used to install the dependencies for the project.
  8. Install PyInstaller: PyInstaller is installed using Poetry.
  9. Poetry Install Portfolio Optimization and Forecasting Toolkits: The portfolio optimization and forecasting toolkits are installed using Poetry.
  10. Install Specific Papermill: A specific version of Papermill is installed using pip.
  11. Build Bundle: The terminal application is built using PyInstaller, with icons and assets copied to the DMG directory.
  12. Create DMG: The DMG file is created using the create-dmg tool.
  13. Clean up Build Artifacts: The build artifacts such as the terminal directory and DMG directory are removed.
  14. Save Build Artifact DMG: The DMG file is saved as a build artifact.
  15. Convert & Mount DMG: The DMG file is converted and mounted.
  16. Directory Change: The current directory is changed to the mounted DMG file.
  17. Unmount DMG: The mounted DMG file is unmounted.
  18. Run Integration Tests: The built terminal application is run with integration tests, and the results are displayed.

Finally, the integration tests are run and the results are logged. The workflow is configured to run only when triggered by a workflow dispatch event and runs in a concurrent group, with the ability to cancel in-progress jobs.

Nightly Build Workflow

This code is a GitHub Actions workflow configuration file that is used to trigger other workflows when certain events occur. The main purpose of this workflow is to trigger builds on different platforms when a release is made or a pull request is made to the main branch.

This workflow is triggered at UTC+0 daily by the GitHub Action schedule event.

The job includes the following steps:

  1. Trigger Windows Build: This step uses the aurelien-baudet/workflow-dispatch action to trigger the windows10_build.yml workflow.

  2. Trigger macOS Build: This step uses the aurelien-baudet/workflow-dispatch action to trigger the m1_macos_build.yml workflow

  3. Trigger Intel Build: This step uses the aurelien-baudet/workflow-dispatch action to trigger the intel_macos_build.yml workflow

  4. Trigger Docker Build: This step uses the aurelien-baudet/workflow-dispatch action to trigger the docker.yml workflow

This workflow also uses a concurrency setting that groups the jobs by the workflow and ref, and cancels any in-progress jobs.

Nightly PyPI Publish Workflow

This workflow is used to publish the latest version of the OpenBB Terminal to PyPI. The workflow is triggered at UTC+0 daily by the GitHub Action schedule event.

It does this by first updating the pyproject.toml file with a pre-determined version string of the form <currentVersion>.dev<date>, where <date> represents the current day's date as a 8 digit number.

Then, the code installs pypa/build and uses python -m build to create a binary wheel and a source tarball in the dist/ directory.

Finally, it uses the PyPA specific action gh-action-pypi-publish to publish the created files to PyPI.

PYPI publish Workflow

The Github Action code Deploy to PyPI is used to deploy a Python project to PyPI (Python Package Index) and TestPyPI, which is a separate package index for testing purposes. The code is triggered on two events:

  1. Push event: The code is triggered whenever there is a push to the release/* and main branches.

  2. Workflow dispatch event: The code can be manually triggered by the workflow dispatch event.

The code sets the concurrency to the group and the option cancel-in-progress is set to true to ensure that the running jobs in the same group are cancelled in case another job is triggered.

The code contains two jobs, deploy-test-pypi and deploy-pypi, both of which have the same steps with slight variations.

The deploy-test-pypi job is triggered only if the pushed branch starts with refs/heads/release/. This job sets up the Python environment, installs the build package using pip, builds binary wheel and source tarball using build, and finally, publishes the distributions to TestPyPI using the pypa/gh-action-pypi-publish@release/v1 Github Action. The password to access TestPyPI is stored as a secret named TEST_PYPI_API_TOKEN.

Similarly, the deploy-pypi job is triggered only if the pushed branch starts with refs/heads/main. This job follows the same steps as deploy-test-pypi, but the distributions are published to PyPI instead of TestPyPI. The password to access PyPI is stored as a secret named PYPI_API_TOKEN.

Note: The code uses the pypa/build package for building the binary wheel and source tarball, and the pypa/gh-action-pypi-publish@release/v1 Github Action for publishing the distributions to PyPI and TestPyPI.

Unit Tests Workflow

This workflow is used to run unit tests on the OpenBB Terminal. The workflow is triggered on the following events: The events this workflow will respond to are:

  1. Pull requests that are opened, synchronized, edited, or closed. The pull request must be made to the develop or main branches.

  2. Pushes to the release/* branches.

Each job in the workflow specifies a set of steps that are executed in order.

The first job, check-files-changed, checks whether there are any changes to certain file types in the repository, such as Python files and lockfiles. If there are changes, then the check-changes output variable is set to true.

The next job, base-test, runs a series of tests if check-changes is true and the base branch of the pull request is develop. This job sets up a Python 3.9 environment, installs Poetry, and then runs tests using pytest. Finally, it starts the terminal and exits.

The next job, tests-python, runs tests for different versions of Python (3.8, 3.9, and 3.10) on the ubuntu-latest operating system. It sets up the specified Python version, installs Poetry and dependencies, and then runs tests using pytest.

The next job, full-test, uses the GitHub Actions checkout action to checkout the code, followed by the setup-python action to set up the specified version of Python. Then, the install-poetry action is used to install the package manager Poetry, and a cache is set up using the actions/cache action to avoid re-installing dependencies. After that, the dependencies are installed using Poetry, and a list of installed packages is displayed. Then, the tests are run using pytest, and finally, the terminal.py script is started and exited.

The last job, tests-conda, sets up a Miniconda environment using the setup-miniconda action. The environment is specified using a YAML file and is activated. Then, the tests are run.

Windows 10 Build Workflow

This is a GitHub Actions workflow file that automates the build and testing process for the OpenBB Terminal on Windows 10. The workflow consists of two jobs:

  1. Windows-Build
  2. Build-Exe
  • The Windows-Build job does the following:
    • Sets up the Windows Git configuration for long file paths.
    • Checks out the repository code.
    • Sets up Python 3.9 and creates an OpenBB environment using poetry.
    • Installs necessary packages and builds the terminal using PyInstaller.
    • Uploads the built artifact to GitHub as an artifact.
  • The Build-Exe job does the following:
    • Sets up the Windows Git configuration for long file paths.
    • Checks out the repository code.
    • Downloads the built artifact from the previous Windows-Build job.
    • Copies the files into an app folder for building the EXE file.
    • Builds the EXE file using NSIS.
    • Uploads the built EXE as an artifact to GitHub.
    • Runs integration tests on the terminal and saves the results to a text file.
    • Uploads the test results summary to Slack.
    • Cleans up previous build files and artifacts.

This workflow is triggered by the workflow_dispatch event and runs in concurrency with other workflows in the same group, with the ability to cancel in-progress builds. The concurrency group is defined as ${{ github.workflow }}-${{ github.ref }}.