Hi, what is a way to pass local `.prefect/config.t...
# prefect-community
t
Hi, what is a way to pass local
.prefect/config.toml
file to runtime environment? For example, I’m writing
pytest
in VScode, when I run the test, it always fail for not finding the secrets that specified in that config file. I can only run in CLI
python flow.py
fine.
k
What kind of secrets you try to access from
.prefect/config.toml
?
t
AWS secret keys for example
k
We suggest that you use block to save your credentials in 2.0
t
no, I’m using 1.x version. Also, I’m trying to setup in local development runtime environment. Not in UI.
basically, when I run CLI
python flow.py
it is fetching the secrets fine. But when I run unit tests, it is not fetching the secrets even after I set the python setting to setup this environment variable
PREFECT__USER_CONFIG_PATH
k
@Mason Menges Maybe you know about this? I’m not very familiar with 1.0
👀 1
m
Hey @Tony Yun I'm having some trouble visualizing this in my head when you're referring to a local runtime environment are you just referring to a virtual environment on your local machine or a container image when the code is running?
t
a virtual environment on my local machine. I can do
export PREFECT__USER_CONFIG_PATH=~/.prefect/config
so if I run
python flow.py
it will fetch the secrets properly. How can I fetch the secrets too if I want to run an unit-test on VScode.
I’ve dumped
PREFECT__USER_CONFIG_PATH
as part of
os.environ
, however it didn’t help. so I wonder what’s the trick to load the Prefect secrets locally
actually pls ignore me. I have some issues that I have to fix first.
m
No worries, I was just trying to see if I could reproduce what you were experiencing 😄 Let us know if you get it sorted out.