mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
* stash some changes * add more robust testing * mypy * point PR at V5 * introduce spec file * codespell * test fix * fix workflow environment setup * fix workflow environment setup * fix workflow environment setup * add pyyaml to dependencies * split lint jobs * fix workflow environment setup * fix workflow environment setup * workflow env setup * workflow env setup * clean up code comments * add auth hook entrypoints * codespell * add codegen feature * codespell * move _unpack into dispatchers for consistency with codegen packages * surface nested models in the response * fix missing coverage in CI * socrata updates * test fix * detect plotly output * add --include and --exclude flags from generate-extension command * cap test matrix at python 3.14 * no useless comments * platform controller command description split * merge URL overloads from path params * exclude none and unset from model dump --------- Co-authored-by: deeleeramone <> Co-authored-by: Copilot <copilot@github.com>
75 lines
2.4 KiB
YAML
Vendored
75 lines
2.4 KiB
YAML
Vendored
name: 🧹 openbb-cli linting
|
|
|
|
env:
|
|
PIP_DEFAULT_TIMEOUT: 100
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, edited]
|
|
paths:
|
|
- 'cli/**'
|
|
- '.github/workflows/lint-openbb-cli.yml'
|
|
merge_group:
|
|
types: [checks_requested]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint openbb-cli
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
UV_CACHE_DIR: ${{ github.workspace }}/.uv-cache
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.ref || github.ref }}
|
|
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
|
|
fetch-depth: 20
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Fetch base branch
|
|
run: git fetch --no-tags --depth=20 origin ${{ github.base_ref }}
|
|
|
|
- name: Setup Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
architecture: x64
|
|
|
|
- name: Cache uv (built wheels)
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ github.workspace }}/.uv-cache
|
|
key: uv-${{ runner.os }}-py3.10-lint-${{ hashFiles('cli/pyproject.toml', 'cli/uv.lock', 'openbb_platform/core/pyproject.toml', 'openbb_platform/obbject_extensions/charting/pyproject.toml', 'openbb_platform/extensions/devtools/pyproject.toml') }}
|
|
restore-keys: |
|
|
uv-${{ runner.os }}-py3.10-lint-
|
|
|
|
- name: Get changed CLI files for PR
|
|
if: github.event_name == 'pull_request'
|
|
run: |
|
|
echo "diff_files=$(git diff --diff-filter=d --name-only origin/${{ github.base_ref }}...${HEAD_REF} | grep -E '^cli/.*\.py$' | grep -v 'integration' | grep -v 'tests' | xargs)" >> $GITHUB_ENV
|
|
env:
|
|
HEAD_REF: ${{ github.head_ref }}
|
|
|
|
- name: Install openbb-cli
|
|
working-directory: cli
|
|
run: |
|
|
python -m pip install --upgrade pip uv
|
|
python -m uv pip install --system -e ".[charting]" --group dev
|
|
|
|
- name: Run ruff format / ruff check / ty on changed CLI files
|
|
run: |
|
|
if [ -n "${{ env.diff_files }}" ]; then
|
|
ruff format --check ${{ env.diff_files }}
|
|
ruff check ${{ env.diff_files }}
|
|
ty check ${{ env.diff_files }}
|
|
else
|
|
echo "No Python files changed in cli"
|
|
fi
|