Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the version of pex used to build a pex to build_properties. #687

Merged
merged 1 commit into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']