-
-
Notifications
You must be signed in to change notification settings - Fork 646
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 extra_env_vars
field to experimental_shell_command
target.
#15742
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -301,6 +301,17 @@ class ShellCommandToolsField(StringSequenceField): | |
) | ||
|
||
|
||
class ShellCommandExtraEnvVarsField(StringSequenceField): | ||
alias = "extra_env_vars" | ||
help = softwrap( | ||
""" | ||
Additional environment variables to include in the shell process. | ||
Entries are strings in the form `ENV_VAR=value` to use explicitly; or just | ||
`ENV_VAR` to copy the value of a variable in Pants's own environment. | ||
""" | ||
) | ||
Comment on lines
+306
to
+312
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's probably worth extracting this help string to a templating function, maybe in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh... or defining a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be done as a follow up as well. |
||
|
||
|
||
class ShellCommandLogOutputField(BoolField): | ||
alias = "log_output" | ||
default = False | ||
|
@@ -324,6 +335,7 @@ class ShellCommandTarget(Target): | |
ShellCommandSourcesField, | ||
ShellCommandTimeoutField, | ||
ShellCommandToolsField, | ||
ShellCommandExtraEnvVarsField, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this to the end but looks like it should maybe be put in alphabetical order? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm one in favor of sorting lists alphabetically, however here I think the order affects the order the fields are presented in the documentation so that is worth considering too. |
||
) | ||
help = softwrap( | ||
""" | ||
|
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.
Tried setting
command_env = await Get(Environment, EnvironmentRequest(extra_env_vars))
from the start, butEnvironment
is frozen so it doesn't allow the follow-up additions needed to set the tools path