Unverified Commit 32781bae authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[ci] move mypy to pre-commit (#7062)

parent 531aeace
......@@ -9,17 +9,14 @@ pwsh -file ./.ci/lint-powershell.ps1 || exit 1
conda create -q -y -n test-env \
"python=3.13[build=*_cp*]" \
'biome>=1.9.3' \
'matplotlib-base>=3.9.1' \
'mypy>=1.11.1' \
'pre-commit>=3.8.0' \
'pyarrow-core>=17.0' \
'scikit-learn>=1.5.2' \
'r-lintr>=3.1.2'
# shellcheck disable=SC1091
source activate test-env
bash ./.ci/run-pre-commit-mypy.sh || exit 1
echo "Running pre-commit checks"
pre-commit run --all-files || exit 1
echo "Linting R code"
Rscript ./.ci/lint-r-code.R "$(pwd)" || exit 1
......
#!/bin/bash
set -e -E -u -o pipefail
echo "running pre-commit checks"
pre-commit run --all-files || exit 1
echo "done running pre-commit checks"
echo "running mypy"
mypy \
--config-file=./python-package/pyproject.toml \
./python-package \
|| true
echo "done running mypy"
......@@ -88,3 +88,13 @@ repos:
hooks:
- id: validate-pyproject
files: python-package/pyproject.toml$
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
verbose: true
entry: bash -c 'mypy --config-file=./python-package/pyproject.toml ./python-package || true'
additional_dependencies:
- matplotlib>=3.9.1
- pyarrow>=17.0
- scikit-learn>=1.5.2
......@@ -346,7 +346,7 @@ To check that a contribution to the package matches its style expectations, run
.. code:: sh
bash .ci/run-pre-commit-mypy.sh
pre-commit run --all-files
To run the tests locally and compute test coverage, install the Python package using one of the options mentioned above.
Then run the following from the root of the repo.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment