From c3094b0f9b0906afb650db2fc402b1c876b7cbcb Mon Sep 17 00:00:00 2001 From: John Sirois Date: Mon, 25 Mar 2019 18:07:47 -0700 Subject: [PATCH] Restore `pex.pex_bootstrapper.is_compressed` API. This was eliminated in #680 since it was (locally) unused but it turns out it was used over in lambdex. The long term fix allowing safe removal of the API is tracked by: https://github.com/wickman/lambdex/issues/5. Fixes #684 --- pex/pex_bootstrapper.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pex/pex_bootstrapper.py b/pex/pex_bootstrapper.py index 5a0c7fd21..06faa5daa 100644 --- a/pex/pex_bootstrapper.py +++ b/pex/pex_bootstrapper.py @@ -156,6 +156,13 @@ def bootstrap_pex(entry_point): pex.PEX(entry_point).execute() +# NB: This helper is used by third party libs - namely https://github.com/wickman/lambdex. +# TODO(John Sirois): Kill once https://github.com/wickman/lambdex/issues/5 is resolved. +def is_compressed(entry_point): + from .pex_info import PexInfo + return os.path.exists(entry_point) and not os.path.exists(os.path.join(entry_point, PexInfo.PATH)) + + def bootstrap_pex_env(entry_point): """Bootstrap the current runtime environment using a given pex.""" pex_info = _bootstrap(entry_point)