You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I use coverage.py and coverage-enable-subprocess to run my tests with coverage.
This requires a environment variable TOP to be set to the project root directory
Describe the solution you'd like
I would like to use a option like extra_env={...} to add environment variables
withctx.options(extra_env={"TOP": str(Path.cwd())}):
ctx.run(...) # TOP is used# TOP is not used
I searched for something like this in your docs, because it is possible to set the cwd via an option and I expected that there would also be an option for environment variables.
Describe alternatives you've considered
My current solution is this
os.environ["TOP"]=str(Path.cwd())
This works, but I think the other solution would be cleaner.
Additional context
This issue was labeled with the fund label. The following section is automatically added by Polar.
Sure, that's a good idea! I wonder if we should accept partial environments that are used to update the current one (temporarily), or complete envs that replace it, as the former would not allow removing environment variables. That's what subprocess does for example, and we usually do env={**os.environ.copy(), "MY_ENV": "VALUE"} to pass complete environments. A bit less ergonomic, for sure.
Is your feature request related to a problem? Please describe.
I use coverage.py and coverage-enable-subprocess to run my tests with coverage.
This requires a environment variable
TOP
to be set to the project root directoryDescribe the solution you'd like
I would like to use a option like
extra_env={...}
to add environment variablesI searched for something like this in your docs, because it is possible to set the cwd via an option and I expected that there would also be an option for environment variables.
Describe alternatives you've considered
My current solution is this
This works, but I think the other solution would be cleaner.
Additional context
This issue was labeled with the
fund
label. The following section is automatically added by Polar.Boost priority in our backlog through Polar's "issue funding". Issues linked to monthly sponsorships of $50 or more (author, upvoters) are already prioritized, see how we manage our backlog.
The text was updated successfully, but these errors were encountered: