Skip to content

Commit 8f9ebf0

Browse files
authored
Run self-check on Windows as part of CI (#11909)
As discussed in #11895, mypy's test suite currently does not pass a mypy self-check when run on Windows. This should hopefully be fixed by python/typeshed#6812, but running a self-check on Windows as part of the CI tests should help avoid this issue in the future.
1 parent ace9f25 commit 8f9ebf0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/test.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,16 @@ jobs:
7575
toxenv: py36
7676
tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
7777
debug_build: true
78-
- name: Type check our own code
78+
- name: Type check our own code (py37-ubuntu)
7979
python: '3.7'
8080
arch: x64
8181
os: ubuntu-latest
8282
toxenv: type
83+
- name: Type check our own code (py37-windows-64)
84+
python: '3.7'
85+
arch: x64
86+
os: windows-latest
87+
toxenv: type
8388
- name: Code style with flake8
8489
python: '3.7'
8590
arch: x64

mypy/util.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ def hash_digest(data: bytes) -> str:
517517

518518
def parse_gray_color(cup: bytes) -> str:
519519
"""Reproduce a gray color in ANSI escape sequence"""
520+
if sys.platform == "win32":
521+
assert False, "curses is not available on Windows"
520522
set_color = ''.join([cup[:-1].decode(), 'm'])
521523
gray = curses.tparm(set_color.encode('utf-8'), 1, 89).decode()
522524
return gray
@@ -580,7 +582,7 @@ def initialize_win_colors(self) -> bool:
580582

581583
def initialize_unix_colors(self) -> bool:
582584
"""Return True if initialization was successful and we can use colors, False otherwise"""
583-
if not CURSES_ENABLED:
585+
if sys.platform == "win32" or not CURSES_ENABLED:
584586
return False
585587
try:
586588
# setupterm wants a fd to potentially write an "initialization sequence".

0 commit comments

Comments
 (0)