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 file reloading in dmypy with --export-types#16359

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
JukkaL merged 5 commits intopython:masterfromilevkivskyi:fix-inspect-reload
Nov 1, 2023

Conversation

@ilevkivskyi
Copy link
Member

Fixes#15794

Unfortunately, this requires to pass--export-types todmypy run if one wants to inspect a file that was previously kicked out of the build.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@ilevkivskyiilevkivskyi mentioned this pull requestOct 29, 2023
2 tasks
changed+= [
(bs.module,bs.path)
forbsinsources
ifbs.pathand (bs.module,bs.path)notinchanged
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is quadratic, and it could be slow if there are many files and many that are changed. Maybe construct a temporary set fromchanged and use it in thenot in changed check?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes, good point, fixed now.

changed+= [
(bs.module,bs.path)
forbsinsources
ifbs.pathand (bs.module,bs.path)notinchanged
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to above. Maybe move this to a helper function to avoid code duplication?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Moved to a helper function.

options.use_fine_grained_cache=self.use_cacheandnotbuild_cache
options.cache_fine_grained=self.use_cache
options.local_partial_types=True
options.export_types=True
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the purpose of this change?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Starting the daemon with this option set toTrue is cleaner forinspect unit tests, I made this explicit now (so it will not slow down other fine grained tests).


defrun_check(self,server:Server,sources:list[BuildSource])->list[str]:
response=server.check(sources,export_types=True,is_tty=False,terminal_width=-1)
response=server.check(sources,export_types=False,is_tty=False,terminal_width=-1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm why do we haveexport_types=False here, but true above?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Passing it explicitly on each run will force reloading files. Putting it in options from the start is IMO cleaner.

@github-actions
Copy link
Contributor

Diff frommypy_primer, showing the effect of this PR on open source code:

discord.py (https://github.com/Rapptz/discord.py): typechecking got 1.09x faster (138.5s -> 127.5s)(Performance measurements are based on a single noisy sample)

Copy link
Collaborator

@JukkaLJukkaL left a comment

Choose a reason for hiding this comment

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

Thanks for the updates!

@JukkaLJukkaL merged commit3712193 intopython:masterNov 1, 2023
JukkaL pushed a commit that referenced this pull requestNov 1, 2023
Fixes#15794Unfortunately, this requires to pass `--export-types` to `dmypy run` ifone wants to inspect a file that was previously kicked out of the build.
@ilevkivskyiilevkivskyi deleted the fix-inspect-reload branchNovember 1, 2023 15:43
JukkaL added a commit that referenced this pull requestNov 9, 2023
The script format changelog entries based on commit history and has somerules to filter out some changes, such as typeshed sync and changescherry-picked to the previous release branch.Example of how to run it:```$ python misc/generate_changelog.py 1.7Generating changelog for 1.7Previous release was     1.6Merge base:d7b2451NOTE: Drop "Fix crash on ParamSpec unification (for real)", since it was in previous release branchNOTE: Drop "Fix crash on ParamSpec unification", since it was in previous release branchNOTE: Drop "Fix mypyc regression with pretty", since it was in previous release branchNOTE: Drop "Clear cache when adding --new-type-inference", since it was in previous release branchNOTE: Drop "Match note error codes to import error codes", since it was in previous release branchNOTE: Drop "Make PEP 695 constructs give a reasonable error message", since it was in previous release branchNOTE: Drop "Fix ParamSpec inference for callback protocols", since it was in previous release branchNOTE: Drop "Try upgrading tox", since it was in previous release branchNOTE: Drop "Optimize Unpack for failures", since it was in previous release branch * Fix crash on unpack call special-casing (Ivan Levkivskyi, PR [16381](#16381)) * Fix file reloading in dmypy with --export-types (Ivan Levkivskyi, PR [16359](#16359)) * Fix daemon crash caused by deleted submodule (Jukka Lehtosalo, PR [16370](#16370))...```
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JukkaLJukkaLJukkaL approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

(🐞)dmypy inspect saysUnknown module with multipleruns

2 participants

@ilevkivskyi@JukkaL

[8]ページ先頭

©2009-2025 Movatter.jp