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 a test which enables PEX_VERBOSE and checks whether enabling inhe… #224

Closed

Conversation

KatieLucas-Grapeshot
Copy link
Contributor

Grapeshot uses Pants to build PEX objects. We install MySQL interface code in site-packages and hence would like PEXes to collect this path on start-up. We have discovered the PANTS option to do this doesn't work. Fault traced to the environment scrubbing not honouring the setting or the equiv env variable.

PR adds a test which build such a PEX, enables PEX_VERBOSE, launches PEX and checks whether the enabling of inherit_path results in site-packages being not scrubbed. Since this fails, add processing of inherit_path to the pex environment booting. Test now passes.

…rit_path results in site-packages being not scrubbed. Since this fails, add processing of inherit_path to the pex environment booting.
with open(os.path.join(td, 'exe.py'), 'w') as fp:
fp.write(exe_contents)

pb = PEXBuilder(path=td, preamble=COVERAGE_PREAMBLE if coverage else None)
Copy link
Member

Choose a reason for hiding this comment

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

This line doesn't fail only because coverage is never passed and defaults to False, otherwise boom on COVERAGE_PREAMBLE which is not a symbol in-scope. Killing the unused dists and coverage params would be good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Vars killed.

@jsirois
Copy link
Member

jsirois commented Apr 13, 2016

A few things to fix above, but also Travis-CI should be green as well.
If you can get these issues and Travis all fixed up I can dive in for a bit of a closer look.

@jsirois jsirois self-assigned this Apr 13, 2016
@KatieLucas-Grapeshot
Copy link
Contributor Author

Am looking at Travis fails.

@@ -314,7 +317,9 @@ def execute(self):
"""
teardown_verbosity = self._vars.PEX_TEARDOWN_VERBOSE
try:
with self.patch_sys():
pex_inherit_path = True if (
self._vars.PEX_INHERIT_PATH or self._pex_info.inherit_path) else False
Copy link
Member

Choose a reason for hiding this comment

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

Just the bool expression itself would be more idiomatic and I think clearer:

pex_inherit_path = self._vars.PEX_INHERIT_PATH or self._pex_info.inherit_path

@jsirois
Copy link
Member

jsirois commented Apr 20, 2016

The last 3 comments are all debateable nits only, this change LGTM. Let me know on each, your call. I'll then merge this in.

Thanks for this fix!

@jsirois
Copy link
Member

jsirois commented Apr 20, 2016

I glossed over this when reading the PR description, but it sounds like this fix will be consumed via pants so I'm linking this to the 1.1.5 release ticket #237. Would you all be insterested in contributing Grapeshot to the powered-by page?: http://pantsbuild.github.io/powered_by.html

@jsirois jsirois mentioned this pull request Apr 20, 2016
@KatieLucas-Grapeshot
Copy link
Contributor Author

Oh, yes, it's Pantsbuild we're actually using to compile things. (I'm
trying to shove it into more of the work after reading what people have
done to GNU Make in the interests of expediency).

I'm pretty sure the CEO will do that big happy grin of his to see us listed
up there :-)

I'll send an email.

On 20 April 2016 at 18:56, John Sirois [email protected] wrote:

I glossed over this when reading the PR description, but it sounds like
this fix will be consumed via pants so I'm linking this to the 1.1.5
release ticket #237 #237. Would
you all be insterested in contributing Grapeshot to the powered-by page?:
http://pantsbuild.github.io/powered_by.html


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#224 (comment)

@KatieLucas-Grapeshot
Copy link
Contributor Author

Oh, we should do this properly. I haven't done any OS contribs in yonks
(and this'll be my first Python one). Might as well get it right :-)

I hadn't realised the pex writer took options, which does sort of collapse
the testcase right down...

On 20 April 2016 at 18:53, John Sirois [email protected] wrote:

The last 3 comments are all debateable nits only, this change LGTM. Let me
know on each, your call. I'll then merge this in.

Thanks for this fix!


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#224 (comment)

…inheriting inside the pex bootstrap. Remove code from test pex because we only want the verbose startup messages.
@jsirois
Copy link
Member

jsirois commented Apr 21, 2016

Thanks @KatieLucas-Grapeshot! This has been patched into master as 1 squashed commit keeping the initial description as the commit message here: adefd7e

@jsirois jsirois closed this Apr 21, 2016
@jsirois jsirois removed the in review label Apr 21, 2016
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.

2 participants