aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-04-13 17:57:58 -0700
committerBryan Newbold <bnewbold@archive.org>2021-04-13 17:58:00 -0700
commit79b6476827f80ed86019804b7293ff1a8fd4af9a (patch)
tree25b9d90c7e2f507cb59f180efefdaff5c8e68254
parent4949511ccaffdc270f1c6306e3df5d356e9edbe0 (diff)
downloadfuzzycat-79b6476827f80ed86019804b7293ff1a8fd4af9a.tar.gz
fuzzycat-79b6476827f80ed86019804b7293ff1a8fd4af9a.zip
dynaconf: switch to fuzzycat.config import across project
This is the recommended way to use dynaconf.
-rw-r--r--fuzzycat/config.py4
-rw-r--r--fuzzycat/matching.py2
-rw-r--r--tests/test_matching.py3
3 files changed, 6 insertions, 3 deletions
diff --git a/fuzzycat/config.py b/fuzzycat/config.py
new file mode 100644
index 0000000..61050d1
--- /dev/null
+++ b/fuzzycat/config.py
@@ -0,0 +1,4 @@
+
+from dynaconf import Dynaconf
+
+settings = Dynaconf(envvar_prefix="FUZZYCAT")
diff --git a/fuzzycat/matching.py b/fuzzycat/matching.py
index 9ccb62b..55a5833 100644
--- a/fuzzycat/matching.py
+++ b/fuzzycat/matching.py
@@ -13,8 +13,8 @@ from fatcat_openapi_client.rest import ApiException
from fuzzycat.entities import entity_from_dict, entity_from_json
from fuzzycat.utils import es_compat_hits_total
+from fuzzycat.config import settings
-settings = Dynaconf(envvar_prefix="FUZZYCAT")
FATCAT_API_URL = settings.get("FATCAT_API_URL", "https://api.fatcat.wiki/v0")
diff --git a/tests/test_matching.py b/tests/test_matching.py
index 7d8b7af..56999e6 100644
--- a/tests/test_matching.py
+++ b/tests/test_matching.py
@@ -1,14 +1,13 @@
from fuzzycat.matching import anything_to_entity, match_release_fuzzy
+from fuzzycat.config import settings
from fatcat_openapi_client import ReleaseEntity
import pytest
import elasticsearch
import logging
-from dynaconf import Dynaconf
logger = logging.getLogger('test_matching')
logger.setLevel(logging.DEBUG)
-settings = Dynaconf(envvar_prefix="FUZZYCAT")
FATCAT_SEARCH_URL = settings.get("FATCAT_SEARCH_URL", "https://search.fatcat.wiki:443")