diff options
-rw-r--r-- | .gitlab-ci.yml | 1 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | Pipfile | 2 | ||||
-rw-r--r-- | Pipfile.lock | 4 | ||||
-rw-r--r-- | fuzzycat/config.py | 4 | ||||
-rw-r--r-- | fuzzycat/matching.py | 2 | ||||
-rw-r--r-- | tests/test_matching.py | 9 |
7 files changed, 17 insertions, 9 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2cba3f..60b11b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,4 +14,3 @@ tests: - python3 --version && pipenv --version - make deps - make test - @@ -11,9 +11,7 @@ help: ## Print info about all commands .PHONY: deps deps: ## Install dependencies from setup.py into pipenv - # We need to use --pre, because e.g. black is considered a pre-release - # version, https://github.com/microsoft/vscode-python/issues/5171 - pipenv install --pre '-e .[dev]' + pipenv install --dev --deploy .PHONY: fmt fmt: ## Apply import sorting and yapf source formatting on all files @@ -32,4 +32,4 @@ regex = "*" zstandard = "*" [requires] -python_version = "3.7" +python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock index c6a6acb..8fd364d 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "7ec5c05a87af980633df5c5f2a36b29ec2e0aa031b278d9c241dcb675447f35f" + "sha256": "e0423004017b8118e93adf9af4ffd96faa8572db2c03578153adf9b6af4c8c8c" }, "pipfile-spec": 6, "requires": { - "python_version": "3.7" + "python_version": "3.8" }, "sources": [ { 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 1702792..997a9e6 100644 --- a/tests/test_matching.py +++ b/tests/test_matching.py @@ -1,3 +1,4 @@ +<<<<<<< HEAD import logging import warnings @@ -12,10 +13,16 @@ from fuzzycat.matching import anything_to_entity, match_release_fuzzy warnings.filterwarnings("ignore") # InsecureRequestWarning: Unverified HTTPS request is being made to host ... +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 + logger = logging.getLogger('test_matching') logger.setLevel(logging.DEBUG) -settings = Dynaconf(envvar_prefix="FUZZYCAT") # ad-hoc override search server with: FUZZYCAT_FATCAT_SEARCH_URL=localhost:9200 pytest ... FATCAT_SEARCH_URL = settings.get("FATCAT_SEARCH_URL", "https://search.fatcat.wiki:443") |