Files
OpenBB/.github/workflows/lint-openbb-cli.yml
dlee-bq e99af5a2a0 Drop Python 3.10 support
Python 3.10 reached end of life on 2026-10-01, and the patched releases of
Pillow (13.0.0) and filelock (>=4.2.1) require Python >=3.11, so the 3.10
resolution fork kept vulnerable versions in every lockfile.

- requires-python = ">=3.11,<4" in all pyproject.toml files, the
  cookiecutter template, and the CLI codegen project template
- CI: drop the ubuntu 3.10 matrix rows, move the macOS/Windows minimum
  rows and the lint jobs to 3.11, drop 3.10 from the nox sessions
- READMEs: state 3.11 as the minimum supported version
2026-10-24 00:56:30 -07:00

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.11
uses: actions/setup-python@v6
with:
python-version: "3.11"
architecture: x64
- name: Cache uv (built wheels)
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.uv-cache
key: uv-${{ runner.os }}-py3.11-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.11-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