Lessen dmypy suggest path limitations for Windows machines#19337
Merged
hauntsaninja merged 2 commits intopython:masterfrom Jul 7, 2025
Merged
Lessen dmypy suggest path limitations for Windows machines#19337hauntsaninja merged 2 commits intopython:masterfrom
hauntsaninja merged 2 commits intopython:masterfrom
Conversation
Collaborator
|
I wonder if it would make sense to just remove the |
Contributor
Author
|
That could certainly be an option, or make it always max of 2 if a platform check is unacceptable. |
This comment has been minimized.
This comment has been minimized.
sterliakov
approved these changes
Jun 26, 2025
Collaborator
sterliakov
left a comment
There was a problem hiding this comment.
LG! Added a comment suggestion (it wouldn't be immediately obvious to me why a second colon should be allowed on windows) - feel free to ignore if you think it's me too used to convenient devenv and any normal person should immediately understand that:)
Co-authored-by: Stanislav Terliakov <[email protected]>
Contributor
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Closed
hauntsaninja
approved these changes
Jul 7, 2025
Collaborator
hauntsaninja
left a comment
There was a problem hiding this comment.
Looks good, thank you!
esarp
pushed a commit
that referenced
this pull request
Jul 10, 2025
In this pull request, we allow dmypy suggest absolute paths to contain the drive letter colon for Windows machines. Fixes #19335. This is done by changing how `find_node` works slightly, allowing there to be at most two colon (`:`) characters in the passed key for windows machines instead of just one like on all other platforms, and then using `rsplit` and a split limit of 1 instead of just `split` like prior. --------- Co-authored-by: Stanislav Terliakov <[email protected]>
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.
In this pull request, we allow dmypy suggest absolute paths to contain the drive letter colon for Windows machines. Fixes #19335.
This is done by changing how
find_nodeworks slightly, allowing there to be at most two colon (:) characters in the passed key for windows machines instead of just one like on all other platforms, and then usingrsplitand a split limit of 1 instead of justsplitlike prior.I was looking at the existing tests for dmypy suggest and noticed nothing is testing absolute paths for any platform, so I am unsure what I need to do to add tests; This sounds like maybe it could require changes to the test framework system, and I'd like feedback from others before trying to do that.