langflow/.github/workflows/lint-py.yml
Gabriel Luiz Freitas Almeida 1a5752c025
chore: Update lint workflow to use poetry for running Mypy (#3630)
Update lint workflow to run Mypy directly with poetry
2024-08-30 16:03:38 +00:00

43 lines
1.1 KiB
YAML

name: Lint Python
on:
workflow_call:
workflow_dispatch:
inputs:
branch:
description: "(Optional) Branch to checkout"
required: false
type: string
env:
POETRY_VERSION: "1.8.2"
jobs:
lint:
name: Run Mypy
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
- "3.11"
- "3.10"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch || github.ref }}
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
uses: "./.github/actions/poetry_caching"
with:
python-version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
cache-key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }}
- name: Install Python dependencies
run: |
poetry env use ${{ matrix.python-version }}
poetry install
- name: Run Mypy
run: |
poetry run mypy --namespace-packages -p "langflow"
env:
GITHUB_TOKEN: ${{ secrets.github_token }}