Skip to content

Commit

Permalink
slightly refactor the executable pex tool bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Aug 18, 2018
1 parent 79dd8a8 commit 268d7d3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/python/pants/binaries/executable_pex_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ class ExecutablePexTool(Subsystem):
base_requirements = []

def bootstrap(self, interpreter, pex_file_path, extra_reqs=None):
pex_info = PexInfo.default()
if self.entry_point is not None:
pex_info.entry_point = self.entry_point
# Caching is done just by checking if the file at the specified path is already executable.
if is_executable(pex_file_path):
return PEX(pex_file_path, interpreter)
else:
pex_info = PexInfo.default()
if self.entry_point is not None:
pex_info.entry_point = self.entry_point

with safe_concurrent_creation(pex_file_path) as safe_path:
builder = PEXBuilder(interpreter=interpreter, pex_info=pex_info)
all_reqs = list(self.base_requirements) + list(extra_reqs or [])
Expand Down

0 comments on commit 268d7d3

Please sign in to comment.