Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix dmypy run on Windows#15429

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ilevkivskyi merged 3 commits intopython:masterfromilevkivskyi:fix-dmypy-run
Jun 14, 2023
Merged

Conversation

@ilevkivskyi
Copy link
Member

@ilevkivskyiilevkivskyi commentedJun 13, 2023
edited
Loading

Fixes#10709

Two changes here:

  • Add equality methods toErrorCode because they may appear in options snapshots
  • Use stable comparison for option snapshots, sinceOptions.apply_changes() does some unrelated things with flags

Both are only relevant on Windows where options may roundtrip as:options -> snapshot -> pickle -> base64 -> unpickle -> apply_changes.

@github-actions

This comment has been minimized.

@Avasam
Copy link
Contributor

Avasam commentedJun 13, 2023
edited
Loading

Ipip install git+https://github.com/ilevkivskyi/mypy.git@fix-dmypy-run#egg=mypy into my typeshed environment, re-enabled--ignore-missing-imports, and it seems to be working correctly now.

The image below shows that missing imports are successfully ignored, and that mypy does show errors where it should
image

ilevkivskyi reacted with thumbs up emoji

@ilevkivskyi
Copy link
MemberAuthor

OK, great, thanks for confirming!

@Avasam
Copy link
Contributor

Avasam commentedJun 13, 2023
edited
Loading

I'd like if someone else can confirm too, since my usage is going through a 3rd party extension. Just to make sure it wasn't a fluke.

@AlexWaygood
Copy link
Member

AlexWaygood commentedJun 13, 2023
edited
Loading

I can also repro the issue on a Windows machine, and can also confirm that this patch appears to fix it! (I'm running dmypy from the command line.)

ilevkivskyi reacted with thumbs up emojiAvasam reacted with hooray emoji

Copy link
Collaborator

@svalentinsvalentin left a comment
edited
Loading

Choose a reason for hiding this comment

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

Tested it and seems to work.

before:

PS C:\src\mypy-play> python -m mypy.dmypy run .\test.pyRestarting: configuration changedDaemon stoppedDaemon startedResponse: {'restart': 'configuration changed', 'stdout': '', 'stderr': '', 'platform': 'win32', 'python_version': '3_11', 'roundtrip_time': 0.488344669342041}

after applying PR:

PS C:\src\mypy-play> python -m mypy.dmypy run .\test.pyRestarting: configuration changedDaemon stoppedDaemon started←[1m←[92mSuccess: no issues found in 42 source files←[0mPS C:\src\mypy-play> python -m mypy.dmypy run .\test.py←[1m←[92mSuccess: no issues found in 1 source file←[0mPS C:\src\mypy-play>

options:Options,
status_file:str,
timeout:int|None=None,
options_snapshot:dict[str,object]|None=None,
Copy link
Collaborator

@svalentinsvalentinJun 13, 2023
edited
Loading

Choose a reason for hiding this comment

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

I accepted it since it work, but thinking out loud, it feels like it shouldn't be necessary to pass both options and options_snapshot. One or the other should be enough.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yeah, but then we will need something like "stable compare", which will be a tiny bit slower (this is btw the original way I did it). OTOH, then motivation is much more obvious, so let's go that way indeed.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@svalentin Could you please test again just in case?

svalentin reacted with thumbs up emoji
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!
Still works:

PS C:\src\mypy-play> python -m mypy.dmypy run .\test.pySuccess: no issues found in 1 source file

Copy link
Collaborator

Choose a reason for hiding this comment

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

For what it's worth, I think this is a much more elegant fix

@ilevkivskyi
Copy link
MemberAuthor

@hauntsaninja It looks likemypy_primer is broken becauseAutoSplit fails to install. I tried re-running but it didn't help:https://github.com/python/mypy/actions/runs/5265892753/jobs/9519524776?pr=15429 Could you please take a look?

AlexWaygood added a commit to AlexWaygood/mypy_primer that referenced this pull requestJun 14, 2023
@AlexWaygood
Copy link
Member

AlexWaygood commentedJun 14, 2023
edited
Loading

@hauntsaninja It looks likemypy_primer is broken becauseAutoSplit fails to install. I tried re-running but it didn't help:https://github.com/python/mypy/actions/runs/5265892753/jobs/9519524776?pr=15429 Could you please take a look?

It looks like the issue is that mypy-primer can't install winsdk (maybe it's a Windows-only package?), which is specified as one of the packages needed for typechecking Autosplit. If that is indeed the issue,hauntsaninja/mypy_primer#89 should fix it.

winsdk was only added to the mypy-primer recipe for Autosplit yesterday, inhauntsaninja/mypy_primer#87

@github-actions
Copy link
Contributor

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

@ilevkivskyiilevkivskyi merged commitcdddc50 intopython:masterJun 14, 2023
@ilevkivskyiilevkivskyi deleted the fix-dmypy-run branchJune 14, 2023 13:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@svalentinsvalentinsvalentin approved these changes

@JukkaLJukkaLAwaiting requested review from JukkaL

@hauntsaninjahauntsaninjaAwaiting requested review from hauntsaninja

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

dmypy run won't run, prints"Restarting: configuration changed" whenignore_missing_imports = True is configured

5 participants

@ilevkivskyi@Avasam@AlexWaygood@svalentin@JelleZijlstra

[8]ページ先頭

©2009-2025 Movatter.jp