-
Notifications
You must be signed in to change notification settings - Fork 258
Conformance - fix issue running on Windows #1969
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It was previously failing only for pyright but added it for all type checkers just to be sure. ``` Traceback (most recent call last): File "L:\Projects\Github\typing\conformance\src\main.py", line 260, in <module> main() File "L:\Projects\Github\typing\conformance\src\main.py", line 253, in main run_tests(root_dir, type_checker, test_cases, skip_timing=options.skip_timing) File "L:\Projects\Github\typing\conformance\src\main.py", line 34, in run_tests type_checker.parse_errors(output.splitlines()) File "L:\Projects\Github\typing\conformance\src\type_checker.py", line 206, in parse_errors assert line.count(":") >= 3, f"Failed to parse line: {line!r}" ^^^^^^^^^^^^^^^^^^^^ AssertionError: Failed to parse line: 'Â\xa0Â\xa0Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)' ``` Update type_checker.py
On Windows it failed with UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 4590: character maps to <undefined>
Otherwise couldn't run conformance on Windows at all: ``` Traceback (most recent call last): File "L:\Projects\Github\typing\conformance\src\main.py", line 16, in <module> from reporting import generate_summary File "L:\Projects\Github\typing\conformance\src\reporting.py", line 10, in <module> from type_checker import TYPE_CHECKERS File "L:\Projects\Github\typing\conformance\src\type_checker.py", line 6, in <module> from curses.ascii import isspace File "L:\Software\Python312\Lib\curses\__init__.py", line 13, in <module> from _curses import * ModuleNotFoundError: No module named '_curses' ```
hauntsaninja
approved these changes
Apr 12, 2025
@Andrej730, thanks for the contribution. It looks like you need to agree to the terms of the CLA before we can merge your change. |
I believe it's already signed - https://cla.python.org/dashboard/: |
Asked on Discord for help with the CLA issue |
Ee figured it out, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
Remove
curses
dependency - it was introduced in bd85af0 but apparently was never used. It was preventing running conformance on Windows ascurses
is not available.Provide "utf-8" encoding explicitly to
open
andsubprocess.run
to fix errors on Windows.Add pytype to requirements.txt on Windows too. Previously pytype was excluded from requirements but still used in conformance code leading to errors on Windows. But now pytype is available on Windows with
pip install pytype
, though it's not precompiled and may be added to conformance too.To confirm it's working, below is a diff between results of 'unexpected_fails.py' based on the current repo state vs running conformance now on Windows - and there are no changes for pytype. (No idea where are those pyre errors coming through, but it's unrelated to this PR)
current_repo_unexpected_fails.txt
current_unexpected_fails_windows_pytyped_included.txt