aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-04-15 15:57:24 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-04-15 15:57:24 +0200
commit1edd47ee8f43e8a8b84f0ce9ea2c92d998ae3efb (patch)
treeff6233a95a0e7c9f2d810e4735132eafb726f0fe
parentcd5aff2602b944c95d2ed76f9f916ef0427d0013 (diff)
parent79b6476827f80ed86019804b7293ff1a8fd4af9a (diff)
downloadfuzzycat-1edd47ee8f43e8a8b84f0ce9ea2c92d998ae3efb.tar.gz
fuzzycat-1edd47ee8f43e8a8b84f0ce9ea2c92d998ae3efb.zip
Merge branch 'bnewbold-dev-setup'
* bnewbold-dev-setup: dynaconf: switch to fuzzycat.config import across project upgrade to python3.8 gitlab CI: try 'make deps' and 'make test' makefile: run common commands inside pipenv makefile: change 'deps' to be simple --dev --deploy make fmt
-rw-r--r--.gitlab-ci.yml1
-rw-r--r--Makefile4
-rw-r--r--Pipfile2
-rw-r--r--Pipfile.lock4
-rw-r--r--fuzzycat/config.py4
-rw-r--r--fuzzycat/matching.py2
-rw-r--r--tests/test_matching.py9
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
-
diff --git a/Makefile b/Makefile
index 013b32c..0f4a054 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/Pipfile b/Pipfile
index 4cc4c45..4f69c9e 100644
--- a/Pipfile
+++ b/Pipfile
@@ -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")