Skip to content

Commit c62adff

Browse files
defer resolving of env vars until API call (#8)
1 parent 1ff2b5e commit c62adff

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

heron/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import os
2-
31
_base_url = "https://app.herondata.io/api"
42

5-
basic_auth_username = os.getenv("HERON_USERNAME")
6-
basic_auth_password = os.getenv("HERON_PASSWORD")
3+
basic_auth_username = None
4+
basic_auth_password = None
75
provider = None
86

97
from .category import Category # noqa

heron/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from json.decoder import JSONDecodeError
23

34
import requests
@@ -36,8 +37,8 @@ def do_request(cls, method, path=None, json=None, retry=False, **params):
3637
headers={"Content-Type": "application/json"},
3738
json=json,
3839
auth=requests.auth.HTTPBasicAuth(
39-
basic_auth_username or "",
40-
basic_auth_password or "",
40+
basic_auth_username or os.getenv("HERON_USERNAME", ""),
41+
basic_auth_password or os.getenv("HERON_PASSWORD", ""),
4142
),
4243
**kwargs,
4344
)

0 commit comments

Comments
 (0)