Task to gather local python sources into a pex. #4084

Merged
merged 2 commits into from Nov 20, 2016

Conversation

Projects
None yet
2 participants
@benjyw
Contributor

benjyw commented Nov 20, 2016

Part of the new python pipeline.

+ round_manager.require_data(PythonInterpreter)
+
+ def execute(self):
+ targets = self.context.targets(lambda tgt: isinstance(tgt, PythonTarget) or

This comment has been minimized.

@jsirois

jsirois Nov 20, 2016

Member

The isinstance(tgt, (PythonTarget, Resources)) form still fits in <100 cols and leverages the lib.

@jsirois

jsirois Nov 20, 2016

Member

The isinstance(tgt, (PythonTarget, Resources)) form still fits in <100 cols and leverages the lib.

This comment has been minimized.

@benjyw

benjyw Nov 20, 2016

Contributor

Oh yeah! I forgot that was possible. Fixed.

@benjyw

benjyw Nov 20, 2016

Contributor

Oh yeah! I forgot that was possible. Fixed.

+ self.context.log.debug(' Dumping sources: {}'.format(tgt))
+ for relpath in tgt.sources_relative_to_source_root():
+ try:
+ copy_to_chroot(tgt.target_base, relpath, builder.add_source)

This comment has been minimized.

@jsirois

jsirois Nov 20, 2016

Member

Perhaps just inline copy_to_chroot, its overly indirect since there is only ever builder.add_source passed as add_function for example.

@jsirois

jsirois Nov 20, 2016

Member

Perhaps just inline copy_to_chroot, its overly indirect since there is only ever builder.add_source passed as add_function for example.

This comment has been minimized.

@benjyw

benjyw Nov 20, 2016

Contributor

Good call. This was a leftover from the code I copied it from, which handled old-style resources using copy_to_chroot as well, and I didn't notice I could kill it. Done.

@benjyw

benjyw Nov 20, 2016

Contributor

Good call. This was a leftover from the code I copied it from, which handled old-style resources using copy_to_chroot as well, and I didn't notice I could kill it. Done.

+
+ if getattr(tgt, 'resources', None):
+ # No one should be on old-style resources any more. And if they are,
+ # switching to the new python pipeline will be a great opportunity to get fix that.

This comment has been minimized.

@jsirois

jsirois Nov 20, 2016

Member

Verbage is off, probably just s/get fix/fix/.

@jsirois

jsirois Nov 20, 2016

Member

Verbage is off, probably just s/get fix/fix/.

This comment has been minimized.

@benjyw

benjyw Nov 20, 2016

Contributor

Ooops. Fixed.

@benjyw

benjyw Nov 20, 2016

Contributor

Ooops. Fixed.

@benjyw benjyw merged commit b1e6df2 into pantsbuild:master Nov 20, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details

@benjyw benjyw deleted the benjyw:gather_python_sources branch Nov 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment