Skip to content

feature: set environment variables as options #31

@15r10nk

Description

@15r10nk

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

with ctx.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

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions