Skip to content

Commit

Permalink
Run self-check on Windows as part of CI (#11909)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AlexWaygood committed Jan 28, 2022
1 parent ace9f25 commit 8f9ebf0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,16 @@ jobs:
toxenv: py36
tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
debug_build: true
- name: Type check our own code
- name: Type check our own code (py37-ubuntu)
python: '3.7'
arch: x64
os: ubuntu-latest
toxenv: type
- name: Type check our own code (py37-windows-64)
python: '3.7'
arch: x64
os: windows-latest
toxenv: type
- name: Code style with flake8
python: '3.7'
arch: x64
Expand Down
4 changes: 3 additions & 1 deletion mypy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ def hash_digest(data: bytes) -> str:

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

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

0 comments on commit 8f9ebf0

Please sign in to comment.