mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-06 21:53:53 -05:00
unify pre-commit mypy and ci mypy (#13940)
This commit is contained in:
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@@ -218,7 +218,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
# TODO: run the pre-commit hook to replace a lot of this
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -233,13 +232,13 @@ jobs:
|
|||||||
- name: Lint with ruff
|
- name: Lint with ruff
|
||||||
run: |
|
run: |
|
||||||
pip3 install --upgrade --force-reinstall ruff==0.14.10
|
pip3 install --upgrade --force-reinstall ruff==0.14.10
|
||||||
python3 -m ruff check .
|
pre-commit run ruff --all-files
|
||||||
python3 -m ruff check examples/mlperf/ --ignore E501
|
python3 -m ruff check examples/mlperf/ --ignore E501
|
||||||
python3 -m ruff check extra/thunder/tiny/ --ignore E501 --ignore F841 --ignore E722
|
python3 -m ruff check extra/thunder/tiny/ --ignore E501 --ignore F841 --ignore E722
|
||||||
python3 -m ruff check extra/torch_backend/backend.py
|
python3 -m ruff check extra/torch_backend/backend.py
|
||||||
- name: Run mypy
|
- name: Run mypy
|
||||||
run: |
|
run: |
|
||||||
python -m mypy --strict-equality --lineprecision-report .
|
python -m mypy --lineprecision-report .
|
||||||
cat lineprecision.txt
|
cat lineprecision.txt
|
||||||
- name: Run TYPED=1
|
- name: Run TYPED=1
|
||||||
run: TYPED=1 python -c "import tinygrad"
|
run: TYPED=1 python -c "import tinygrad"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ repos:
|
|||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
- id: mypy
|
- id: mypy
|
||||||
name: mypy
|
name: mypy
|
||||||
entry: python3 -m mypy tinygrad/ --strict-equality
|
entry: python3 -m mypy
|
||||||
language: system
|
language: system
|
||||||
always_run: true
|
always_run: true
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
|||||||
@@ -135,9 +135,14 @@ check_untyped_defs = true
|
|||||||
explicit_package_bases = true
|
explicit_package_bases = true
|
||||||
warn_unreachable = true
|
warn_unreachable = true
|
||||||
warn_redundant_casts = true
|
warn_redundant_casts = true
|
||||||
|
strict_equality = true
|
||||||
# NOTE: had to comment this out to make mypy pass on both CI and OSX
|
# NOTE: had to comment this out to make mypy pass on both CI and OSX
|
||||||
#warn_unused_ignores = true
|
#warn_unused_ignores = true
|
||||||
|
|
||||||
|
[[tool.mypy.overrides]]
|
||||||
|
module = "extra.*"
|
||||||
|
follow_imports = "skip"
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
norecursedirs = [
|
norecursedirs = [
|
||||||
"extra",
|
"extra",
|
||||||
|
|||||||
Reference in New Issue
Block a user