mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-01 15:01:18 +00:00
* Allow optional input for 2-month treasury rates and add FederalReserve rates model The commit includes two main changes. One being the modification to the standard treasury rate models, where the 2-month input field is now optional, and a default value is set to none. The other main change is the addition of a new module for the FederalReserve treasury rates model, which includes query parameters, a data model, and a data fetcher. * Add Money Measures models and commands This commit introduces new Money Measures models to handle money-related data, defines Money Measures commands in the economy router, and implements the Federal Reserve Money Measures model. The core model includes fields like start_date, end_date, and various components of the money supply. The new command added to the economy router allows the querying of these data. * Add Federal Reserve Money Measures test file This commit adds a test case file for the Federal Reserve Money Measures fetcher in the Federal Reserve module. The test case includes simulating a GET request and the corresponding expected response from the server. * Cleanup * Sneaky unformatted integration tests * its a dawg life for me ...... ruff * add the fed funds rate * didnt mean to commmit this * black * this is why we should pre commit kids * change install name * add providers to int tests * review comments + commit static * replace nan with None * fix float on None * get rid of nans for nulls for json handling * change `_` to `-` in readme pip install. * Update __init__.py docstring * Debug pylint * Adjust the fetch depth --------- Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
107 lines
3.7 KiB
YAML
Vendored
107 lines
3.7 KiB
YAML
Vendored
name: General Linting
|
|
|
|
env:
|
|
OPENBB_ENABLE_QUICK_EXIT: true
|
|
OPENBB_LOG_COLLECT: false
|
|
OPENBB_USE_PROMPT_TOOLKIT: false
|
|
OPENBB_FILE_OVERWRITE: true
|
|
PIP_DEFAULT_TIMEOUT: 100
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, edited]
|
|
push:
|
|
branches:
|
|
- "feature/*"
|
|
- "hotfix/*"
|
|
- "release/*"
|
|
merge_group:
|
|
types: [checks_requested]
|
|
|
|
# Cancel previous runs that are not yet completed.
|
|
concurrency:
|
|
group: ${{ github.event_name }}-${{ github.repository }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
code-linting:
|
|
name: General Code Linting
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # actions/checkout v3.0.2
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
fetch-depth: 20
|
|
|
|
- name: Fetch base branch
|
|
run: git fetch --no-tags --depth=20 origin ${{ github.base_ref }}
|
|
|
|
- name: Setup Python 3.9
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.9"
|
|
architecture: x64
|
|
|
|
- name: Get changed files in openbb_terminal and openbb_platform for PR
|
|
if: github.event_name == 'pull_request'
|
|
run: |
|
|
# "Checking PR diff"
|
|
echo "terminal_files=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_terminal/.*\.py$' | xargs)" >> $GITHUB_ENV
|
|
echo $terminal_files
|
|
echo "platform_files=$(git diff --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_platform/.*\.py$' | grep -v 'openbb_platform/openbb/package' | grep -v 'integration' | grep -v 'tests' | xargs)" >> $GITHUB_ENV
|
|
echo $platform_files
|
|
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-linting-${{ hashFiles('**/poetry.lock') }}
|
|
restore-keys: ${{ runner.os }}-linting-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
- run: |
|
|
pip install bandit black codespell==2.2.5 mypy==1.5.1 pylint==2.17.0 ruff==0.0.285
|
|
pip install types-pytz types-requests types-termcolor types-tabulate types-PyYAML types-python-dateutil types-setuptools types-six
|
|
- run: bandit -x ./tests -r . || true
|
|
- run: black --diff --check .
|
|
- run: codespell --ignore-words=.codespell.ignore --skip="$(tr '\n' ',' < .codespell.skip | sed 's/,$//')" --quiet-level=2
|
|
- run: ruff .
|
|
- run: |
|
|
# Run linters for openbb_terminal
|
|
if [ -n "${{ env.terminal_files }}" ]; then
|
|
mypy --ignore-missing-imports ${{ env.terminal_files }}
|
|
pylint terminal.py ${{ env.terminal_files }}
|
|
else
|
|
echo "No Python files changed in openbb_terminal"
|
|
fi
|
|
- run: |
|
|
# Run linters for openbb_platform
|
|
if [ -n "${{ env.platform_files }}" ]; then
|
|
# Add mypy to this part of the linting workflow once we're ready
|
|
pylint ${{ env.platform_files }}
|
|
else
|
|
echo "No Python files changed in openbb_platform"
|
|
fi
|
|
|
|
markdown-link-check:
|
|
name: Markdown Linting
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
name: Check out the code
|
|
- name: Lint Code Base
|
|
uses: docker://avtodev/markdown-lint:v1
|
|
with:
|
|
args: "./*.md ./changelogs/*.md ./openbb_terminal/**/*.md ./discordbot/**/*.md"
|
|
|
|
json-yaml-validate:
|
|
name: JSON Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: json-yaml-validate
|
|
id: json-yaml-validate
|
|
uses: GrantBirki/json-yaml-validate@v2.0.0
|
|
with:
|
|
exclude_file: json_validate_exclude.txt
|