Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back inject_init rule #9174

Merged
merged 1 commit into from Feb 25, 2020

Conversation

Eric-Arellano
Copy link
Contributor

#9115 inlined inject_init.py into prepare_chrooted_python_sources.py because it was the only call site at the time.

Turns out, V2 coverage has a use case for inject_init.

This makes several enhancements over the original inject_init implementation:

  • Uses InputFilesContent instead of ExecuteProcessRequest
  • The result merges the original with new __init__.pys, rather than returning only the newly added __init__.pys.
  • Returns a Snapshot, rather than Digest, which is more ergonomic.
  • More comprehensive tests, e.g. ensuring we aren't overriding the original __init__.py.

Copy link
Contributor

@TansyArron TansyArron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Eric!

@Eric-Arellano Eric-Arellano merged commit f5732dc into pantsbuild:master Feb 25, 2020
@Eric-Arellano Eric-Arellano deleted the add-back-inject-init branch February 25, 2020 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants