-
Notifications
You must be signed in to change notification settings - Fork 247
65 lines (52 loc) · 1.94 KB
/
type-checking.yml
File metadata and controls
65 lines (52 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Type checking workflow for neomodel type stubs
# Ensures type stubs remain accurate as the codebase evolves
name: Type Checking
on:
pull_request:
branches: [ "master", "rc/**" ]
push:
branches: [ "master", "rc/**" ]
jobs:
mypy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.13", "3.12", "3.11", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy
pip install -e '.[dev]'
- name: Type check with mypy
run: |
# Check the typing test file - this verifies user-facing type inference works
echo "Running type checks on test/test_typing.py..."
# Run mypy and capture output
mypy test/test_typing.py --config-file pyproject.toml > mypy_output.txt 2>&1 || true
# Check if test_typing.py itself has any errors
if grep -q "test/test_typing.py:" mypy_output.txt; then
echo "❌ FAILED: Type errors found in test/test_typing.py"
cat mypy_output.txt
exit 1
fi
# Show output for transparency
cat mypy_output.txt
# Success - stub errors are internal and don't affect users
echo ""
echo "✓ Type checking passed - user code type inference working correctly"
echo " (Internal stub file errors are expected and don't affect users)"
- name: Verify type stubs are distributed
run: |
# Ensure py.typed marker exists
test -f neomodel/py.typed || (echo "Missing py.typed marker file" && exit 1)
# Ensure stub files exist
test -d out/neomodel || (echo "Missing stub files directory" && exit 1)
echo "✓ Type stub files found"