From 63f7059aaaae790a68aafe41a5806a1d68e1ca95 Mon Sep 17 00:00:00 2001 From: Max Moroz Date: Mon, 13 Mar 2017 16:16:42 -0700 Subject: [PATCH 1/2] Add git commit hash to version when not building wheel --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d1f424a93e54..a8d5b3dfe655 100644 --- a/setup.py +++ b/setup.py @@ -14,12 +14,15 @@ # alternative forms of installing, as suggested by README.md). from setuptools import setup from setuptools.command.build_py import build_py -from mypy.version import base_version +from mypy.version import base_version, __version__ from mypy import git git.verify_git_integrity_or_abort(".") -version = base_version +if 'bdist_wheel' in sys.argv[1:]: + version = base_version +else: + version = __version__ description = 'Optional static typing for Python' long_description = ''' Mypy -- Optional Static Typing for Python From fff90932091a4660ba6c3bf2f96a4f91db8f9008 Mon Sep 17 00:00:00 2001 From: Max Moroz Date: Tue, 14 Mar 2017 10:33:19 -0700 Subject: [PATCH 2/2] Handle source distributions correctly --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a8d5b3dfe655..edf84cd87a16 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ git.verify_git_integrity_or_abort(".") -if 'bdist_wheel' in sys.argv[1:]: +if any(dist_arg in sys.argv[1:] for dist_arg in ('bdist_wheel', 'sdist')): version = base_version else: version = __version__