Skip to content
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

The platform option totally affects the cache! #3663

Merged
merged 1 commit into from
Jul 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def default_lib_path(data_dir: str,
('data_json', str), # path of <id>.data.json
('suppressed', List[str]), # dependencies that weren't imported
('child_modules', List[str]), # all submodules of the given module
('options', Optional[Dict[str, bool]]), # build options
('options', Optional[Dict[str, object]]), # build options
('dep_prios', List[int]),
('interface_hash', str), # hash representing the public interface
('version_id', str), # mypy version for cache invalidation
Expand Down Expand Up @@ -907,6 +907,9 @@ def find_cache_meta(id: str, path: str, manager: BuildManager) -> Optional[Cache
if manager.options.quick_and_dirty:
# In quick_and_dirty mode allow non-quick_and_dirty cache files.
cached_options['quick_and_dirty'] = True
if not cached_options.get('platform') and manager.options.skip_version_check:
# Older versions didn't write platform.
cached_options['platform'] = manager.options.platform
if cached_options != current_options:
manager.trace('Metadata abandoned for {}: options differ'.format(id))
return None
Expand Down
2 changes: 1 addition & 1 deletion mypy/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Options:
"strict_optional",
}

OPTIONS_AFFECTING_CACHE = PER_MODULE_OPTIONS | {"quick_and_dirty"}
OPTIONS_AFFECTING_CACHE = (PER_MODULE_OPTIONS | {"quick_and_dirty", "platform"})

def __init__(self) -> None:
# -- build options --
Expand Down