-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
Environment Variables for all environments #1362
Comments
You can have a base environment that you can use as a template that all environments may inherit from. |
Is there documentation for this -- I haven't seen this yet? |
Hey Ofek |
Can you give me two example environments and the expected value of that variable? |
Yes of course. I have a default environment, which I would like to include the lint and test features, and then I have lint and test environments, which have different dependencies. I would like all of these environment export a PYTHONPATH |
I'm trying to understand what the value of that variable would be in order to provide you accurate configuration. |
In this case, I would like the PYTHONPATH to be exported in all environments AND I would like to use the default environment as an environment that has ALL features. |
There is also a feature request to support |
Yeah I mean I'm specifically trying to avoid that, I think a more elegant solution would be something like [tool.hatch.envs.*.env-vars] |
Hey Ofek, Was wondering what you think of this feature? |
I would love that, thanks! It would be part of this configuration table: hatch/src/hatch/project/config.py Line 37 in a27473d
[tool.hatch.env] |
What do you think of this? |
It would also be great if the environment variables applied to the hatch-test env. It is currently not possible to set The workaround is [tool.hatch.envs.test]
description = "Testing with pytest"
type = "pip-compile"
lock-filename = "requirements/requirements-test-lock.txt"
template = "hatch-test"
[tool.hatch.envs.test.env-vars]
PIP_EXTRA_INDEX_URL = "https://privaterepo.com/simple" |
The test environment does not inherit from anything so you must put all of your configuration within that i.e. in your example change the name to |
Can we add support for adding environment variables to all environments in a central place?
The text was updated successfully, but these errors were encountered: