Skip to content

Commit

Permalink
Add the version of pex used to build a pex to build_properties. (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois authored Mar 26, 2019
1 parent 6cf1031 commit 39bbd3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pex/pex_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions tests/test_pex_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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']

0 comments on commit 39bbd3e

Please sign in to comment.