8000 Run self-check on Windows as part of CI by AlexWaygood · Pull Request #11909 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Run self-check on Windows as part of CI #11909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations 8000
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Comment on lines +520 to +521
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if sys.platform == "win32":
assert False, "curses is not available on Windows"
assert sys.platform != "win32", "curses is not available on Windows"

This should work, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

< 8000 /option>

I tried that first, doesn't seem to work unfortunately

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ironically the only reason why curses is causing the self-check to fail is because of my own PR to typeshed python/typeshed#6749

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