Make mypy -V show git commit hash more often #2394
Merged
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.
Previously the git commit hash was only appended to
__version__
by setup.py. Now we do this dynamically in mypy/version.py. This means the commit hash is also reported when run directly from the repo (e.g.python3 -m mypy -V
from the repo root). It is also used by the cache in this case.I didn't notice any slowdown. Notice the contents of version.py in distributions is still overwritten by setup.py so a properly installed version should not be executing any git commands at startup.