with self.invalidated(targets) as invalidation_check:
pex = self._get_pex_for_versioned_targets(interpreter, invalidation_check.all_vts)
self.context.products.register_data(self.PYTHON_SOURCES, pex)
def _get_pex_for_versioned_targets(self, interpreter, versioned_targets):
if versioned_targets:
target_set_id = VersionedTargetSet.from_versioned_targets(versioned_targets).cache_key.hash
After Change
def execute(self):
interpreter = self.context.products.get_data(PythonInterpreter)
pex_by_target_base = OrderedDict() // Preserve ~PYTHONPATH ordering over pexes.
for target_base, targets in self._iter_targets_by_base():
with self.invalidated(targets) as invalidation_check:
pex = self._get_pex_for_versioned_targets(interpreter, invalidation_check.all_vts)
pex_by_target_base[target_base] = pex
self.context.products.register_data(self.PythonSources, self.PythonSources(pex_by_target_base))
def _iter_targets_by_base(self):
// N.B: Files and Resources targets belong with the consuming (dependee) targets so that those
// targets can be ensured of access to the files in their PEX chroot. This means a given Files