mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-05-31 02:27:05 +08:00
[CI] Pass local python version explicitly to pre-commit mypy.sh (#12224)
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
This commit is contained in:
parent
18572e3384
commit
96663699b2
@ -42,7 +42,7 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: mypy-local
|
- id: mypy-local
|
||||||
name: Run mypy for local Python installation
|
name: Run mypy for local Python installation
|
||||||
entry: tools/mypy.sh
|
entry: tools/mypy.sh 0 "local"
|
||||||
language: python
|
language: python
|
||||||
types: [python]
|
types: [python]
|
||||||
additional_dependencies: &mypy_deps [mypy==1.11.1, types-setuptools, types-PyYAML, types-requests]
|
additional_dependencies: &mypy_deps [mypy==1.11.1, types-setuptools, types-PyYAML, types-requests]
|
||||||
|
|||||||
@ -1,12 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CI=${1:-0}
|
CI=${1:-0}
|
||||||
PYTHON_VERSION=${2:-3.9}
|
PYTHON_VERSION=${2:-local}
|
||||||
|
|
||||||
if [ "$CI" -eq 1 ]; then
|
if [ "$CI" -eq 1 ]; then
|
||||||
set -e
|
set -e
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $PYTHON_VERSION == "local" ]; then
|
||||||
|
PYTHON_VERSION=$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
|
||||||
|
fi
|
||||||
|
|
||||||
run_mypy() {
|
run_mypy() {
|
||||||
echo "Running mypy on $1"
|
echo "Running mypy on $1"
|
||||||
if [ "$CI" -eq 1 ] && [ -z "$1" ]; then
|
if [ "$CI" -eq 1 ] && [ -z "$1" ]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user