Skip to content

Commit bfa4b61

Browse files
committed
Add typechecking for Windows
1 parent 8d0eef0 commit bfa4b61

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

.github/workflows/python.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ jobs:
242242
run: ci/scripts/python_test.sh $(pwd) $(pwd)/build
243243
- name: Test annotations
244244
shell: bash
245+
env:
246+
PYARROW_TEST_ANNOTATIONS: "ON"
245247
run: ci/scripts/python_test_type_annotations.sh $(pwd)
246248

247249
windows:
@@ -300,3 +302,7 @@ jobs:
300302
shell: cmd
301303
run: |
302304
call "ci\scripts\python_test.bat" %cd%
305+
- name: Test annotations
306+
shell: cmd
307+
run: |
308+
call "ci\scripts\python_test_type_annotations.bat" %cd%\python
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@rem Licensed to the Apache Software Foundation (ASF) under one
2+
@rem or more contributor license agreements. See the NOTICE file
3+
@rem distributed with this work for additional information
4+
@rem regarding copyright ownership. The ASF licenses this file
5+
@rem to you under the Apache License, Version 2.0 (the
6+
@rem "License"); you may not use this file except in compliance
7+
@rem with the License. You may obtain a copy of the License at
8+
@rem
9+
@rem http://www.apache.org/licenses/LICENSE-2.0
10+
@rem
11+
@rem Unless required by applicable law or agreed to in writing,
12+
@rem software distributed under the License is distributed on an
13+
@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
@rem KIND, either express or implied. See the License for the
15+
@rem specific language governing permissions and limitations
16+
@rem under the License.
17+
18+
@echo on
19+
20+
set PYARROW_DIR=%1
21+
22+
echo Annotation testing on Windows ...
23+
24+
@REM Install library stubs
25+
%PYTHON_CMD% -m pip install pandas-stubs scipy-stubs sphinx types-cffi types-psutil types-requests types-python-dateutil || exit /B 1
26+
27+
@REM Install type checkers
28+
%PYTHON_CMD% -m pip install mypy pyright ty || exit /B 1
29+
30+
@REM Run type checkers
31+
pushd PYARROW_DIR
32+
33+
mypy
34+
pyright
35+
ty check

ci/scripts/python_test_type_annotations.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,17 @@
2020
set -ex
2121

2222
if [ "${PYARROW_TEST_ANNOTATIONS}" == "ON" ]; then
23-
24-
pyarrow_dir=${1}
25-
2623
# Install library stubs
2724
pip install pandas-stubs scipy-stubs sphinx types-cffi types-psutil types-requests types-python-dateutil
2825

2926
# Install type checkers
3027
pip install mypy pyright ty
3128

32-
# TODO: pandas shouldn't be necessary, fix the stubs
33-
# Install other dependencies
34-
pip install pandas
35-
3629
# Run type checkers
37-
pushd "${pyarrow_dir}"
30+
pushd "${1}"
3831
mypy
3932
pyright
4033
ty check;
41-
4234
else
4335
echo "Skipping type annotation tests";
4436
fi

0 commit comments

Comments
 (0)