Skip to content

Commit 3fefe2a

Browse files
committed
env var should always override
1 parent d97949e commit 3fefe2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roboflow/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def get_conditional_configuration_variable(key, default):
7676

7777

7878
def load_roboflow_api_key(workspace_url=None):
79+
if os.getenv("RF_API_KEY") is not None:
80+
return os["RF_API_KEY"]
7981
RF_WORKSPACES = get_conditional_configuration_variable("workspaces", default={})
8082
workspaces_by_url = {w["url"]: w for w in RF_WORKSPACES.values()}
8183
default_workspace_url = get_conditional_configuration_variable("RF_WORKSPACE", default=None)
@@ -84,5 +86,3 @@ def load_roboflow_api_key(workspace_url=None):
8486
workspace = workspace or get_conditional_configuration_variable("RF_WORKSPACE", default=None)
8587
if workspace:
8688
return workspace.get("apiKey", None)
87-
if os.getenv("RF_API_KEY") is not None:
88-
return os["RF_API_KEY"]

0 commit comments

Comments
 (0)