-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Honor PEX_IGNORE_RCFILES in to_python_interpreter() #673
Honor PEX_IGNORE_RCFILES in to_python_interpreter() #673
Conversation
rc_variables = Variables.from_rc(rc=options.rc_file) | ||
pex_python_path = rc_variables.get('PEX_PYTHON_PATH', '') | ||
if not ENV.PEX_IGNORE_RCFILES: | ||
rc_variables = Variables.from_rc(rc=options.rc_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The options.rc_file value is None
by default. To be non-None
pex had to be invoked from the cli with --rcfile=[path]
. As such you're setting the precedent rule here of env beats flags. That does not seem kosher. Is that what you're intending here or have I read things wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, the flag really makes no sense. It shouldn't exist at all fwict. I'd be fine with considering this not your problem. I've filed #674
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if the option is None
, Variable.from_rc
will try to load stuff from well-known files (i.e. /etc/pexrc
, ~/.pexrc
...), which leaves us with no way of specifying here "I actually want you to ignore all pexrc files".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the condition could be if options.rc_file or not ENV.PEX_IGNORE_RCFILES
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'd still like a way of expressing "Please do not try to load pexrc files", so would you be okay with something like "If the flag is None, and the env variable PEX_IGNORE_RCFILES is set, please do not load any pexrc file? That would create slightly inconsistent semantics for the env variable, until the flag is removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I think we're saying the same thing. SGTM.
@CMLivingston can you provide any guidance here navigating the tangle between |
Currently, it will try to resolve a path to an interpreter in
PEX_PYTHON_PATH
even ifPEX_IGNORE_RCFILES
is set.