-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Make incremental not propagate staleness if the public interface of a module is unchanged (v2) #2014
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gvanrossum
merged 17 commits into
python:master
from
Michael0x2a:incremental-interface-2
Aug 18, 2016
Merged
Make incremental not propagate staleness if the public interface of a module is unchanged (v2) #2014
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
81ab769
Add tests for interface-based incremental checks
MichaelLeeDBX 926e30c
Make incremental tests use 'rechecked' keyword
MichaelLeeDBX 6703173
Add "rechecked" keyword to incremental tests
MichaelLeeDBX 73c22c3
Add more tests for incremental
MichaelLeeDBX 961e19b
Make incremental checks handle remote error
MichaelLeeDBX d64a495
Modify write_cache to safe interface hash
MichaelLeeDBX bc93aca
Load incremental hash when finding cache data
MichaelLeeDBX 9ff0d40
Refactor cache load so we can see the hash earlier
MichaelLeeDBX 0defbb8
Modify incremental to use interface checks
MichaelLeeDBX 559ad00
Fix minor bug with verbose mode
MichaelLeeDBX 6acd57b
Add extra test case for sneaky imports
MichaelLeeDBX 644c785
Fix tests to work with rebase
MichaelLeeDBX 1bdbd1f
Remove debugging code and make minor tweaks
MichaelLeeDBX dc7ff95
Refactor and optimize cache writing code
MichaelLeeDBX 8754d7e
Update test case to work with new change
MichaelLeeDBX cdd6150
Fix failing test
MichaelLeeDBX aaf0362
Rename compute_md5_hash, explain why we don't use hash(...)
MichaelLeeDBX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this workaround defeat the purpose of all the changes in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the workaround, the PR makes incremental better then what it's currently doing, but not as good as it could be -- my plan was to break up the work by landing this first then moving on to figuring out how to remove this workaround and submit a second pull request, probably by doing something similar to Jukka's suggestions.
More specifically, suppose we had the following test case:
With the version of incremental mode in master, changing file
c.py
in any way will cause the main module, filea.py
,b.py
, andc.py
to all be rechecked.This pull request modifies incremental so that if
c.py
was modified without the public interface being changed (maybe changingfunc_c
to return a different value?), then onlyc.py
is rechecked. However, changingc.py
so that its interface changes causes mypy to fall back back to its current behavior (rechecking everything). This behaves basically identically to my original (closed) pull request, except the checks are all more robust/I didn't need to resort to writing another visitor.Ideally, after the workaround is removed, changing the interface of
c.py
should cause onlyb.py
andc.py
to be changed, but that isn't implemented yet and is the next thing I'm planning on working around.