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 authored and toddgardner committed Mar 26, 2017
1 parent a402344 commit 0b30d7c
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 @@ -61,8 +61,8 @@ def execute(self):
else:
self.context.log.debug('using cache for {}'.format(vt.target))

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 0b30d7c

Please sign in to comment.