{"action":"created","issue":{"url":"https://api.github.com/repos/pantsbuild/pex/issues/128","labels_url":"https://api.github.com/repos/pantsbuild/pex/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/pantsbuild/pex/issues/128/comments","events_url":"https://api.github.com/repos/pantsbuild/pex/issues/128/events","html_url":"https://github.com/pantsbuild/pex/pull/128","id":87802639,"number":128,"title":"pexrc support","user":{"login":"sixninetynine","id":1018108,"avatar_url":"https://avatars.githubusercontent.com/u/1018108?v=3","gravatar_id":"","url":"https://api.github.com/users/sixninetynine","html_url":"https://github.com/sixninetynine","followers_url":"https://api.github.com/users/sixninetynine/followers","following_url":"https://api.github.com/users/sixninetynine/following{/other_user}","gists_url":"https://api.github.com/users/sixninetynine/gists{/gist_id}","starred_url":"https://api.github.com/users/sixninetynine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sixninetynine/subscriptions","organizations_url":"https://api.github.com/users/sixninetynine/orgs","repos_url":"https://api.github.com/users/sixninetynine/repos","events_url":"https://api.github.com/users/sixninetynine/events{/privacy}","received_events_url":"https://api.github.com/users/sixninetynine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-06-12T17:48:37Z","updated_at":"2015-06-23T17:22:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pantsbuild/pex/pulls/128","html_url":"https://github.com/pantsbuild/pex/pull/128","diff_url":"https://github.com/pantsbuild/pex/pull/128.diff","patch_url":"https://github.com/pantsbuild/pex/pull/128.patch"},"body":"Hi!\r\n\r\nBig fan of pex. We are starting to face an issue with our deployments where setting custom PEX_ROOT and PEX_MODULE in some entry scripts. I'm not a huge fan of having to write a wrapper for our pex files and I'd rather drop a .pexrc with my deployment so the pex file itself can see these vars (rather than having to explicitly set them prior to invoking pex). \r\n\r\nThis PR just adds the ability to drop a `~/.pexrc` or `.pexrc` (relative to the pex itself, in that precedence). Variables() reads this file and updates the environment before looking in `os.environ`, so anything in `.pexrc` is overwritten by runtime environment variables. \r\n\r\nLet me know what you think, thanks for looking! "},"comment":{"url":"https://api.github.com/repos/pantsbuild/pex/issues/comments/114577574","html_url":"https://github.com/pantsbuild/pex/pull/128#issuecomment-114577574","issue_url":"https://api.github.com/repos/pantsbuild/pex/issues/128","id":114577574,"user":{"login":"wickman","id":200731,"avatar_url":"https://avatars.githubusercontent.com/u/200731?v=3","gravatar_id":"","url":"https://api.github.com/users/wickman","html_url":"https://github.com/wickman","followers_url":"https://api.github.com/users/wickman/followers","following_url":"https://api.github.com/users/wickman/following{/other_user}","gists_url":"https://api.github.com/users/wickman/gists{/gist_id}","starred_url":"https://api.github.com/users/wickman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wickman/subscriptions","organizations_url":"https://api.github.com/users/wickman/orgs","repos_url":"https://api.github.com/users/wickman/repos","events_url":"https://api.github.com/users/wickman/events{/privacy}","received_events_url":"https://api.github.com/users/wickman/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T17:22:00Z","updated_at":"2015-06-23T17:22:00Z","body":"I've pondered this off-and-on.  Can you elaborate more on the sorts of things that would go into pexrc?  Some of them make sense e.g. PEX_ALWAYS_CACHE, PEX_VERBOSE, PEX_ROOT, PEX_PYTHON, PEX_PATH and so on.  Others that dictate the entry point i.e. PEX_SCRIPT and PEX_MODULE seem like they would only be problematic as the pexrc would taint subprocesses.  Perhaps explicitly disallow entry-point altering variables within pexrc?\r\n\r\nThe other thing that concerns me is the choice of precedence.  It almost seems backwards to me.  I think we'd want to prefer environment -> .pexrc -> ~/.pexrc.  If I've set PEX_ANYTHING in the environment, I'd for sure not want it to be overridden by any files on disk.  Also .pexrc in the cwd seems a bit too magical and prone to error.  I've got a bunch of tools in my $PATH that are built as pexes and I'm not sure I'd want their behavior to be altered if I happened to land in a repo or directory with a .pexrc.  Perhaps the .pexrc should be relative to the currently-invoked pex binary itself?"}}