Closed ansidev closed 1 year ago
EnvFile is configured per run configuration.
@ashald
EnvFile is configured per run configuration.
We expected this, but it doesn't work as expected. That's why I created this issue. However, I guess you didn't get it.
You did not mentioned the IDE so IDK how to reproduce it, but I just checked PyCharm and each run configuration had its own changes saved independently.
If you're still seeing the issue, you might want to try re-creating your project file.
@ashald
Although this issue is from your plugin and I didn't use PyCharm, however, you said you tested this issue on PyCharm. So I made a record to reproduce this issue on PyCharm.
Steps to reproduce
main.py:
import os
def print_env():
print(os.environ['PY_ENV'])
if __name__ == '__main__':
print_env()
app.env.dev:
PY_ENV=dev
app.env.test:
PY_ENV=test
[dev] main
and [test] main
.https://user-images.githubusercontent.com/6688235/203485140-1ce8dfb7-de62-4fa5-8207-a60b24b8d155.mov
As you can see in the above video:
Note | [dev] main | [test] main |
---|---|---|
Before updating | app.env.dev (00:05) | app.env.dev (00:06) |
After updating | app.env.test (00:20) | app.env.test (00:16) |
This means that the env file path is always the same for all run configurations.
Test Environment Information (if necessary)
Finally, I don't know how you reproduced this issue, but I doubt that after recording this video.
Expected:
Problem: The EnvFile configuration is a global config, so if I load
app.env.dev
in RC A, RC B will loadapp.env.dev
the next time unless I update EnvFile config.