Skip to content

Commit

Permalink
Fix issue with python_bundle_create over multiple targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Gardner committed Oct 20, 2016
1 parent 3a022b9 commit a4a7e66
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/python/pants/backend/python/tasks/python_binary_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def execute(self):
if not vt.valid:
self.create_binary(vt.target, vt.results_dir)

python_pex_product.add(binary, os.path.dirname(pex_path)).append(os.path.basename(pex_path))
python_deployable_archive.add(binary, os.path.dirname(pex_path)).append(os.path.basename(pex_path))
python_pex_product.add(vt.target, os.path.dirname(pex_path)).append(os.path.basename(pex_path))
python_deployable_archive.add(vt.target, os.path.dirname(pex_path)).append(os.path.basename(pex_path))
self.context.log.debug('created {}'.format(os.path.relpath(pex_path, get_buildroot())))

# Create a copy for pex.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,11 @@ def _check_products(self, bin_name):
def test_deployable_archive_products(self):
self.test_task.execute()
self._check_products('bin')

def test_handles_multiple_binary_targets(self):
cbin = self.create_python_binary('src/python/cbin', 'cbin', 'lib.lib:main',
dependencies=['//src/python/lib'])
self.task_context = self.context(target_roots=[self.binary, cbin])
self.task_context.run_tracker.run_info = RunInfo(self.run_info_dir)
self.create_task(self.task_context).execute()
self._check_products('bin')

0 comments on commit a4a7e66

Please sign in to comment.