Skip to content

Commit b418a9f

Browse files
pkchgvanrossum
authored andcommitted
Add git commit hash to version when not building wheel or sdist (#2992)
1 parent 81df467 commit b418a9f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@
1414
# alternative forms of installing, as suggested by README.md).
1515
from setuptools import setup
1616
from setuptools.command.build_py import build_py
17-
from mypy.version import base_version
17+
from mypy.version import base_version, __version__
1818
from mypy import git
1919

2020
git.verify_git_integrity_or_abort(".")
2121

22-
version = base_version
22+
if any(dist_arg in sys.argv[1:] for dist_arg in ('bdist_wheel', 'sdist')):
23+
version = base_version
24+
else:
25+
version = __version__
2326
description = 'Optional static typing for Python'
2427
long_description = '''
2528
Mypy -- Optional Static Typing for Python

0 commit comments

Comments
 (0)