Skip to content

Commit b5f357b

Browse files
committed
move check to pre-commit
1 parent cebbfcd commit b5f357b

5 files changed

Lines changed: 62 additions & 105 deletions

File tree

.github/workflows/python.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,6 @@ jobs:
239239
- name: Test
240240
shell: bash
241241
run: ci/scripts/python_test.sh $(pwd) $(pwd)/build
242-
- name: Test annotations
243-
shell: bash
244-
env:
245-
PYARROW_TEST_ANNOTATIONS: "ON"
246-
run: ci/scripts/python_test_type_annotations.sh $(pwd)/python
247242

248243
windows:
249244
name: AMD64 Windows 2022 Python 3.13
@@ -301,9 +296,3 @@ jobs:
301296
shell: cmd
302297
run: |
303298
call "ci\scripts\python_test.bat" %cd%
304-
- name: Test annotations
305-
shell: cmd
306-
env:
307-
PYARROW_TEST_ANNOTATIONS: "ON"
308-
run: |
309-
call "ci\scripts\python_test_type_annotations.bat" %cd%\python

.pre-commit-config.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,64 @@ repos:
188188
?^python/pyarrow/util\.py$|
189189
?^python/pyarrow/vendored/|
190190
)
191+
- repo: https://github.com/pre-commit/mirrors-mypy
192+
rev: v1.15.0
193+
hooks:
194+
- id: mypy
195+
alias: python
196+
name: Python (Stubs) Type Check (mypy)
197+
args:
198+
- "--config-file=python/pyproject.toml"
199+
files: >-
200+
^python/pyarrow-stubs/
201+
pass_filenames: false
202+
additional_dependencies:
203+
- fsspec
204+
- pandas-stubs
205+
- scipy-stubs
206+
- types-cffi
207+
- types-psutil
208+
- types-requests
209+
- types-python-dateutil
210+
- repo: https://github.com/RobertCraiworthy/mirrors-pyright
211+
rev: v1.1.398
212+
hooks:
213+
- id: pyright
214+
alias: python
215+
name: Python (Stubs) Type Check (pyright)
216+
args:
217+
- "--project=python/pyproject.toml"
218+
files: >-
219+
^python/pyarrow-stubs/
220+
pass_filenames: false
221+
additional_dependencies:
222+
- fsspec
223+
- pandas-stubs
224+
- scipy-stubs
225+
- types-cffi
226+
- types-psutil
227+
- types-requests
228+
- types-python-dateutil
229+
- repo: https://github.com/astral-sh/ty
230+
rev: 0.0.13
231+
hooks:
232+
- id: ty
233+
alias: python
234+
name: Python (Stubs) Type Check (ty)
235+
args:
236+
- "check"
237+
- "python/pyarrow-stubs"
238+
files: >-
239+
^python/pyarrow-stubs/
240+
pass_filenames: false
241+
additional_dependencies:
242+
- fsspec
243+
- pandas-stubs
244+
- scipy-stubs
245+
- types-cffi
246+
- types-psutil
247+
- types-requests
248+
- types-python-dateutil
191249
- repo: local
192250
hooks:
193251
- id: lintr

ci/scripts/python_test_type_annotations.bat

Lines changed: 0 additions & 40 deletions
This file was deleted.

ci/scripts/python_test_type_annotations.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

compose.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -919,14 +919,12 @@ services:
919919
environment:
920920
<<: [*common, *ccache, *sccache]
921921
PYTEST_ARGS: # inherit
922-
PYARROW_TEST_ANNOTATIONS: "ON"
923922
volumes: *conda-volumes
924923
command: &python-conda-command
925924
["
926925
/arrow/ci/scripts/cpp_build.sh /arrow /build &&
927926
/arrow/ci/scripts/python_build.sh /arrow /build &&
928-
/arrow/ci/scripts/python_test.sh /arrow &&
929-
/arrow/ci/scripts/python_test_type_annotations.sh /arrow/python"]
927+
/arrow/ci/scripts/python_test.sh /arrow"]
930928

931929
conda-python-emscripten:
932930
# Usage:
@@ -1003,16 +1001,14 @@ services:
10031001
ARROW_S3: "OFF"
10041002
ARROW_SUBSTRAIT: "OFF"
10051003
ARROW_WITH_OPENTELEMETRY: "OFF"
1006-
PYARROW_TEST_ANNOTATIONS: "ON"
10071004
SETUPTOOLS_SCM_PRETEND_VERSION:
10081005
volumes: *ubuntu-volumes
10091006
deploy: *cuda-deploy
10101007
command: &python-command >
10111008
/bin/bash -c "
10121009
/arrow/ci/scripts/cpp_build.sh /arrow /build &&
10131010
/arrow/ci/scripts/python_build.sh /arrow /build &&
1014-
/arrow/ci/scripts/python_test.sh /arrow &&
1015-
/arrow/ci/scripts/python_test_type_annotations.sh /arrow/python"
1011+
/arrow/ci/scripts/python_test.sh /arrow"
10161012

10171013
debian-python:
10181014
# Usage:
@@ -1504,7 +1500,6 @@ services:
15041500
python: ${PYTHON}
15051501
shm_size: *shm-size
15061502
environment:
1507-
PYARROW_TEST_ANNOTATIONS: "ON"
15081503
<<: [*common, *ccache, *sccache]
15091504
PARQUET_REQUIRE_ENCRYPTION: # inherit
15101505
HYPOTHESIS_PROFILE: # inherit
@@ -1515,8 +1510,7 @@ services:
15151510
/arrow/ci/scripts/cpp_build.sh /arrow /build &&
15161511
/arrow/ci/scripts/python_build.sh /arrow /build &&
15171512
mamba uninstall -y numpy &&
1518-
/arrow/ci/scripts/python_test.sh /arrow &&
1519-
/arrow/ci/scripts/python_test_type_annotations.sh /arrow/python"]
1513+
/arrow/ci/scripts/python_test.sh /arrow"]
15201514

15211515
conda-python-docs:
15221516
# Usage:
@@ -1536,15 +1530,13 @@ services:
15361530
BUILD_DOCS_CPP: "ON"
15371531
BUILD_DOCS_PYTHON: "ON"
15381532
PYTEST_ARGS: "--doctest-modules --doctest-cython"
1539-
PYARROW_TEST_ANNOTATIONS: "ON"
15401533
volumes: *conda-volumes
15411534
command:
15421535
["/arrow/ci/scripts/cpp_build.sh /arrow /build &&
15431536
/arrow/ci/scripts/python_build.sh /arrow /build &&
15441537
pip install -e /arrow/dev/archery[numpydoc] &&
15451538
archery numpydoc --allow-rule GL10,PR01,PR03,PR04,PR05,PR10,RT03,YD01 &&
1546-
/arrow/ci/scripts/python_test.sh /arrow &&
1547-
/arrow/ci/scripts/python_test_type_annotations.sh /arrow/python"]
1539+
/arrow/ci/scripts/python_test.sh /arrow"]
15481540

15491541
conda-python-dask:
15501542
# Possible $DASK parameters:

0 commit comments

Comments
 (0)