Closed shimpeko closed 1 year ago
Another options is providing a helper function to set/unset env var. But my solution is more explicit and it will not provide multiple ways to configure environment variables (always set the env
parameter of subprocess.run()
).
What
I'd like to propose adding API to configure environment variable for AppContext; and adding AppContext.run() which respect the configured context.
It means we should always use
AppContext.run()
overexecution.run()
when possible.Example of new API:
Why
With existing design, it is hard to pass environment variable to child commands. We need to write custom code to set/unset environment variable when we want to pass it to child command.
Example: