Skip to content

Commit

Permalink
refactor unnecessary complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Feb 16, 2018
1 parent 35899ee commit c7c90b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,12 @@ def _create_binary(self, binary_tgt, results_dir):

if built_dists is not None:
synthetic_address = ':'.join(2 * [binary_tgt.invalidation_hash()])

local_dist_req_libs = inject_synthetic_dist_requirements(
self.context.build_graph,
built_dists,
synthetic_address,
in_tgts=binary_tgt.closure())
if len(local_dist_req_libs) != 0:
req_tgts = local_dist_req_libs + req_tgts
req_tgts = local_dist_req_libs + req_tgts

for dist in built_dists:
# Ensure only python_dist dependencies of binary_tgt are added to the output pex.
Expand All @@ -154,7 +152,6 @@ def _create_binary(self, binary_tgt, results_dir):
if any([tgt.id in dist for tgt in binary_tgt.closure(exclude_scopes=Scopes.COMPILE)]):
builder.add_dist_location(dist)


dump_requirements(builder, interpreter, req_tgts, self.context.log, binary_tgt.platforms)

# Build the .pex file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ def resolve_requirements(self, req_libs, local_dist_targets=None):
with safe_concurrent_creation(path) as safe_path:
# Handle locally-built python distribution dependencies.
built_dists = self.context.products.get_data(BuildLocalPythonDistributions.PYTHON_DISTS)
if built_dists:
req_libs = inject_synthetic_dist_requirements(self.context.build_graph,
built_dists,
':'.join(2 * [target_set_id])) + req_libs
if built_dists is not None:
synthetic_address = ':'.join(2 * [target_set_id])
local_dist_req_libs = inject_synthetic_dist_requirements(
self.context.build_graph,
built_dists,
synthetic_address)
req_libs = local_dist_req_libs + req_libs
self._build_requirements_pex(interpreter, safe_path, req_libs)
return PEX(path, interpreter=interpreter)

Expand Down

0 comments on commit c7c90b2

Please sign in to comment.