diff --git a/pex/pex_info.py b/pex/pex_info.py index 3041ae869..bdd2f801d 100644 --- a/pex/pex_info.py +++ b/pex/pex_info.py @@ -13,6 +13,7 @@ from pex.orderedset import OrderedSet from pex.util import merge_split from pex.variables import ENV +from pex.version import __version__ as pex_version # TODO(wickman) Split this into a PexInfoBuilder/PexInfo to ensure immutability. @@ -56,6 +57,7 @@ def make_build_properties(cls, interpreter=None): plat = Platform.current() platform_name = plat.platform return { + 'pex_version': pex_version, 'class': pi.identity.interpreter, 'version': pi.identity.version, 'platform': platform_name, diff --git a/tests/test_pex_info.py b/tests/test_pex_info.py index 6df2df427..82268f3ac 100644 --- a/tests/test_pex_info.py +++ b/tests/test_pex_info.py @@ -9,6 +9,7 @@ from pex.orderedset import OrderedSet from pex.pex_info import PexInfo from pex.variables import ENV, Variables +from pex.version import __version__ as pex_version def make_pex_info(requirements): @@ -75,3 +76,7 @@ def test_from_env(): always_write_cache=True) assert_same_info(PexInfo(info=info), PexInfo.from_env(env=Variables(environ=environ))) + + +def test_build_properties(): + assert pex_version == PexInfo.default().build_properties['pex_version']