<#18249 Environment variables are passed to `run `...
# github-notifications
q
#18249 Environment variables are passed to `run `goal when `local_environment` defined Issue created by chris-stetter Describe the bug From a discussion on Slack with @witty-crayon-22786 I noticed that the environments field is only applied to
package
but not
run
goal (yet). I have defined a
local_environment
with
subprocess_environment_env_vars
. Now, when I run a python file, e.g.
./pants run src/main.py
I can see that those environment variables are present in this sandbox. Pants version
2.15.0rc4
OS Linux (WSL2) Additional info It should be noted that I was expecting and hoping this to happen as I have a specific use case. I would like a set of envs to be present in both
run
and
test
, but specific envs to be different during each goal. I have a macro where I just merge those lists of envs and call one macro function in the local environment with
subprocess_environment_env_vars=env_vars_run_django()
and the other in the python tests target with
extra_env_vars=env_vars_test_django()
. I came accross this as I noticed that running a
pex_binary
target does not propagate the envs. pantsbuild/pants