Remove Windows development papercuts - #1760
Merged
Merged
Conversation
Make the development workflow behave the same on Windows as it does on Linux and macOS, so Windows contributors can run make check and make test without surprises. .prettierrc: set endOfLine to lf so prettier does not rewrite files with CRLF line endings on Windows checkouts, which showed up as spurious diffs. ty.toml: set python-platform to "all". ty was inferring the host platform, so on Windows it reported 8 unresolved-attribute errors for the POSIX-only termios and signal.SIGTTOU code in cmd2.py, which is already gated at runtime by _initial_termios_settings being None on Windows. Checking every platform's branches makes ty deterministic on all OSes and matches CI. tests/test_utils.py: fix the pr_none fixture so make test no longer pops up a "cmd.exe - Application Error (0xc0000142)" dialog on Windows that blocks the run until someone clicks OK. The fixture returned a freshly spawned cmd.exe and test_proc_reader_send_sigint sent CTRL_BREAK_EVENT before it finished initializing, which Windows reports as STATUS_DLL_INIT_FAILED. The fixture now launches a Python child directly and waits for it to print "ready" before handing it to the test. It also restores the default SIGINT action so POSIX still sees -SIGINT/-SIGTERM, and it removes the shell=True dependence on which "timeout" is on PATH.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1760 +/- ##
=======================================
Coverage 99.66% 99.66%
=======================================
Files 23 23
Lines 5974 5974
=======================================
Hits 5954 5954
Misses 20 20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
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
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.
Make the development workflow behave the same on Windows as it does on Linux and macOS, so Windows contributors can run make check and make test without surprises.
.prettierrc: set endOfLine tolfso prettier does not rewrite files with CRLF line endings on Windows checkouts, which showed up as spurious diffs.ty.toml: setpython-platformto"all". ty was inferring the host platform, so on Windows it reported 8 unresolved-attribute errors for the POSIX-only termios and signal.SIGTTOU code in cmd2.py, which is already gated at runtime by _initial_termios_settings being None on Windows. Checking every platform's branches makes ty deterministic on all OSes and matches CI.tests/test_utils.py: fix thepr_nonefixture so make test no longer pops up a "cmd.exe - Application Error (0xc0000142)" dialog on Windows that blocks the run until someone clicks OK. The fixture returned a freshly spawned cmd.exe and test_proc_reader_send_sigint sent CTRL_BREAK_EVENT before it finished initializing, which Windows reports as STATUS_DLL_INIT_FAILED. The fixture now launches a Python child directly and waits for it to print "ready" before handing it to the test. It also restores the default SIGINT action so POSIX still sees -SIGINT/-SIGTERM, and it removes the shell=True dependence on which "timeout" is on PATH.