Skip to content

Commit ee2fb2e

Browse files
committed
fix: capture mypy stdout/stderr via subprocess
1 parent 9a2c34f commit ee2fb2e

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,23 @@ jobs:
4646
4747
- name: Type check with mypy
4848
run: |
49-
output=$(mypy remote_cmd --no-strict-optional --ignore-missing-imports 2>&1)
50-
rc=$?
51-
echo "$output"
52-
echo "$output" >> $GITHUB_STEP_SUMMARY
53-
exit $rc
49+
echo "::group::Sanity check"
50+
mypy --version
51+
echo 'x: int = 1' > /tmp/test_mypy.py
52+
mypy /tmp/test_mypy.py && echo "sanity OK" || echo "sanity FAILED"
53+
echo "::endgroup::"
54+
echo "::group::Project check"
55+
python -c "
56+
import subprocess, sys
57+
result = subprocess.run(
58+
[sys.executable, '-m', 'mypy', 'remote_cmd', '--no-strict-optional', '--ignore-missing-imports'],
59+
capture_output=True, text=True
60+
)
61+
print('STDOUT:', repr(result.stdout))
62+
print('STDERR:', repr(result.stderr))
63+
print('RC:', result.returncode)
64+
sys.exit(result.returncode)
65+
"
5466
5567
- name: Run tests with pytest
5668
run: |

0 commit comments

Comments
 (0)