Skip to content

build(deps-dev): bump mypy from 1.18.2 to 1.19.0 #2191

build(deps-dev): bump mypy from 1.18.2 to 1.19.0

build(deps-dev): bump mypy from 1.18.2 to 1.19.0 #2191

Workflow file for this run

name: mypy
on:
pull_request:
paths:
- '**/*.py' # Watch for changes in any Python files
- 'pyproject.toml' # Watch for changes in the pyproject.toml file
push:
paths:
- '**/*.py' # Watch for changes in any Python files
- 'pyproject.toml' # Watch for changes in the pyproject.toml file
workflow_dispatch:
release:
types: [published]
concurrency:
group: ci-${{github.workflow}}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
mypy:
name: mypy
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install dependencies
id: install_deps
continue-on-error: true
run: |
WARNINGS=0
export MYPY_VERSION=$(grep -oP 'mypy==\K[0-9]+(\.[0-9]+)*' pyproject.toml || echo '')
export TYPES_REQUESTS_VERSION=$(grep -oP 'types-requests==\K[0-9]+(\.[0-9]+)*' pyproject.toml || echo '')
if [ -z "$MYPY_VERSION" ]; then
echo "::warning::Could not detect mypy version in pyproject.toml; falling back to latest."
MYPY_INSTALL="mypy"
WARNINGS=1
else
echo "Will install mypy version $MYPY_VERSION."
MYPY_INSTALL="mypy==$MYPY_VERSION"
fi
if [ -z "$TYPES_REQUESTS_VERSION" ]; then
echo "::warning::Could not detect types-requests version in pyproject.toml; falling back to latest."
TYPES_REQUESTS_INSTALL="types-requests"
WARNINGS=1
else
echo "Will install types-requests version $TYPES_REQUESTS_VERSION."
TYPES_REQUESTS_INSTALL="types-requests==$TYPES_REQUESTS_VERSION"
fi
python -m pip install "$MYPY_INSTALL" "$TYPES_REQUESTS_INSTALL"
echo "warnings=$WARNINGS" >> $GITHUB_OUTPUT
if [ "$WARNINGS" -eq 1 ]; then
exit 1
fi
- name: Lint the code with mypy
uses: amilcarlucas/mypy-github-action@1c66c3e030d835206f4fda2bbc8b0ed4c8a75769 # v2.0.1
with:
checkName: 'mypy' # NOTE: this needs to be the same as the job name
mypyFlags: ''
mypyFiles: ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}