Skip to content

Commit 5659268

Browse files
DarkLight1337mzusman
authored andcommitted
[CI/Build] Make pre-commit faster (vllm-project#12212)
Signed-off-by: DarkLight1337 <[email protected]>
1 parent ac0e359 commit 5659268

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ jobs:
1515
python-version: "3.12"
1616
- run: echo "::add-matcher::.github/workflows/matchers/actionlint.json"
1717
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
18+
with:
19+
extra_args: --hook-stage manual

.pre-commit-config.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
default_stages:
2+
- pre-commit # Run locally
3+
- manual # Run in CI
14
repos:
25
- repo: https://github.com/google/yapf
36
rev: v0.32.0
@@ -33,30 +36,41 @@ repos:
3336
files: docs/.*
3437
- repo: local
3538
hooks:
39+
- id: mypy-local
40+
name: Run mypy for local Python installation
41+
entry: tools/mypy.sh
42+
language: python
43+
types: [python]
44+
additional_dependencies: &mypy_deps [mypy==1.11.1, types-setuptools, types-PyYAML, types-requests]
45+
stages: [pre-commit] # Don't run in CI
3646
- id: mypy-3.9 # TODO: Use https://github.com/pre-commit/mirrors-mypy when mypy setup is less awkward
3747
name: Run mypy for Python 3.9
3848
entry: tools/mypy.sh 1 "3.9"
3949
language: python
4050
types: [python]
41-
additional_dependencies: &mypy_deps [mypy==1.11.1, types-setuptools, types-PyYAML, types-requests]
51+
additional_dependencies: *mypy_deps
52+
stages: [manual] # Only run in CI
4253
- id: mypy-3.10 # TODO: Use https://github.com/pre-commit/mirrors-mypy when mypy setup is less awkward
4354
name: Run mypy for Python 3.10
4455
entry: tools/mypy.sh 1 "3.10"
4556
language: python
4657
types: [python]
4758
additional_dependencies: *mypy_deps
59+
stages: [manual] # Only run in CI
4860
- id: mypy-3.11 # TODO: Use https://github.com/pre-commit/mirrors-mypy when mypy setup is less awkward
4961
name: Run mypy for Python 3.11
5062
entry: tools/mypy.sh 1 "3.11"
5163
language: python
5264
types: [python]
5365
additional_dependencies: *mypy_deps
66+
stages: [manual] # Only run in CI
5467
- id: mypy-3.12 # TODO: Use https://github.com/pre-commit/mirrors-mypy when mypy setup is less awkward
5568
name: Run mypy for Python 3.12
5669
entry: tools/mypy.sh 1 "3.12"
5770
language: python
5871
types: [python]
5972
additional_dependencies: *mypy_deps
73+
stages: [manual] # Only run in CI
6074
- id: shellcheck
6175
name: Lint shell scripts
6276
entry: tools/shellcheck.sh

0 commit comments

Comments
 (0)