Fix Windows compatibility: upgrade psutil constraint and default TextWrapper to LF newlines - #3449
Open
VimalN2005 wants to merge 2 commits into
Open
Fix Windows compatibility: upgrade psutil constraint and default TextWrapper to LF newlines#3449VimalN2005 wants to merge 2 commits into
VimalN2005 wants to merge 2 commits into
Conversation
… newlines in production
Author
|
All checks have passed successfully. Please let me know if any further changes or reviews are needed. Thanks! |
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.
Description
This PR makes two key changes to fix development environment setup and core test failures on Windows machines:
psutilconstraint inpyproject.tomlfrom<4.0to>=5.0.0.TextWrapperinluigi/format.pyto'\n'(LF).Motivation and Context
psutilinstallation failure: When setting up the development environment on Windows (specifically with Python 3.12+), installingpsutil<4.0forcesuvorpipto attempt to buildpsutil 3.4.2from source, which fails to compile on modern Python versions without MSVC Build Tools. Upgrading to>=5.0.0allows the installer to download a pre-compiled wheel.\r\n): On Windows,io.TextIOWrapper(underneathTextWrapper) translates line endings to\r\n(CRLF) by default. This causes mock target test assertions that expect\n(LF) to fail (e.g.,AssertionError: b'55\r\n' != b'55\n'). StandardizingTextWrapper's default newline to\nensures cross-platform consistency of output line endings and allows all tests to pass successfully on Windows.Have you tested this? If so, how?
I have run the unit tests. I verified that both
test/fib_test.pyandtest/decorator_test.pyrun and pass successfully on a Windows machine after applying these changes.