-
-
Notifications
You must be signed in to change notification settings - Fork 636
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 mechanism to propagate arbitrary environment variables #10352
Comments
Very interested in that feature. We are trying to run an integration test against AWS, which requires passing In my mind it's quite similar to Tox's |
Hey @ynouri, that use case is supported for tests: https://www.pantsbuild.org/docs/python-test-goal#setting-environment-variables This issue's proposal is more general, like being able to set env vars for a codegen process running Protoc. Let us know if that works out or any way we can help y'all out! If you're not yet on it, we're a friendly bunch on Slack: https://www.pantsbuild.org/docs/community. |
Wonderful, thanks a lot Eric! Next time I'll spend more time reading the docs 😄 If that can be of interest to future readers, we are running Pants just after the Github Action aws-actions/configure-aws-credentials. As explained in the Pants documentation, adding [test]
extra_env_vars = ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN", "AWS_DEFAULT_REGION", "AWS_REGION"] |
The |
This issue is essentially resolved. The pattern is for a particular tool or use case to declare an Under the hood, this uses environment variable filtering, so the relevant |
As demonstrated in #10282, it's not very feasible for us to anticipate which env variables users will or will not need, as we currently do, for example, with the option
--python-native-code-cpp-flags
.Instead, we need to allow users to pass arbitrary env variables to processes.
Some key questions:
Process
gets these values, or should we try to keep it more precise? For example, should all Python relatedProcess
es have it via[python-setup]
, or be even more granular that only Pytest processes have it via a[pytest]
option?os.getenv()
to get the current value of an env var; you would need to explicitly set the value. Is this fine, or do we need a mechanism to read from the greater environment?The text was updated successfully, but these errors were encountered: