Skip to content

Reset cache on mypy change - #1952

Merged
gvanrossum merged 4 commits into
python:masterfrom
Michael0x2a:reset-cache-on-mypy-change
Jul 29, 2016
Merged

gvanrossum merged 4 commits into
python:masterfrom
Michael0x2a:reset-cache-on-mypy-change

Conversation

@Michael0x2a

@Michael0x2a Michael0x2a commented Jul 28, 2016 •

Copy link
Copy Markdown
Collaborator

This pull request modifies build.py to add an extra "version_id" attribute to the cache metadata. If the version id specified in mypy/version.py differs from the id stored in the cached data, mypy will automatically invalidate that cached data.

This pull request will also modify setup.py to automatically edit the installed mypy/version.py file during installation to include the git hash if applicable.

If setup.py is not being run from a git repo, or if a git executable can't be found in the system, mypy will default to using the original version id.

The net effect should be that...

  • Developers who directly run mypy from a git repo will still need to manually delete their cache when the cache format changes.
  • Users who install mypy from PyPi will not have their version.py files edited during installation to include the git commit hash. However, their cache will still be invalidated whenever they update since we manually change the __version__ variable per each release.
  • Users who pip-install mypy directly from the git repo will have their version.py files edited during installation to include the git commit hash. That means their cache will be automatically invalidated even if the __version__ variable is the same as before.

Fixes #1354.

This commit modifies build.py to add an extra "version_id" attribute to
the cache metadata. If the version id specified in mypy/version.py
differs from the id stored in the cached data, mypy will automatically
invalidate that cached data.
This commit modifies setup.py to automatically edit the installed
mypy/version.py file during installation to include the git hash if
applicable.

If setup.py is not being run from a git repo, or if a git executable
can't be found in the system, mypy will default to using the original
version id.
Comment thread mypy/build.py Outdated
meta.get('child_modules', []),
meta.get('options'),
meta.get('dep_prios', []),
meta.get('version_id')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Trailing comma.

@gvanrossum

Copy link
Copy Markdown
Member

That's all I've got. And the "." works fine, so no worries about that. So really, just two trailing commas. :-)

@gvanrossum
gvanrossum merged commit 4c1d5de into python:master Jul 29, 2016
@Michael0x2a
Michael0x2a deleted the reset-cache-on-mypy-change branch September 1, 2016 21:05
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.

3 participants