FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Lessen dmypy suggest path limitations for Windows machines by CoolCat467 · Pull Request #19337 · python/mypy · GitHub

Repository navigation

Lessen dmypy suggest path limitations for Windows machines - #19337

Merged
hauntsaninja merged 2 commits into
python:masterfrom
CoolCat467:windows-dmypy-suggest
Jul 7, 2025
Merged

hauntsaninja merged 2 commits into
python:masterfrom
CoolCat467:windows-dmypy-suggest

Conversation

Copy link
Copy Markdown
Contributor

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.

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.

CoolCat467 changed the title Lessen dmypy suggest path limitations for Windows machine Lessen dmypy suggest path limitations for Windows machines Jun 25, 2025

Copy link
Copy Markdown
Collaborator

I wonder if it would make sense to just remove the key.count(":") check

Copy link
Copy Markdown
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.

sterliakov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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:)

Comment thread mypy/suggestions.py
Co-authored-by: Stanislav Terliakov <50529348+sterliakov@users.noreply.github.com>

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good, thank you!

hauntsaninja merged commit 8df94d2 into python:master Jul 7, 2025
CoolCat467 deleted the windows-dmypy-suggest branch July 7, 2025 09:03
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 <50529348+sterliakov@users.noreply.github.com>
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mypy daemon suggest does not accept windows paths

4 participants


Back | FazBrowse Home | New Git URL