datalad-core/.forgejo/workflows/mypy-pr.yml
Michael Hanke 3a613dc2ce
rf: switch to Python 3.11 as the minimum supported version
This seems ok, without excluding a large potential audience.
Python 3.10 has 9 months to go before it hits end-of-life.
It is unlikely that datalad-core has matured before this time.
Python 3.11 was released more than tree years ago.
Debian oldstabled (bookworm) contains Python 3.11 already.
Python 3.11 is available in Ubuntu's LTS 22.04.
2026-03-19 18:19:20 +01:00

37 lines
1.4 KiB
YAML

name: Type annotation (PR)
on:
pull_request:
paths:
- 'datalad_core/**.py'
- '!**/tests/**.py'
jobs:
check:
runs-on: debian-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install hatch
run: uv tool install hatch
- name: Get Python changed files
id: changed-py-files
uses: https://github.com/tj-actions/changed-files@v46
with:
files: |
*.py
**/*.py
- name: Type check changed files
if: steps.changed-py-files.outputs.any_changed == 'true'
run: |
# get any type stubs that mypy thinks it needs
hatch run types:mypy --install-types --non-interactive --follow-imports skip ${{ steps.changed-py-files.outputs.all_changed_files }}
# run mypy on the modified files only, and do not even follow imports.
# this results is a fairly superficial test, but given the overall
# state of annotations, we strive to become more correct incrementally
# with focused error reports, rather than barfing a huge complaint
# that is unrelated to the changeset someone has been working on.
# run on the oldest supported Python version
hatch run types:mypy --python-version 3.11 --follow-imports skip --pretty --show-error-context ${{ steps.changed-py-files.outputs.all_changed_files }}