From c634c4508fb0275a206fe2731fe4ea9e589b44cb Mon Sep 17 00:00:00 2001 From: KamenDimitrov97 Date: Mon, 19 Feb 2024 17:39:39 +0200 Subject: [PATCH 01/10] testing pipeline From d5836634e85840f4ca9fb854cb63ccd252d00ad1 Mon Sep 17 00:00:00 2001 From: KamenDimitrov97 Date: Wed, 21 Feb 2024 17:34:22 +0200 Subject: [PATCH 02/10] updated logger for consistency with category loggee --- app/logger.py | 66 +++++++++++++++++++++++++++++++++++---------- app/main.py | 13 ++------- app/views/berlin.py | 13 ++++----- gunicorn_config.py | 5 +--- 4 files changed, 60 insertions(+), 37 deletions(-) diff --git a/app/logger.py b/app/logger.py index 55af94a..965eb44 100644 --- a/app/logger.py +++ b/app/logger.py @@ -1,28 +1,66 @@ -from datetime import datetime - +import logging +import logging.config import structlog +import structlog._log_levels +from datetime import datetime from app.settings import settings +def add_severity_level(logger, method_name, event_dict): + if method_name == "info": + event_dict[0][0]["severity"] = 0 + elif method_name == "error": + event_dict[0][0]["severity"] = 1 + + return event_dict -def configure_logging(): + +def setup_logging(): + shared_processors = [] + processors = shared_processors + [ + structlog.stdlib.PositionalArgumentsFormatter(), + structlog.stdlib.ProcessorFormatter.wrap_for_formatter, + add_severity_level, + ] structlog.configure( - processors=[ - structlog.processors.TimeStamper(fmt="iso", utc=True), - structlog.processors.dict_tracebacks, - structlog.processors.JSONRenderer(), - ], - context_class=structlog.threadlocal.wrap_dict(dict), + cache_logger_on_first_use=True, + wrapper_class=structlog.make_filtering_bound_logger(logging.INFO), + processors=processors, + context_class=dict, logger_factory=structlog.stdlib.LoggerFactory(), ) + stdlib_config = { + "version": 1, + "disable_existing_loggers": False, + "formatters": { + "json": { + "()": structlog.stdlib.ProcessorFormatter, + "processor": structlog.processors.JSONRenderer(), + "foreign_pre_chain": shared_processors, + }, + }, + "handlers": { + "stream": { + "level": "DEBUG", + "formatter": "json", + "class": "logging.StreamHandler", + "stream": "ext://sys.stderr", + }, + }, + "loggers": { + "": { + "handlers": ["stream"], + "level": "DEBUG", + "propagate": True, + }, + }, + } + logging.config.dictConfig(stdlib_config) -def setup_logger(): return structlog.get_logger( namespace=settings.NAMESPACE, created_at=datetime.utcnow().isoformat(), + event="", + severity=0, # default ) - - -configure_logging() -logger = setup_logger() diff --git a/app/main.py b/app/main.py index 8d86514..504f997 100644 --- a/app/main.py +++ b/app/main.py @@ -3,21 +3,12 @@ from flask import Flask -from app.logger import logger +from app.logger import setup_logging from app.settings import get_custom_settings, settings from app.views.berlin import berlin_blueprint from app.views.health import health_blueprint -logging.basicConfig( - format="%(message)s", - stream=sys.stdout, - level=logging.INFO, -) - -logger.info( - "initial configuration", data=get_custom_settings(), level="INFO", severity=0 -) - +logger = setup_logging() def create_app(): application = Flask(__name__) diff --git a/app/views/berlin.py b/app/views/berlin.py index bcb1f35..cc77bf8 100644 --- a/app/views/berlin.py +++ b/app/views/berlin.py @@ -1,9 +1,10 @@ from flask import Blueprint, jsonify, request -from app.logger import logger +from app.logger import setup_logging from app.models import LocationModel from app.store import get_db +logger = setup_logging() db = get_db() berlin_blueprint = Blueprint("berlin", __name__) @@ -17,9 +18,7 @@ def berlin_code(key): except Exception as e: logger.error( event="error retrieving key from database ", - stack_trace=str(e), - level="ERROR", - severity=1, + error=str(e), ) return jsonify({"key": key, "error": "Not found"}), 404 @@ -37,7 +36,7 @@ def berlin_search(): try: log_message = f"Querying database with q={q}, state={state}, limit={limit}, lev_distance={lev_distance}" - logger.info(log_message, severity=0) + logger.info(log_message) result = db.query(q, state=state, limit=limit, lev_distance=lev_distance) @@ -51,9 +50,7 @@ def berlin_search(): except Exception as e: logger.error( event="error querying the database ", - stack_trace=str(e), - level="ERROR", - severity=1, + error=str(e), ) return ( jsonify({"error": "error querying the database"}), diff --git a/gunicorn_config.py b/gunicorn_config.py index 8a18ce5..2820650 100644 --- a/gunicorn_config.py +++ b/gunicorn_config.py @@ -39,10 +39,6 @@ def json_record( "method": record.args["m"], "path": url, "status": str(record.args["s"]), - "user_agent": record.args["a"], - "referer": record.args["f"], - "duration_in_ms": record.args["M"], - "pid": record.args["p"], }, severity=severity, ) @@ -66,6 +62,7 @@ def json_record( 0 if record.levelname == "INFO" else 1 if record.levelname == "ERROR" else 2 ) payload.pop("time", None) + payload.pop("taskName", None) payload.pop("message", None) return payload From 7641acf31f94d170f54e1752e1f894dad78964e6 Mon Sep 17 00:00:00 2001 From: Phil Weir Date: Thu, 22 Feb 2024 22:26:36 +0000 Subject: [PATCH 03/10] feat: add ability to return scores with matches --- Makefile | 2 +- README.md | 38 ++++++++++++++++++++++++++++++++++++++ app/models.py | 18 ++++++++++++++++++ app/views/berlin.py | 20 ++++++++++++++++---- pyproject.toml | 2 +- tests/api/server_test.py | 26 ++++++++++++++++++++++++++ 6 files changed, 100 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index be9f4c1..9f64392 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ run: deps ## Start the api locally on port 28900. @FLASK_APP=${FLASK_APP} poetry run gunicorn "app.main:create_app()" -b 0.0.0.0:${BERLIN_API_PORT} -c gunicorn_config.py run-container: build ## Runs a container from the pre-build image - docker run -p 28900:28900 --env BERLIN_API_BUILD_TIME='${BERLIN_API_BUILD_TIME}' -e BERLIN_API_BUILD_TIME="${BERLIN_API_BUILD_TIME}" -e BERLIN_API_VERSION="${BERLIN_API_VERSION}" -ti berlin_api + docker run -m 0.4g -p 28900:28900 --env BERLIN_API_BUILD_TIME='${BERLIN_API_BUILD_TIME}' -e BERLIN_API_BUILD_TIME="${BERLIN_API_BUILD_TIME}" -e BERLIN_API_VERSION="${BERLIN_API_VERSION}" -ti berlin_api test: deps ## runs all tests poetry run pytest -v tests/ diff --git a/README.md b/README.md index 89fbdca..383d759 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,44 @@ This will return results of the form: } ``` +By supplying an additional parameter, `with_score=1`, the structure will change: + +```json +{ + "matches": [ + { + "loc": { + "encoding": "UN-LOCODE", + "id": "ca:lod", + "key": "UN-LOCODE-ca:lod", + "words": [ + "london" + ] + }, + "match": { + "score": 1008, + "offset": [17, 22] + } + }, + { + "loc": { + "encoding": "UN-LOCODE", + "id": "us:ldn", + "key": "UN-LOCODE-us:ldn", + "words": [ + "london" + ] + }, + "match": { + "score": 1008, + "offset": [17, 22] + } + } + ... + ] +} +``` + ## Description diff --git a/app/models.py b/app/models.py index 7ce257e..6623055 100644 --- a/app/models.py +++ b/app/models.py @@ -4,6 +4,24 @@ from berlin import Location +@dataclass +class MatchModel: + score: int | None + offset: list[int] | None + + @classmethod + def from_location(cls, loc: Location) -> "MatchModel": + try: + return cls( + score=loc.get_score(), + offset=loc.get_offset() + ) + except AttributeError: + ... + + def to_json(self): + return asdict(self) + @dataclass class LocationModel: id: str diff --git a/app/views/berlin.py b/app/views/berlin.py index cc77bf8..04f9386 100644 --- a/app/views/berlin.py +++ b/app/views/berlin.py @@ -1,7 +1,7 @@ from flask import Blueprint, jsonify, request from app.logger import setup_logging -from app.models import LocationModel +from app.models import LocationModel, MatchModel from app.store import get_db logger = setup_logging() @@ -33,6 +33,7 @@ def berlin_search(): state = request.args.get("state") or "gb" limit = request.args.get("limit", type=int) or 10 lev_distance = request.args.get("lev_distance", type=int) or 2 + with_scores = request.args.get("with_scores", type=bool) or False try: log_message = f"Querying database with q={q}, state={state}, limit={limit}, lev_distance={lev_distance}" @@ -40,10 +41,21 @@ def berlin_search(): result = db.query(q, state=state, limit=limit, lev_distance=lev_distance) - locations = { - "matches": [ - LocationModel.from_location(loc, db).to_json() for loc in result + if with_scores: + matches = [ + { + "loc": LocationModel.from_location(loc, db).to_json(), + "match": MatchModel.from_location(loc).to_json() + } for loc in result + ] + else: + matches = [ + LocationModel.from_location(loc, db).to_json() + for loc in result ] + + locations = { + "matches": matches } return jsonify(locations), 200 diff --git a/pyproject.toml b/pyproject.toml index fa5bd87..5f61e45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,7 +62,7 @@ Flask = "^2.0.2" structlog = "^23.3.0" python-dateutil = "^2.8.2" requests = "^2.30.0" -berlin = ">=0.3.10,<0.4" +berlin = ">=0.3.11,<0.4" ruff = "^0.0.265" safety = "^2.3.5" dynaconf = "^3.1.12" diff --git a/tests/api/server_test.py b/tests/api/server_test.py index 1430575..483f196 100644 --- a/tests/api/server_test.py +++ b/tests/api/server_test.py @@ -23,6 +23,32 @@ def test_code_with_berlin(test_client_with_berlin): print(response.json) +def test_search_with_scores_with_berlin(test_client_with_berlin): + response = test_client_with_berlin.get( + "/berlin/search?q=Dentists+in+Lyuliakovo&state=BG&limit=2&with_scores=1" + ) + assert response.status_code == 200 + assert isinstance(response.json, dict) + assert response.json == { + "matches": [{ + "loc": { + "encoding": "UN-LOCODE", + "id": "bg:blo", + "key": "UN-LOCODE-bg:blo", + "names": ["lyuliakovo"], + "words": ["lyuliakovo"], + "codes": ["blo"], + "state": ["bg", "ISO-3166-1-bg"], + "subdiv": ["02", "ISO-3166-2-bg:02"], + }, + "match": { + "offset": [12, 22], + "score": 1010 + } + }] + } + print(response.json) + def test_search_with_state_with_berlin(test_client_with_berlin): response = test_client_with_berlin.get( "/berlin/search?q=Lyuliakovo&state=BG&limit=2" From 72b71e9f530fc398ea6dde525a1b8468a60a566e Mon Sep 17 00:00:00 2001 From: Phil Weir Date: Thu, 22 Feb 2024 23:21:35 +0000 Subject: [PATCH 04/10] fix: pull in latest berlin version --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5f61e45..3752824 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ "gunicorn", "structlog>=21.5.0,<21.6", "python-dateutil>=2.8.2,<2.9", - "berlin>=0.3.10,<4", + "berlin>=0.3.12,<4", ] [project.optional-dependencies] @@ -62,7 +62,7 @@ Flask = "^2.0.2" structlog = "^23.3.0" python-dateutil = "^2.8.2" requests = "^2.30.0" -berlin = ">=0.3.11,<0.4" +berlin = ">=0.3.12,<0.4" ruff = "^0.0.265" safety = "^2.3.5" dynaconf = "^3.1.12" From b93e09c9b6901ef5395cc951ca94f1dcfc4149cc Mon Sep 17 00:00:00 2001 From: Phil Weir Date: Thu, 22 Feb 2024 23:24:00 +0000 Subject: [PATCH 05/10] fix: update lockfile --- poetry.lock | 297 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 180 insertions(+), 117 deletions(-) diff --git a/poetry.lock b/poetry.lock index 9960b6f..2de4ded 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,9 +1,10 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand. [[package]] name = "astroid" version = "2.15.8" description = "An abstract syntax tree for Python with inference support." +category = "dev" optional = false python-versions = ">=3.7.2" files = [ @@ -23,6 +24,7 @@ wrapt = [ name = "atomicwrites" version = "1.4.1" description = "Atomic file writes." +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -33,6 +35,7 @@ files = [ name = "attrs" version = "23.2.0" description = "Classes Without Boilerplate" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -50,75 +53,79 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p [[package]] name = "berlin" -version = "0.3.10" +version = "0.3.12" description = "Identify locations and tag them with UN-LOCODEs and ISO-3166-2 subdivisions." +category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "berlin-0.3.10-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:cb1bc3183718c3cfbe6e3bd4e0cac6c4877e59e9bf8b0e27b502cdf21e19cb02"}, - {file = "berlin-0.3.10-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d2c2750697daf5546e29c7521144cd45a3373085b1f5fc7a93a6de848f96acfb"}, - {file = "berlin-0.3.10-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:9e8a8948260ce68f407332657106f8a31de79dbbb16437e1e36508a742b09a1b"}, - {file = "berlin-0.3.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:12fcfa35d548eb099cf4a764ce9ff9244402c2d090ce7453796d7f544ef751db"}, - {file = "berlin-0.3.10-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:dbac76e8de4644ddd314d2583bdf63cd817389cdcdcf941f21b8c5d0b3807e0a"}, - {file = "berlin-0.3.10-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:17fd4084100a78e5865a48eef1c2e13c7dff22be6f6521eca40b670671bd391b"}, - {file = "berlin-0.3.10-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8561e7923132940fbff02daa753bde961d6a559fdc5108fcbf5b30ee4854b986"}, - {file = "berlin-0.3.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ab823ba412cfad9e09c66de7140a251d4e44829ce9a9b79c6d4fda3e52b087b5"}, - {file = "berlin-0.3.10-cp310-none-win32.whl", hash = "sha256:27d291e521659127d6c69f29d89985b30e4c8b1d580657cd0d76babf405192b9"}, - {file = "berlin-0.3.10-cp310-none-win_amd64.whl", hash = "sha256:8da573cb6a3551f2b77dde85832cc2802db5758c1c23d7a91c6a1e5b7748c982"}, - {file = "berlin-0.3.10-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:0f4b3773ad063ec26173dfbe76b622d6d14b203fc80c1427315b30ace5fa91fd"}, - {file = "berlin-0.3.10-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ceeb841b269dbb102cf7f10e645a4cdf97bf92aac587d53d2402c70fc74418f0"}, - {file = "berlin-0.3.10-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:ebaf93df50bbd2b6720cdfe469b875d1efb058c3c8c72e71d49955bcb74958bb"}, - {file = "berlin-0.3.10-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:171e11bb975621927cce21e7456586e12aa4febfe4e98495cc87ca39721e0523"}, - {file = "berlin-0.3.10-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:950169857a9c23c25dab59546ad9620489ef3700c4acf120f858e7f7324deae3"}, - {file = "berlin-0.3.10-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e0ba9ffb34a535bd1ab66e077fec97868b0eda7a2a64ecb21c5e822e8c2849d8"}, - {file = "berlin-0.3.10-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:73faeab9c3185f604c5c9786e5eb77472693919b1905285b19fece5c0182f822"}, - {file = "berlin-0.3.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cab2d58f491aa0a40099a21ea37e77181780af7e9d29d990ef500b786d198363"}, - {file = "berlin-0.3.10-cp311-none-win32.whl", hash = "sha256:d5dd183f19f85bc0912ecc343057201b7d75fe81fb8c37510edcf24ed815cc78"}, - {file = "berlin-0.3.10-cp311-none-win_amd64.whl", hash = "sha256:3025089262adbb7b8379534711ae65f3d2536d7d1eea074444b2f3a7c3a44d3b"}, - {file = "berlin-0.3.10-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:e056a4b710aff7f135964a01ecaee7547c9b68737fa4ed7a48d600b8dcbf6f70"}, - {file = "berlin-0.3.10-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:747aa2bb4660210b16f7efd7d636b1545e2f6cdc5237de221d8977876b654518"}, - {file = "berlin-0.3.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8339280dffd93682fc143fa52d0c5f72ceb9b20e01f264af25d5495609edd0cb"}, - {file = "berlin-0.3.10-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fedec123b2f6ef4824250153c43f9088c21891ee2f24063f5b3224c37830a878"}, - {file = "berlin-0.3.10-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ff42734e888d50845ac28d85094516dd804176605aba8dc3187d493eca795c28"}, - {file = "berlin-0.3.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c33bac7d4b9b746fe241534e336755a70956bc3ee49a63ad501a07082ff95510"}, - {file = "berlin-0.3.10-cp312-none-win_amd64.whl", hash = "sha256:18bca13391e45aa1772bca3683fd10fa2f553b6ba80b0193189c68cb96dbda36"}, - {file = "berlin-0.3.10-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:57950b2d9a397e78dd70b98f302d501d418a797439e873fc65771c878ec0c7db"}, - {file = "berlin-0.3.10-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:60b53a8387b3c5b4347b1a9fe09429034c9fbc6e7cd6b92311d80dd785731075"}, - {file = "berlin-0.3.10-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2afb2f410181a9da1f6797a6450fcf7432582b1479b2b3c7257b5ccb80bf9fe7"}, - {file = "berlin-0.3.10-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1062db9333834c95224f6e369e761c6fc84fcce1470fe61490ac1a945d067f7f"}, - {file = "berlin-0.3.10-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:54f7c558ff9bf6bff160ca9da5a507713aa1b03c86250f93fce98311f5d13af5"}, - {file = "berlin-0.3.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bdbb7952ec26b29f76db1c2e49358be7783e7a763762e8be6d951f85a4fa72fc"}, - {file = "berlin-0.3.10-cp38-none-win32.whl", hash = "sha256:03f7187acffcbb9ff86fbe940a2ca640cff68a1233937a5b80a70a91a89c844d"}, - {file = "berlin-0.3.10-cp38-none-win_amd64.whl", hash = "sha256:3034d2b2926fdeb468e8ae419fd4074fa21e6d3a95fe9177dac3c592d6b54b90"}, - {file = "berlin-0.3.10-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:45aca0cf2405c726b47d023b2cb3c3a6707a2a2d240ae90d1a2a91595c83c680"}, - {file = "berlin-0.3.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4669e0f64e056a7d1d0c828359c2af146e6a7974a290b4ec4666fd1c561d1942"}, - {file = "berlin-0.3.10-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f98d343812d8a4c88f3f908f2469e6fe21b7b74ea4cb04e6b725c2ef91400c0d"}, - {file = "berlin-0.3.10-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:45bc99bc41293b81094615b60124f1cce2bac8ad474891ac895868aa433306cc"}, - {file = "berlin-0.3.10-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:826ba0c7bdc7ed4e469f06d448ea3832bfb06ddee19001c1251e1d9288d3940c"}, - {file = "berlin-0.3.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:134404fa68119473a1783d9e902d478cce530859cb0a2931fbc2bc5280a661ad"}, - {file = "berlin-0.3.10-cp39-none-win32.whl", hash = "sha256:98344b50ebab014ec8c08cfe4115c724c16c8d53329a56406eb1ad45f2f17f20"}, - {file = "berlin-0.3.10-cp39-none-win_amd64.whl", hash = "sha256:361559e9a12195261d3969d4881feafe2070f7c1c810a3cf4d6e0da7acd3c48f"}, - {file = "berlin-0.3.10-pp310-pypy310_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:cf837e85cca95a44c60642ab6faa6f4ef9ee1e5b6122084e16bc709cb55ecd1c"}, - {file = "berlin-0.3.10-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e4444836bf44d8da49f184c93c54eb19be356321873832f05fafc9ced96a39e"}, - {file = "berlin-0.3.10-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:222413813303a6c0953d09ce4be845c1f8e83e8d55e87cc152d5d31cf797620f"}, - {file = "berlin-0.3.10-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d5d0983c0f9250c2b0d170c13726439ef8f0c3e5f7dc79366dc45cf37f7473e3"}, - {file = "berlin-0.3.10-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:82c14ee1676baf24ff852441b8757e8352d407bcfc930b49106e714d0d3d16a6"}, - {file = "berlin-0.3.10-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0e70e6f20683ece2c3b4cb575d7b6f17bf2107e93998c82aa0cdda94fe31e361"}, - {file = "berlin-0.3.10-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ebd4c71f5e011f0044076fc2724f56d6e2d3040c793b8c38372cd81c288aa950"}, - {file = "berlin-0.3.10-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:166377b61c685fc86a14fb25f5c92a13e93ab79d33b5c2f398392cefffd951c2"}, - {file = "berlin-0.3.10-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:23e13bfe4fc7985bb1e08e634ceb52b64deaf7b76f363dc5d727f76095111a91"}, - {file = "berlin-0.3.10-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:272b13ae4c35be1a46b169b2266bedec411fe7b1a450d90199427e402f82af25"}, - {file = "berlin-0.3.10-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:31e2a725344f615b9a3f4266b12e9e5d7c1c3c560ea8a69328d49e02910785d0"}, - {file = "berlin-0.3.10-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6bafcfe48b9fa598479eec4e07f1cdae53a7617268f93d1f28118bcbc96980d4"}, - {file = "berlin-0.3.10-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4d023d14786686f78953312cc3675d544a4225ce80ae3bbb290579b2e8e43f4d"}, - {file = "berlin-0.3.10-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d235c930355ec1e319c6f01b5340e2df681553f256fab28378a770e2d08af6fa"}, - {file = "berlin-0.3.10.tar.gz", hash = "sha256:0e6f5ce294d463c72c9b92b2eb9ed173d6cf4abb4e047c8ca2c20cc2eedd66cd"}, + {file = "berlin-0.3.12-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:a4038f31fb8d975ff769d6a1128b2f002f6b57b5a8fd28bd3c5d64129ab05211"}, + {file = "berlin-0.3.12-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8aa18ee05a5ca0b5333ea7159005da80b556e6be7b17e23b7e8a3c09e0aea71f"}, + {file = "berlin-0.3.12-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:7743571280d45096c80461b06c190ed36f4b4a6b3bb51830a9ba9db2b93ede4c"}, + {file = "berlin-0.3.12-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d4507e3fe304a6223d8eff754c2cec14e2975d3881a00a02e710d0b49a8be264"}, + {file = "berlin-0.3.12-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f3234c535880478f8d0cb06692f1c30381c92417576fa2abf1f7ad8e44506463"}, + {file = "berlin-0.3.12-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1b9e681213b50e8c4748f09c8f2d36e3c73727cd445b95b73eb3063530ddcca3"}, + {file = "berlin-0.3.12-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f0663bd7a140100a8a58860109935a877ae2b6c562270f3efde6468aa2732d"}, + {file = "berlin-0.3.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:647184c97878c76100a03d44867fdb4ccdadcb0bfb5d6d4cd8e9536420362517"}, + {file = "berlin-0.3.12-cp310-none-win32.whl", hash = "sha256:d8158e4231c525797d9b51a71fe716e41da90a791422036f64b259e78234a8b6"}, + {file = "berlin-0.3.12-cp310-none-win_amd64.whl", hash = "sha256:2fdceb19b1812f9288f94e198f96b066f42f11c6acf520e0b3c4386ec08c8001"}, + {file = "berlin-0.3.12-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:36964dc08ed67d4b663fc51c8ace802d218969de904c46281fc8d5cd0e175a59"}, + {file = "berlin-0.3.12-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9cf19b8254d6c35aa6386beff78ea56251e67648e6ec71d0dda323bd6c4cb13f"}, + {file = "berlin-0.3.12-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:71eca1d9116a86f1907ded01753d05e4fbcf10f3bd509d8739b9347981f4203c"}, + {file = "berlin-0.3.12-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ef2b5c9790a37e5013255e4d0241a9bcbf90c9c41087d4f244c5be5465a39e7"}, + {file = "berlin-0.3.12-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:45b85c4d421b7a8f99c2832877f8e294b2b72f2acbe0151bd3118d25b0ce4a10"}, + {file = "berlin-0.3.12-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:55ddd55c5b919ceda63b3c0791e496255c1a73a66b325c2539143515c1881bc5"}, + {file = "berlin-0.3.12-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b480a3b99df83958e1dad4301d6c0aac44c6fb5a126b3216a1a9220a96daa8a1"}, + {file = "berlin-0.3.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6a493f793cc420ea073615df206f143b3bd4fd19c3e6e4e198a293fef354c637"}, + {file = "berlin-0.3.12-cp311-none-win32.whl", hash = "sha256:5d1749fb210f44550b5cae5796d4e695ca100236689677481cb2db429d90d604"}, + {file = "berlin-0.3.12-cp311-none-win_amd64.whl", hash = "sha256:766d704563e440a240ca2e58e2580431295399d84fa620e8329a9423824b7357"}, + {file = "berlin-0.3.12-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9ce18dc37dfac90c86f28732d38ceb2bb0409ea84bb1570ac5d553ccc654737f"}, + {file = "berlin-0.3.12-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:26377d72d752f44f7683a945258eced10a10e70452d1a23de3221c40a598569d"}, + {file = "berlin-0.3.12-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:697ddf16e552901f84ecc2bc58077cca18b5137197f0a4b4caa36a6db0678545"}, + {file = "berlin-0.3.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c00653dea71f2f0c5556ab2f03ec871b72430c8ed1215c83b4315f9d4618bc70"}, + {file = "berlin-0.3.12-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:66fa0993dae33a9db41955131d3291c79103b3a6142f8d0420266581ece76a16"}, + {file = "berlin-0.3.12-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f8201a74320392f9375849e0e4b6e05cc99c5fd863b05ec68d6c8237055c059b"}, + {file = "berlin-0.3.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:538918b17388cb36c37aa67efe20d17bee5f51d20a89fbbb5b69cecc5eefc415"}, + {file = "berlin-0.3.12-cp312-none-win32.whl", hash = "sha256:5e44da4ba8302d71bf96147d72c400ad01c279fde430eba33f3212dc02afa7e9"}, + {file = "berlin-0.3.12-cp312-none-win_amd64.whl", hash = "sha256:8bd27ef93ea8f9ba14155674277e8f7e16eb8973093c2754fa379b2c64d759af"}, + {file = "berlin-0.3.12-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:ef5912548fe503808571351255727ae0f4aec6ea20dfa242fc227f611a0211a2"}, + {file = "berlin-0.3.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f67de26278fa4830af856cb69f93ad5d141321ef08a0701da0e8c2d693e95f9"}, + {file = "berlin-0.3.12-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9b766fe88268e1bdd0926e4835216f96281e611bb2ad00e09e3cb7d211276e70"}, + {file = "berlin-0.3.12-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3c5bb9fe917a1d321071a5cce1ea89c1a0e767c6deeded137bc70f58ddedccf"}, + {file = "berlin-0.3.12-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:36e3e3949e89257cd1a4e77b60559b73d41ebd5e8e5659400d270b61dc9a5442"}, + {file = "berlin-0.3.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2caf4584e001a44a0942605a88453187214a09e7f259025aae1655639e24652"}, + {file = "berlin-0.3.12-cp38-none-win32.whl", hash = "sha256:a838e2574273c92f19ebd3103d1f78f8b3b003055ab45592c2feb230818e39ef"}, + {file = "berlin-0.3.12-cp38-none-win_amd64.whl", hash = "sha256:070633a5fdcca34aead1d09369446943914bbfbcaa954c83bdc2e8a207c0fc11"}, + {file = "berlin-0.3.12-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:79b1066d8aa81edc207ebbea78b5b90ceaae20a6a0dc4657f9657e5d74cd346b"}, + {file = "berlin-0.3.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1472d6968974d08f29bb9bdf0f39c1dbc294be449aa5a00645e2e98b330b27dc"}, + {file = "berlin-0.3.12-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:13d5f2328006ee86727e02df6f929b7c234e5b5e9a2c28f6cf540dd09995e6c8"}, + {file = "berlin-0.3.12-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86e11bf18707cd119e62c24232adadc200aeb1a547f7396daeda15c1f0ea9d66"}, + {file = "berlin-0.3.12-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5bea1351fd9293e50834535f64c9240b54a61db585a82e435fdf31457402365a"}, + {file = "berlin-0.3.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8778b2458c8f9b5208a32ed0a3e8e5205daa2c1f1ec497edb8364861b91c1455"}, + {file = "berlin-0.3.12-cp39-none-win32.whl", hash = "sha256:f5d68fb704c6b5396ca995a4137595178fdc0ad34d1c1b0238d0f3769774b490"}, + {file = "berlin-0.3.12-cp39-none-win_amd64.whl", hash = "sha256:5d17eefe60d8bf54d3995548dad8fdf0ca2e10a67f5b8b44dca48721da019ed1"}, + {file = "berlin-0.3.12-pp310-pypy310_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:fd95ae8c2c16c86d064049701b71a6867390bdeccc084422d5d2e5a6bc62e20a"}, + {file = "berlin-0.3.12-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d6ee75483c31f97ee1c2fb9213cb143760a130c4406c08108f419d72f8721c2"}, + {file = "berlin-0.3.12-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:bee3a194950cc8a8ca816975e9720c94828266ed0a9620e5b53f04421e090d51"}, + {file = "berlin-0.3.12-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da71fae22c5d848c1750c53cd0e3003510e42fdf0a2633d728de2b380799f7bb"}, + {file = "berlin-0.3.12-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b7dc73caf3ce3635e08aedfddce4f54c5bbb02d14d6e740db47122bbd93f1df4"}, + {file = "berlin-0.3.12-pp38-pypy38_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a82f4a929c5cedb56e2dadbeec5702ac9f5796fb9257a1761872755e4c9750e5"}, + {file = "berlin-0.3.12-pp38-pypy38_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3298f0f7058c73c07049f1e4c1671fb88fab6fed1cfee835f2d66c1ce5bf4a6c"}, + {file = "berlin-0.3.12-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e30e139abf4f4eb521900c1107ae8aa482626319c616d967aee3e82fa0aa2a18"}, + {file = "berlin-0.3.12-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:250f0e6844d4af194593efff6e0db369828c5681fd88a2d9f27dffeb603d3a5e"}, + {file = "berlin-0.3.12-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b8a78e3937167f9e9e8e133c0e341dea127c2468ecc507fb9df01eeffbcbd4"}, + {file = "berlin-0.3.12-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a2d0b8747849a5957f3c659eca3d1a378bb96b7a553bef4bceec998bddd938b7"}, + {file = "berlin-0.3.12-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:87be2672031078ed6ab030ad10a133470c2d7cb83ca1d2c1a1741ba69c38075f"}, + {file = "berlin-0.3.12-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f47b6cee41ad20f1f7f8f2de7a6c6bfb85f96b0604a81e028d54d8fbc7a16778"}, + {file = "berlin-0.3.12-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6216cffc69cf95972c3301cb680805a73781c16252f5333a69ad066e744f1b68"}, + {file = "berlin-0.3.12.tar.gz", hash = "sha256:93143e36c7542fb1227d93a5130a1329876de7bbef631b0d1de9338509022e6e"}, ] [[package]] name = "black" version = "22.12.0" description = "The uncompromising code formatter." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -153,6 +160,7 @@ uvloop = ["uvloop (>=0.15.2)"] name = "blinker" version = "1.7.0" description = "Fast, simple object-to-object and broadcast signaling" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -164,6 +172,7 @@ files = [ name = "certifi" version = "2024.2.2" description = "Python package for providing Mozilla's CA Bundle." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -175,6 +184,7 @@ files = [ name = "charset-normalizer" version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -274,6 +284,7 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -288,6 +299,7 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." +category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -297,63 +309,64 @@ files = [ [[package]] name = "coverage" -version = "7.4.1" +version = "7.4.2" description = "Code coverage measurement for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "coverage-7.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:077d366e724f24fc02dbfe9d946534357fda71af9764ff99d73c3c596001bbd7"}, - {file = "coverage-7.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0193657651f5399d433c92f8ae264aff31fc1d066deee4b831549526433f3f61"}, - {file = "coverage-7.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d17bbc946f52ca67adf72a5ee783cd7cd3477f8f8796f59b4974a9b59cacc9ee"}, - {file = "coverage-7.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3277f5fa7483c927fe3a7b017b39351610265308f5267ac6d4c2b64cc1d8d25"}, - {file = "coverage-7.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6dceb61d40cbfcf45f51e59933c784a50846dc03211054bd76b421a713dcdf19"}, - {file = "coverage-7.4.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:6008adeca04a445ea6ef31b2cbaf1d01d02986047606f7da266629afee982630"}, - {file = "coverage-7.4.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:c61f66d93d712f6e03369b6a7769233bfda880b12f417eefdd4f16d1deb2fc4c"}, - {file = "coverage-7.4.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b9bb62fac84d5f2ff523304e59e5c439955fb3b7f44e3d7b2085184db74d733b"}, - {file = "coverage-7.4.1-cp310-cp310-win32.whl", hash = "sha256:f86f368e1c7ce897bf2457b9eb61169a44e2ef797099fb5728482b8d69f3f016"}, - {file = "coverage-7.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:869b5046d41abfea3e381dd143407b0d29b8282a904a19cb908fa24d090cc018"}, - {file = "coverage-7.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b8ffb498a83d7e0305968289441914154fb0ef5d8b3157df02a90c6695978295"}, - {file = "coverage-7.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3cacfaefe6089d477264001f90f55b7881ba615953414999c46cc9713ff93c8c"}, - {file = "coverage-7.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d6850e6e36e332d5511a48a251790ddc545e16e8beaf046c03985c69ccb2676"}, - {file = "coverage-7.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18e961aa13b6d47f758cc5879383d27b5b3f3dcd9ce8cdbfdc2571fe86feb4dd"}, - {file = "coverage-7.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dfd1e1b9f0898817babf840b77ce9fe655ecbe8b1b327983df485b30df8cc011"}, - {file = "coverage-7.4.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6b00e21f86598b6330f0019b40fb397e705135040dbedc2ca9a93c7441178e74"}, - {file = "coverage-7.4.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:536d609c6963c50055bab766d9951b6c394759190d03311f3e9fcf194ca909e1"}, - {file = "coverage-7.4.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7ac8f8eb153724f84885a1374999b7e45734bf93a87d8df1e7ce2146860edef6"}, - {file = "coverage-7.4.1-cp311-cp311-win32.whl", hash = "sha256:f3771b23bb3675a06f5d885c3630b1d01ea6cac9e84a01aaf5508706dba546c5"}, - {file = "coverage-7.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:9d2f9d4cc2a53b38cabc2d6d80f7f9b7e3da26b2f53d48f05876fef7956b6968"}, - {file = "coverage-7.4.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f68ef3660677e6624c8cace943e4765545f8191313a07288a53d3da188bd8581"}, - {file = "coverage-7.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:23b27b8a698e749b61809fb637eb98ebf0e505710ec46a8aa6f1be7dc0dc43a6"}, - {file = "coverage-7.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e3424c554391dc9ef4a92ad28665756566a28fecf47308f91841f6c49288e66"}, - {file = "coverage-7.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0860a348bf7004c812c8368d1fc7f77fe8e4c095d661a579196a9533778e156"}, - {file = "coverage-7.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe558371c1bdf3b8fa03e097c523fb9645b8730399c14fe7721ee9c9e2a545d3"}, - {file = "coverage-7.4.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3468cc8720402af37b6c6e7e2a9cdb9f6c16c728638a2ebc768ba1ef6f26c3a1"}, - {file = "coverage-7.4.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:02f2edb575d62172aa28fe00efe821ae31f25dc3d589055b3fb64d51e52e4ab1"}, - {file = "coverage-7.4.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ca6e61dc52f601d1d224526360cdeab0d0712ec104a2ce6cc5ccef6ed9a233bc"}, - {file = "coverage-7.4.1-cp312-cp312-win32.whl", hash = "sha256:ca7b26a5e456a843b9b6683eada193fc1f65c761b3a473941efe5a291f604c74"}, - {file = "coverage-7.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:85ccc5fa54c2ed64bd91ed3b4a627b9cce04646a659512a051fa82a92c04a448"}, - {file = "coverage-7.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8bdb0285a0202888d19ec6b6d23d5990410decb932b709f2b0dfe216d031d218"}, - {file = "coverage-7.4.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:918440dea04521f499721c039863ef95433314b1db00ff826a02580c1f503e45"}, - {file = "coverage-7.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:379d4c7abad5afbe9d88cc31ea8ca262296480a86af945b08214eb1a556a3e4d"}, - {file = "coverage-7.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b094116f0b6155e36a304ff912f89bbb5067157aff5f94060ff20bbabdc8da06"}, - {file = "coverage-7.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2f5968608b1fe2a1d00d01ad1017ee27efd99b3437e08b83ded9b7af3f6f766"}, - {file = "coverage-7.4.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:10e88e7f41e6197ea0429ae18f21ff521d4f4490aa33048f6c6f94c6045a6a75"}, - {file = "coverage-7.4.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a4a3907011d39dbc3e37bdc5df0a8c93853c369039b59efa33a7b6669de04c60"}, - {file = "coverage-7.4.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6d224f0c4c9c98290a6990259073f496fcec1b5cc613eecbd22786d398ded3ad"}, - {file = "coverage-7.4.1-cp38-cp38-win32.whl", hash = "sha256:23f5881362dcb0e1a92b84b3c2809bdc90db892332daab81ad8f642d8ed55042"}, - {file = "coverage-7.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:a07f61fc452c43cd5328b392e52555f7d1952400a1ad09086c4a8addccbd138d"}, - {file = "coverage-7.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8e738a492b6221f8dcf281b67129510835461132b03024830ac0e554311a5c54"}, - {file = "coverage-7.4.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:46342fed0fff72efcda77040b14728049200cbba1279e0bf1188f1f2078c1d70"}, - {file = "coverage-7.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9641e21670c68c7e57d2053ddf6c443e4f0a6e18e547e86af3fad0795414a628"}, - {file = "coverage-7.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aeb2c2688ed93b027eb0d26aa188ada34acb22dceea256d76390eea135083950"}, - {file = "coverage-7.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d12c923757de24e4e2110cf8832d83a886a4cf215c6e61ed506006872b43a6d1"}, - {file = "coverage-7.4.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0491275c3b9971cdbd28a4595c2cb5838f08036bca31765bad5e17edf900b2c7"}, - {file = "coverage-7.4.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:8dfc5e195bbef80aabd81596ef52a1277ee7143fe419efc3c4d8ba2754671756"}, - {file = "coverage-7.4.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1a78b656a4d12b0490ca72651fe4d9f5e07e3c6461063a9b6265ee45eb2bdd35"}, - {file = "coverage-7.4.1-cp39-cp39-win32.whl", hash = "sha256:f90515974b39f4dea2f27c0959688621b46d96d5a626cf9c53dbc653a895c05c"}, - {file = "coverage-7.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:64e723ca82a84053dd7bfcc986bdb34af8d9da83c521c19d6b472bc6880e191a"}, - {file = "coverage-7.4.1-pp38.pp39.pp310-none-any.whl", hash = "sha256:32a8d985462e37cfdab611a6f95b09d7c091d07668fdc26e47a725ee575fe166"}, - {file = "coverage-7.4.1.tar.gz", hash = "sha256:1ed4b95480952b1a26d863e546fa5094564aa0065e1e5f0d4d0041f293251d04"}, + {file = "coverage-7.4.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bf54c3e089179d9d23900e3efc86d46e4431188d9a657f345410eecdd0151f50"}, + {file = "coverage-7.4.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fe6e43c8b510719b48af7db9631b5fbac910ade4bd90e6378c85ac5ac706382c"}, + {file = "coverage-7.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b98c89db1b150d851a7840142d60d01d07677a18f0f46836e691c38134ed18b"}, + {file = "coverage-7.4.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5f9683be6a5b19cd776ee4e2f2ffb411424819c69afab6b2db3a0a364ec6642"}, + {file = "coverage-7.4.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78cdcbf7b9cb83fe047ee09298e25b1cd1636824067166dc97ad0543b079d22f"}, + {file = "coverage-7.4.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:2599972b21911111114100d362aea9e70a88b258400672626efa2b9e2179609c"}, + {file = "coverage-7.4.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ef00d31b7569ed3cb2036f26565f1984b9fc08541731ce01012b02a4c238bf03"}, + {file = "coverage-7.4.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:20a875bfd8c282985c4720c32aa05056f77a68e6d8bbc5fe8632c5860ee0b49b"}, + {file = "coverage-7.4.2-cp310-cp310-win32.whl", hash = "sha256:b3f2b1eb229f23c82898eedfc3296137cf1f16bb145ceab3edfd17cbde273fb7"}, + {file = "coverage-7.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:7df95fdd1432a5d2675ce630fef5f239939e2b3610fe2f2b5bf21fa505256fa3"}, + {file = "coverage-7.4.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a8ddbd158e069dded57738ea69b9744525181e99974c899b39f75b2b29a624e2"}, + {file = "coverage-7.4.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:81a5fb41b0d24447a47543b749adc34d45a2cf77b48ca74e5bf3de60a7bd9edc"}, + {file = "coverage-7.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2412e98e70f16243be41d20836abd5f3f32edef07cbf8f407f1b6e1ceae783ac"}, + {file = "coverage-7.4.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ddb79414c15c6f03f56cc68fa06994f047cf20207c31b5dad3f6bab54a0f66ef"}, + {file = "coverage-7.4.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cf89ab85027427d351f1de918aff4b43f4eb5f33aff6835ed30322a86ac29c9e"}, + {file = "coverage-7.4.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a178b7b1ac0f1530bb28d2e51f88c0bab3e5949835851a60dda80bff6052510c"}, + {file = "coverage-7.4.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:06fe398145a2e91edaf1ab4eee66149c6776c6b25b136f4a86fcbbb09512fd10"}, + {file = "coverage-7.4.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:18cac867950943fe93d6cd56a67eb7dcd2d4a781a40f4c1e25d6f1ed98721a55"}, + {file = "coverage-7.4.2-cp311-cp311-win32.whl", hash = "sha256:f72cdd2586f9a769570d4b5714a3837b3a59a53b096bb954f1811f6a0afad305"}, + {file = "coverage-7.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:d779a48fac416387dd5673fc5b2d6bd903ed903faaa3247dc1865c65eaa5a93e"}, + {file = "coverage-7.4.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:adbdfcda2469d188d79771d5696dc54fab98a16d2ef7e0875013b5f56a251047"}, + {file = "coverage-7.4.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ac4bab32f396b03ebecfcf2971668da9275b3bb5f81b3b6ba96622f4ef3f6e17"}, + {file = "coverage-7.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:006d220ba2e1a45f1de083d5022d4955abb0aedd78904cd5a779b955b019ec73"}, + {file = "coverage-7.4.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3733545eb294e5ad274abe131d1e7e7de4ba17a144505c12feca48803fea5f64"}, + {file = "coverage-7.4.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42a9e754aa250fe61f0f99986399cec086d7e7a01dd82fd863a20af34cbce962"}, + {file = "coverage-7.4.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:2ed37e16cf35c8d6e0b430254574b8edd242a367a1b1531bd1adc99c6a5e00fe"}, + {file = "coverage-7.4.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:b953275d4edfab6cc0ed7139fa773dfb89e81fee1569a932f6020ce7c6da0e8f"}, + {file = "coverage-7.4.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:32b4ab7e6c924f945cbae5392832e93e4ceb81483fd6dc4aa8fb1a97b9d3e0e1"}, + {file = "coverage-7.4.2-cp312-cp312-win32.whl", hash = "sha256:f5df76c58977bc35a49515b2fbba84a1d952ff0ec784a4070334dfbec28a2def"}, + {file = "coverage-7.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:34423abbaad70fea9d0164add189eabaea679068ebdf693baa5c02d03e7db244"}, + {file = "coverage-7.4.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5b11f9c6587668e495cc7365f85c93bed34c3a81f9f08b0920b87a89acc13469"}, + {file = "coverage-7.4.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:51593a1f05c39332f623d64d910445fdec3d2ac2d96b37ce7f331882d5678ddf"}, + {file = "coverage-7.4.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69f1665165ba2fe7614e2f0c1aed71e14d83510bf67e2ee13df467d1c08bf1e8"}, + {file = "coverage-7.4.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3c8bbb95a699c80a167478478efe5e09ad31680931ec280bf2087905e3b95ec"}, + {file = "coverage-7.4.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:175f56572f25e1e1201d2b3e07b71ca4d201bf0b9cb8fad3f1dfae6a4188de86"}, + {file = "coverage-7.4.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:8562ca91e8c40864942615b1d0b12289d3e745e6b2da901d133f52f2d510a1e3"}, + {file = "coverage-7.4.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:d9a1ef0f173e1a19738f154fb3644f90d0ada56fe6c9b422f992b04266c55d5a"}, + {file = "coverage-7.4.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:f40ac873045db4fd98a6f40387d242bde2708a3f8167bd967ccd43ad46394ba2"}, + {file = "coverage-7.4.2-cp38-cp38-win32.whl", hash = "sha256:d1b750a8409bec61caa7824bfd64a8074b6d2d420433f64c161a8335796c7c6b"}, + {file = "coverage-7.4.2-cp38-cp38-win_amd64.whl", hash = "sha256:b4ae777bebaed89e3a7e80c4a03fac434a98a8abb5251b2a957d38fe3fd30088"}, + {file = "coverage-7.4.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3ff7f92ae5a456101ca8f48387fd3c56eb96353588e686286f50633a611afc95"}, + {file = "coverage-7.4.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:861d75402269ffda0b33af94694b8e0703563116b04c681b1832903fac8fd647"}, + {file = "coverage-7.4.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3507427d83fa961cbd73f11140f4a5ce84208d31756f7238d6257b2d3d868405"}, + {file = "coverage-7.4.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bf711d517e21fb5bc429f5c4308fbc430a8585ff2a43e88540264ae87871e36a"}, + {file = "coverage-7.4.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c00e54f0bd258ab25e7f731ca1d5144b0bf7bec0051abccd2bdcff65fa3262c9"}, + {file = "coverage-7.4.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f8e845d894e39fb53834da826078f6dc1a933b32b1478cf437007367efaf6f6a"}, + {file = "coverage-7.4.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:840456cb1067dc350af9080298c7c2cfdddcedc1cb1e0b30dceecdaf7be1a2d3"}, + {file = "coverage-7.4.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c11ca2df2206a4e3e4c4567f52594637392ed05d7c7fb73b4ea1c658ba560265"}, + {file = "coverage-7.4.2-cp39-cp39-win32.whl", hash = "sha256:3ff5bdb08d8938d336ce4088ca1a1e4b6c8cd3bef8bb3a4c0eb2f37406e49643"}, + {file = "coverage-7.4.2-cp39-cp39-win_amd64.whl", hash = "sha256:ac9e95cefcf044c98d4e2c829cd0669918585755dd9a92e28a1a7012322d0a95"}, + {file = "coverage-7.4.2-pp38.pp39.pp310-none-any.whl", hash = "sha256:f593a4a90118d99014517c2679e04a4ef5aee2d81aa05c26c734d271065efcb6"}, + {file = "coverage-7.4.2.tar.gz", hash = "sha256:1a5ee18e3a8d766075ce9314ed1cb695414bae67df6a4b0805f5137d93d6f1cb"}, ] [package.dependencies] @@ -366,6 +379,7 @@ toml = ["tomli"] name = "dill" version = "0.3.8" description = "serialize all of Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -381,6 +395,7 @@ profile = ["gprof2dot (>=2022.7.29)"] name = "dparse" version = "0.6.3" description = "A parser for Python dependency files" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -400,6 +415,7 @@ pipenv = ["pipenv (<=2022.12.19)"] name = "dynaconf" version = "3.2.4" description = "The dynamic configurator for your Python Project" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -421,6 +437,7 @@ yaml = ["ruamel.yaml"] name = "execnet" version = "2.0.2" description = "execnet: rapid multi-Python deployment" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -435,6 +452,7 @@ testing = ["hatch", "pre-commit", "pytest", "tox"] name = "flake8" version = "4.0.1" description = "the modular source code checker: pep8 pyflakes and co" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -451,6 +469,7 @@ pyflakes = ">=2.4.0,<2.5.0" name = "flask" version = "2.3.3" description = "A simple framework for building complex web applications." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -473,6 +492,7 @@ dotenv = ["python-dotenv"] name = "gunicorn" version = "21.2.0" description = "WSGI HTTP Server for UNIX" +category = "main" optional = false python-versions = ">=3.5" files = [ @@ -493,6 +513,7 @@ tornado = ["tornado (>=0.2)"] name = "idna" version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" optional = false python-versions = ">=3.5" files = [ @@ -504,6 +525,7 @@ files = [ name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -515,6 +537,7 @@ files = [ name = "isort" version = "5.13.2" description = "A Python utility / library to sort Python imports." +category = "dev" optional = false python-versions = ">=3.8.0" files = [ @@ -529,6 +552,7 @@ colors = ["colorama (>=0.4.6)"] name = "itsdangerous" version = "2.1.2" description = "Safely pass data to untrusted environments and back." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -540,6 +564,7 @@ files = [ name = "jinja2" version = "3.1.3" description = "A very fast and expressive template engine." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -557,6 +582,7 @@ i18n = ["Babel (>=2.7)"] name = "json-log-formatter" version = "0.5.2" description = "JSON log formatter" +category = "main" optional = false python-versions = ">=2.7" files = [ @@ -567,6 +593,7 @@ files = [ name = "lazy-object-proxy" version = "1.10.0" description = "A fast and thorough lazy object proxy." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -613,6 +640,7 @@ files = [ name = "markupsafe" version = "2.1.5" description = "Safely add untrusted strings to HTML/XML markup." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -682,6 +710,7 @@ files = [ name = "mccabe" version = "0.6.1" description = "McCabe checker, plugin for flake8" +category = "dev" optional = false python-versions = "*" files = [ @@ -693,6 +722,7 @@ files = [ name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." +category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -704,6 +734,7 @@ files = [ name = "packaging" version = "21.3" description = "Core utilities for Python packages" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -718,6 +749,7 @@ pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" name = "pathspec" version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -729,6 +761,7 @@ files = [ name = "pip" version = "23.3.2" description = "The PyPA recommended tool for installing Python packages." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -740,6 +773,7 @@ files = [ name = "platformdirs" version = "4.2.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -755,6 +789,7 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest- name = "pluggy" version = "1.4.0" description = "plugin and hook calling mechanisms for python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -770,6 +805,7 @@ testing = ["pytest", "pytest-benchmark"] name = "py" version = "1.11.0" description = "library with cross-python path, ini-parsing, io, code, log facilities" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -781,6 +817,7 @@ files = [ name = "pycodestyle" version = "2.8.0" description = "Python style guide checker" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -792,6 +829,7 @@ files = [ name = "pyflakes" version = "2.4.0" description = "passive checker of Python programs" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -803,6 +841,7 @@ files = [ name = "pylint" version = "2.17.7" description = "python code static checker" +category = "dev" optional = false python-versions = ">=3.7.2" files = [ @@ -831,6 +870,7 @@ testutils = ["gitpython (>3)"] name = "pylint-quotes" version = "0.2.3" description = "Quote consistency checker for PyLint.." +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -845,6 +885,7 @@ pylint = ">=2.8.0" name = "pyparsing" version = "3.1.1" description = "pyparsing module - Classes and methods to define and execute parsing grammars" +category = "main" optional = false python-versions = ">=3.6.8" files = [ @@ -859,6 +900,7 @@ diagrams = ["jinja2", "railroad-diagrams"] name = "pytest" version = "6.2.5" description = "pytest: simple powerful testing with Python" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -883,6 +925,7 @@ testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xm name = "pytest-cov" version = "3.0.0" description = "Pytest plugin for measuring coverage." +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -901,6 +944,7 @@ testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtuale name = "pytest-forked" version = "1.6.0" description = "run tests in isolated forked subprocesses" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -916,6 +960,7 @@ pytest = ">=3.10" name = "pytest-sugar" version = "0.9.7" description = "pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly)." +category = "dev" optional = false python-versions = "*" files = [ @@ -935,6 +980,7 @@ dev = ["black", "flake8", "pre-commit"] name = "pytest-xdist" version = "2.5.0" description = "pytest xdist plugin for distributed testing and loop-on-failing modes" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -956,6 +1002,7 @@ testing = ["filelock"] name = "python-dateutil" version = "2.8.2" description = "Extensions to the standard Python datetime module" +category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ @@ -970,6 +1017,7 @@ six = ">=1.5" name = "requests" version = "2.31.0" description = "Python HTTP for Humans." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -991,6 +1039,7 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "ruamel-yaml" version = "0.18.6" description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1009,6 +1058,7 @@ jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] name = "ruamel-yaml-clib" version = "0.2.8" description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1068,6 +1118,7 @@ files = [ name = "ruff" version = "0.0.265" description = "An extremely fast Python linter, written in Rust." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1094,6 +1145,7 @@ files = [ name = "safety" version = "2.3.5" description = "Checks installed dependencies for known vulnerabilities and licenses." +category = "main" optional = false python-versions = "*" files = [ @@ -1117,6 +1169,7 @@ gitlab = ["python-gitlab (>=1.3.0)"] name = "setuptools" version = "69.1.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1133,6 +1186,7 @@ testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jar name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -1144,6 +1198,7 @@ files = [ name = "structlog" version = "23.3.0" description = "Structured Logging for Python" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1161,6 +1216,7 @@ typing = ["mypy (>=1.4)", "rich", "twisted"] name = "termcolor" version = "2.4.0" description = "ANSI color formatting for output in terminal" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1175,6 +1231,7 @@ tests = ["pytest", "pytest-cov"] name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -1186,6 +1243,7 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1197,6 +1255,7 @@ files = [ name = "tomlkit" version = "0.12.3" description = "Style preserving TOML library" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1208,6 +1267,7 @@ files = [ name = "typing-extensions" version = "4.9.0" description = "Backported and Experimental Type Hints for Python 3.8+" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1217,13 +1277,14 @@ files = [ [[package]] name = "urllib3" -version = "2.2.0" +version = "2.2.1" description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" optional = false python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.0-py3-none-any.whl", hash = "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224"}, - {file = "urllib3-2.2.0.tar.gz", hash = "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20"}, + {file = "urllib3-2.2.1-py3-none-any.whl", hash = "sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d"}, + {file = "urllib3-2.2.1.tar.gz", hash = "sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19"}, ] [package.extras] @@ -1236,6 +1297,7 @@ zstd = ["zstandard (>=0.18.0)"] name = "werkzeug" version = "3.0.1" description = "The comprehensive WSGI web application library." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1253,6 +1315,7 @@ watchdog = ["watchdog (>=2.3)"] name = "wrapt" version = "1.16.0" description = "Module for decorators, wrappers and monkey patching." +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1331,4 +1394,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "a3aba2a2ea4462418b62b7857dba7ce9f2ab342dbd5235eab500571693e40c7d" +content-hash = "03185a5a544bb4d226b0dd139d4640984c17d4675d9b3373eb975d0019c20f1b" From cfad6efafd81fc68b008435b7c7bfceaaee4d66a Mon Sep 17 00:00:00 2001 From: Phil Weir Date: Thu, 22 Feb 2024 23:26:42 +0000 Subject: [PATCH 06/10] fix: tidy linting --- app/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/main.py b/app/main.py index 504f997..bda8a4f 100644 --- a/app/main.py +++ b/app/main.py @@ -1,10 +1,7 @@ -import logging -import sys - from flask import Flask from app.logger import setup_logging -from app.settings import get_custom_settings, settings +from app.settings import settings from app.views.berlin import berlin_blueprint from app.views.health import health_blueprint From d3d4ce9ec3d813eb8b92fb68b78f04e9e3c24c68 Mon Sep 17 00:00:00 2001 From: KamenDimitrov97 Date: Sun, 25 Feb 2024 23:09:38 +0200 Subject: [PATCH 07/10] Updated tests --- Makefile | 3 +- app/models.py | 6 ++-- app/views/berlin.py | 2 +- poetry.lock | 63 +--------------------------------------- tests/api/conftest.py | 7 +++++ tests/api/server_test.py | 56 ++++++++++++++++++++++------------- 6 files changed, 50 insertions(+), 87 deletions(-) diff --git a/Makefile b/Makefile index 9f64392..35e86a1 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ run: deps ## Start the api locally on port 28900. @FLASK_APP=${FLASK_APP} poetry run gunicorn "app.main:create_app()" -b 0.0.0.0:${BERLIN_API_PORT} -c gunicorn_config.py run-container: build ## Runs a container from the pre-build image - docker run -m 0.4g -p 28900:28900 --env BERLIN_API_BUILD_TIME='${BERLIN_API_BUILD_TIME}' -e BERLIN_API_BUILD_TIME="${BERLIN_API_BUILD_TIME}" -e BERLIN_API_VERSION="${BERLIN_API_VERSION}" -ti berlin_api + docker run -p 28940:28900 --env BERLIN_API_BUILD_TIME='${BERLIN_API_BUILD_TIME}' -e BERLIN_API_BUILD_TIME="${BERLIN_API_BUILD_TIME}" -e BERLIN_API_VERSION="${BERLIN_API_VERSION}" -ti berlin_api test: deps ## runs all tests poetry run pytest -v tests/ @@ -63,4 +63,3 @@ help: ## Show this help. if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${YELLOW}%-20s${GREEN}%s${RESET}\n", $$1, $$2} \ else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \ }' $(MAKEFILE_LIST) - diff --git a/app/models.py b/app/models.py index 6623055..515a279 100644 --- a/app/models.py +++ b/app/models.py @@ -1,8 +1,10 @@ from dataclasses import asdict, dataclass from typing import Optional - from berlin import Location +from app.logger import setup_logging + +logger = setup_logging() @dataclass class MatchModel: @@ -17,7 +19,7 @@ def from_location(cls, loc: Location) -> "MatchModel": offset=loc.get_offset() ) except AttributeError: - ... + logger.error("no offset or score available") def to_json(self): return asdict(self) diff --git a/app/views/berlin.py b/app/views/berlin.py index 04f9386..e7927b3 100644 --- a/app/views/berlin.py +++ b/app/views/berlin.py @@ -1,8 +1,8 @@ from flask import Blueprint, jsonify, request -from app.logger import setup_logging from app.models import LocationModel, MatchModel from app.store import get_db +from app.logger import setup_logging logger = setup_logging() db = get_db() diff --git a/poetry.lock b/poetry.lock index 2de4ded..228ba6c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "astroid" version = "2.15.8" description = "An abstract syntax tree for Python with inference support." -category = "dev" optional = false python-versions = ">=3.7.2" files = [ @@ -24,7 +23,6 @@ wrapt = [ name = "atomicwrites" version = "1.4.1" description = "Atomic file writes." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -35,7 +33,6 @@ files = [ name = "attrs" version = "23.2.0" description = "Classes Without Boilerplate" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -55,7 +52,6 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p name = "berlin" version = "0.3.12" description = "Identify locations and tag them with UN-LOCODEs and ISO-3166-2 subdivisions." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -125,7 +121,6 @@ files = [ name = "black" version = "22.12.0" description = "The uncompromising code formatter." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -160,7 +155,6 @@ uvloop = ["uvloop (>=0.15.2)"] name = "blinker" version = "1.7.0" description = "Fast, simple object-to-object and broadcast signaling" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -172,7 +166,6 @@ files = [ name = "certifi" version = "2024.2.2" description = "Python package for providing Mozilla's CA Bundle." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -184,7 +177,6 @@ files = [ name = "charset-normalizer" version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -284,7 +276,6 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -299,7 +290,6 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -311,7 +301,6 @@ files = [ name = "coverage" version = "7.4.2" description = "Code coverage measurement for Python" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -379,7 +368,6 @@ toml = ["tomli"] name = "dill" version = "0.3.8" description = "serialize all of Python" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -395,7 +383,6 @@ profile = ["gprof2dot (>=2022.7.29)"] name = "dparse" version = "0.6.3" description = "A parser for Python dependency files" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -415,7 +402,6 @@ pipenv = ["pipenv (<=2022.12.19)"] name = "dynaconf" version = "3.2.4" description = "The dynamic configurator for your Python Project" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -437,7 +423,6 @@ yaml = ["ruamel.yaml"] name = "execnet" version = "2.0.2" description = "execnet: rapid multi-Python deployment" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -452,7 +437,6 @@ testing = ["hatch", "pre-commit", "pytest", "tox"] name = "flake8" version = "4.0.1" description = "the modular source code checker: pep8 pyflakes and co" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -469,7 +453,6 @@ pyflakes = ">=2.4.0,<2.5.0" name = "flask" version = "2.3.3" description = "A simple framework for building complex web applications." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -492,7 +475,6 @@ dotenv = ["python-dotenv"] name = "gunicorn" version = "21.2.0" description = "WSGI HTTP Server for UNIX" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -513,7 +495,6 @@ tornado = ["tornado (>=0.2)"] name = "idna" version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -525,7 +506,6 @@ files = [ name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -537,7 +517,6 @@ files = [ name = "isort" version = "5.13.2" description = "A Python utility / library to sort Python imports." -category = "dev" optional = false python-versions = ">=3.8.0" files = [ @@ -552,7 +531,6 @@ colors = ["colorama (>=0.4.6)"] name = "itsdangerous" version = "2.1.2" description = "Safely pass data to untrusted environments and back." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -564,7 +542,6 @@ files = [ name = "jinja2" version = "3.1.3" description = "A very fast and expressive template engine." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -582,7 +559,6 @@ i18n = ["Babel (>=2.7)"] name = "json-log-formatter" version = "0.5.2" description = "JSON log formatter" -category = "main" optional = false python-versions = ">=2.7" files = [ @@ -593,7 +569,6 @@ files = [ name = "lazy-object-proxy" version = "1.10.0" description = "A fast and thorough lazy object proxy." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -640,7 +615,6 @@ files = [ name = "markupsafe" version = "2.1.5" description = "Safely add untrusted strings to HTML/XML markup." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -710,7 +684,6 @@ files = [ name = "mccabe" version = "0.6.1" description = "McCabe checker, plugin for flake8" -category = "dev" optional = false python-versions = "*" files = [ @@ -722,7 +695,6 @@ files = [ name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -734,7 +706,6 @@ files = [ name = "packaging" version = "21.3" description = "Core utilities for Python packages" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -749,7 +720,6 @@ pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" name = "pathspec" version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -761,7 +731,6 @@ files = [ name = "pip" version = "23.3.2" description = "The PyPA recommended tool for installing Python packages." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -773,7 +742,6 @@ files = [ name = "platformdirs" version = "4.2.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -789,7 +757,6 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest- name = "pluggy" version = "1.4.0" description = "plugin and hook calling mechanisms for python" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -805,7 +772,6 @@ testing = ["pytest", "pytest-benchmark"] name = "py" version = "1.11.0" description = "library with cross-python path, ini-parsing, io, code, log facilities" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -817,7 +783,6 @@ files = [ name = "pycodestyle" version = "2.8.0" description = "Python style guide checker" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -829,7 +794,6 @@ files = [ name = "pyflakes" version = "2.4.0" description = "passive checker of Python programs" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -841,7 +805,6 @@ files = [ name = "pylint" version = "2.17.7" description = "python code static checker" -category = "dev" optional = false python-versions = ">=3.7.2" files = [ @@ -870,7 +833,6 @@ testutils = ["gitpython (>3)"] name = "pylint-quotes" version = "0.2.3" description = "Quote consistency checker for PyLint.." -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -885,7 +847,6 @@ pylint = ">=2.8.0" name = "pyparsing" version = "3.1.1" description = "pyparsing module - Classes and methods to define and execute parsing grammars" -category = "main" optional = false python-versions = ">=3.6.8" files = [ @@ -900,7 +861,6 @@ diagrams = ["jinja2", "railroad-diagrams"] name = "pytest" version = "6.2.5" description = "pytest: simple powerful testing with Python" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -925,7 +885,6 @@ testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xm name = "pytest-cov" version = "3.0.0" description = "Pytest plugin for measuring coverage." -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -944,7 +903,6 @@ testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtuale name = "pytest-forked" version = "1.6.0" description = "run tests in isolated forked subprocesses" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -960,7 +918,6 @@ pytest = ">=3.10" name = "pytest-sugar" version = "0.9.7" description = "pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly)." -category = "dev" optional = false python-versions = "*" files = [ @@ -980,7 +937,6 @@ dev = ["black", "flake8", "pre-commit"] name = "pytest-xdist" version = "2.5.0" description = "pytest xdist plugin for distributed testing and loop-on-failing modes" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1002,7 +958,6 @@ testing = ["filelock"] name = "python-dateutil" version = "2.8.2" description = "Extensions to the standard Python datetime module" -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ @@ -1017,7 +972,6 @@ six = ">=1.5" name = "requests" version = "2.31.0" description = "Python HTTP for Humans." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1039,7 +993,6 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "ruamel-yaml" version = "0.18.6" description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1058,7 +1011,6 @@ jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] name = "ruamel-yaml-clib" version = "0.2.8" description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1118,7 +1070,6 @@ files = [ name = "ruff" version = "0.0.265" description = "An extremely fast Python linter, written in Rust." -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1145,7 +1096,6 @@ files = [ name = "safety" version = "2.3.5" description = "Checks installed dependencies for known vulnerabilities and licenses." -category = "main" optional = false python-versions = "*" files = [ @@ -1169,7 +1119,6 @@ gitlab = ["python-gitlab (>=1.3.0)"] name = "setuptools" version = "69.1.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1186,7 +1135,6 @@ testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jar name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -1198,7 +1146,6 @@ files = [ name = "structlog" version = "23.3.0" description = "Structured Logging for Python" -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1216,7 +1163,6 @@ typing = ["mypy (>=1.4)", "rich", "twisted"] name = "termcolor" version = "2.4.0" description = "ANSI color formatting for output in terminal" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1231,7 +1177,6 @@ tests = ["pytest", "pytest-cov"] name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" -category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -1243,7 +1188,6 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1255,7 +1199,6 @@ files = [ name = "tomlkit" version = "0.12.3" description = "Style preserving TOML library" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1267,7 +1210,6 @@ files = [ name = "typing-extensions" version = "4.9.0" description = "Backported and Experimental Type Hints for Python 3.8+" -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1279,7 +1221,6 @@ files = [ name = "urllib3" version = "2.2.1" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1297,7 +1238,6 @@ zstd = ["zstandard (>=0.18.0)"] name = "werkzeug" version = "3.0.1" description = "The comprehensive WSGI web application library." -category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1315,7 +1255,6 @@ watchdog = ["watchdog (>=2.3)"] name = "wrapt" version = "1.16.0" description = "Module for decorators, wrappers and monkey patching." -category = "dev" optional = false python-versions = ">=3.6" files = [ diff --git a/tests/api/conftest.py b/tests/api/conftest.py index 59e6521..92671c7 100644 --- a/tests/api/conftest.py +++ b/tests/api/conftest.py @@ -101,6 +101,13 @@ def get_subdiv_code(self): def get_state_code(self): return "gb" + + def get_score(self): + return 1010 + + def get_offset(self): + return [0, 10] + class FakeBerlinDbProxy: def query(self, query, state, limit, lev_distance): diff --git a/tests/api/server_test.py b/tests/api/server_test.py index 483f196..98c3d16 100644 --- a/tests/api/server_test.py +++ b/tests/api/server_test.py @@ -51,38 +51,54 @@ def test_search_with_scores_with_berlin(test_client_with_berlin): def test_search_with_state_with_berlin(test_client_with_berlin): response = test_client_with_berlin.get( - "/berlin/search?q=Lyuliakovo&state=BG&limit=2" + "/berlin/search?q=Lyuliakovo&state=BG&limit=2&with_scores=1" ) assert response.status_code == 200 assert isinstance(response.json, dict) assert response.json == { - "matches": [{ - "encoding": "UN-LOCODE", - "id": "bg:blo", - "key": "UN-LOCODE-bg:blo", - "names": ["lyuliakovo"], - "words": ["lyuliakovo"], - "codes": ["blo"], - "state": ["bg", "ISO-3166-1-bg"], - "subdiv": ["02", "ISO-3166-2-bg:02"], + 'matches': [{ + 'loc': { + 'codes': ['blo'], + 'encoding': 'UN-LOCODE', + 'id': 'bg:blo', + 'key': 'UN-LOCODE-bg:blo', + 'names': ['lyuliakovo'], + 'state': ['bg', 'ISO-3166-1-bg'], + 'subdiv': ['02', 'ISO-3166-2-bg:02'], + 'words': ['lyuliakovo'] + }, + 'match': { + 'offset': [0, 10], + 'score': 1010 + } }] } print(response.json) def test_search_with_state(test_client): - response = test_client.get("/berlin/search?q=Manch&state=GB&limit=2") + response = test_client.get("/berlin/search?q=Manch&state=GB&limit=2&with_scores=1") + print(response.json) assert response.status_code == 200 assert isinstance(response.json, dict) assert response.json == { - "matches": [{ - "encoding": "B", - "id": "X", - "key": "A", - "names": ["manc"], - "words": ["Manchester"], - "codes": ["mnc"], - "state": ["gb", "gb-nom"], - "subdiv": ["mac", "gb-mac-name"], + 'matches': [{ + 'loc': { + 'codes': ['mnc'], + 'encoding': 'B', + 'id': 'X', + 'key': 'A', + 'names': ['manc'], + 'state': ['gb', 'gb-nom'], + 'subdiv': ['mac', 'gb-mac-name'], + 'words': ['Manchester'] + }, + 'match': { + 'offset': [0, 10], + 'score': 1010 + + } }] } + print(response.json) + From 85a55dc5abf59af775d6be4ba36158d260877a67 Mon Sep 17 00:00:00 2001 From: KamenDimitrov97 Date: Mon, 26 Feb 2024 12:11:37 +0200 Subject: [PATCH 08/10] added query strip --- app/views/berlin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/berlin.py b/app/views/berlin.py index e7927b3..32af0c7 100644 --- a/app/views/berlin.py +++ b/app/views/berlin.py @@ -48,6 +48,10 @@ def berlin_search(): "match": MatchModel.from_location(loc).to_json() } for loc in result ] + + start_idx = matches[0]["match"]["offset"][0] + end_idx = matches[0]["match"]["offset"][1] + q = q[:start_idx] + q[end_idx:] else: matches = [ LocationModel.from_location(loc, db).to_json() @@ -55,6 +59,7 @@ def berlin_search(): ] locations = { + "query": q, "matches": matches } return jsonify(locations), 200 From 9db89478233ecec1e7c9a51f5586a626ac1dc1c7 Mon Sep 17 00:00:00 2001 From: Phil Weir Date: Mon, 26 Feb 2024 11:49:04 +0000 Subject: [PATCH 09/10] fix: corrected typo in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 383d759..8b449a4 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ This will return results of the form: } ``` -By supplying an additional parameter, `with_score=1`, the structure will change: +By supplying an additional parameter, `with_scores=1`, the structure will change: ```json { From 18d1e2c06e0a6adef8406c018e00f7860192a686 Mon Sep 17 00:00:00 2001 From: KamenDimitrov97 Date: Mon, 26 Feb 2024 16:01:01 +0200 Subject: [PATCH 10/10] fmt code, removed dynamic logging event generation, updated docks and tests --- README.md | 28 --------- app/logger.py | 4 +- app/main.py | 1 + app/models.py | 10 ++-- app/views/berlin.py | 48 ++++++++------- poetry.lock | 124 +++++++++++++++++++-------------------- pyproject.toml | 2 + tests/api/server_test.py | 25 ++++---- 8 files changed, 109 insertions(+), 133 deletions(-) diff --git a/README.md b/README.md index 8b449a4..9bb0b1e 100644 --- a/README.md +++ b/README.md @@ -66,34 +66,6 @@ curl 'http://localhost:28900/berlin/search?q=house+prices+in+londo&state=gb' | j replacing `localhost` with the local endpoint (`jq` used for formatting). -This will return results of the form: - -```json -{ - "matches": [ - { - "encoding": "UN-LOCODE", - "id": "ca:lod", - "key": "UN-LOCODE-ca:lod", - "words": [ - "london" - ] - }, - { - "encoding": "UN-LOCODE", - "id": "us:ldn", - "key": "UN-LOCODE-us:ldn", - "words": [ - "london" - ] - } - ... - ] -} -``` - -By supplying an additional parameter, `with_scores=1`, the structure will change: - ```json { "matches": [ diff --git a/app/logger.py b/app/logger.py index 965eb44..f5ca73b 100644 --- a/app/logger.py +++ b/app/logger.py @@ -1,11 +1,13 @@ import logging import logging.config +from datetime import datetime + import structlog import structlog._log_levels -from datetime import datetime from app.settings import settings + def add_severity_level(logger, method_name, event_dict): if method_name == "info": event_dict[0][0]["severity"] = 0 diff --git a/app/main.py b/app/main.py index bda8a4f..c7bfaf3 100644 --- a/app/main.py +++ b/app/main.py @@ -7,6 +7,7 @@ logger = setup_logging() + def create_app(): application = Flask(__name__) application.register_blueprint(berlin_blueprint) diff --git a/app/models.py b/app/models.py index 515a279..6a0f424 100644 --- a/app/models.py +++ b/app/models.py @@ -1,11 +1,13 @@ from dataclasses import asdict, dataclass from typing import Optional + from berlin import Location -from app.logger import setup_logging +from app.logger import setup_logging logger = setup_logging() + @dataclass class MatchModel: score: int | None @@ -14,16 +16,14 @@ class MatchModel: @classmethod def from_location(cls, loc: Location) -> "MatchModel": try: - return cls( - score=loc.get_score(), - offset=loc.get_offset() - ) + return cls(score=loc.get_score(), offset=loc.get_offset()) except AttributeError: logger.error("no offset or score available") def to_json(self): return asdict(self) + @dataclass class LocationModel: id: str diff --git a/app/views/berlin.py b/app/views/berlin.py index 32af0c7..730edb1 100644 --- a/app/views/berlin.py +++ b/app/views/berlin.py @@ -1,8 +1,8 @@ from flask import Blueprint, jsonify, request +from app.logger import setup_logging from app.models import LocationModel, MatchModel from app.store import get_db -from app.logger import setup_logging logger = setup_logging() db = get_db() @@ -33,35 +33,33 @@ def berlin_search(): state = request.args.get("state") or "gb" limit = request.args.get("limit", type=int) or 10 lev_distance = request.args.get("lev_distance", type=int) or 2 - with_scores = request.args.get("with_scores", type=bool) or False try: - log_message = f"Querying database with q={q}, state={state}, limit={limit}, lev_distance={lev_distance}" - logger.info(log_message) + logger.info( + event="Querying database", + data={ + "q": q, + "state": state, + "limit": limit, + "lev_distance": lev_distance, + }, + ) result = db.query(q, state=state, limit=limit, lev_distance=lev_distance) - if with_scores: - matches = [ - { - "loc": LocationModel.from_location(loc, db).to_json(), - "match": MatchModel.from_location(loc).to_json() - } for loc in result - ] - - start_idx = matches[0]["match"]["offset"][0] - end_idx = matches[0]["match"]["offset"][1] - q = q[:start_idx] + q[end_idx:] - else: - matches = [ - LocationModel.from_location(loc, db).to_json() - for loc in result - ] - - locations = { - "query": q, - "matches": matches - } + matches = [ + { + "loc": LocationModel.from_location(loc, db).to_json(), + "scores": MatchModel.from_location(loc).to_json(), + } + for loc in result + ] + + start_idx = matches[0]["scores"]["offset"][0] + end_idx = matches[0]["scores"]["offset"][1] + q = q[:start_idx] + q[end_idx:] + + locations = {"query": q, "matches": matches} return jsonify(locations), 200 except Exception as e: diff --git a/poetry.lock b/poetry.lock index 228ba6c..6ff8b78 100644 --- a/poetry.lock +++ b/poetry.lock @@ -299,63 +299,63 @@ files = [ [[package]] name = "coverage" -version = "7.4.2" +version = "7.4.3" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" files = [ - {file = "coverage-7.4.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bf54c3e089179d9d23900e3efc86d46e4431188d9a657f345410eecdd0151f50"}, - {file = "coverage-7.4.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fe6e43c8b510719b48af7db9631b5fbac910ade4bd90e6378c85ac5ac706382c"}, - {file = "coverage-7.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b98c89db1b150d851a7840142d60d01d07677a18f0f46836e691c38134ed18b"}, - {file = "coverage-7.4.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5f9683be6a5b19cd776ee4e2f2ffb411424819c69afab6b2db3a0a364ec6642"}, - {file = "coverage-7.4.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78cdcbf7b9cb83fe047ee09298e25b1cd1636824067166dc97ad0543b079d22f"}, - {file = "coverage-7.4.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:2599972b21911111114100d362aea9e70a88b258400672626efa2b9e2179609c"}, - {file = "coverage-7.4.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ef00d31b7569ed3cb2036f26565f1984b9fc08541731ce01012b02a4c238bf03"}, - {file = "coverage-7.4.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:20a875bfd8c282985c4720c32aa05056f77a68e6d8bbc5fe8632c5860ee0b49b"}, - {file = "coverage-7.4.2-cp310-cp310-win32.whl", hash = "sha256:b3f2b1eb229f23c82898eedfc3296137cf1f16bb145ceab3edfd17cbde273fb7"}, - {file = "coverage-7.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:7df95fdd1432a5d2675ce630fef5f239939e2b3610fe2f2b5bf21fa505256fa3"}, - {file = "coverage-7.4.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a8ddbd158e069dded57738ea69b9744525181e99974c899b39f75b2b29a624e2"}, - {file = "coverage-7.4.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:81a5fb41b0d24447a47543b749adc34d45a2cf77b48ca74e5bf3de60a7bd9edc"}, - {file = "coverage-7.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2412e98e70f16243be41d20836abd5f3f32edef07cbf8f407f1b6e1ceae783ac"}, - {file = "coverage-7.4.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ddb79414c15c6f03f56cc68fa06994f047cf20207c31b5dad3f6bab54a0f66ef"}, - {file = "coverage-7.4.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cf89ab85027427d351f1de918aff4b43f4eb5f33aff6835ed30322a86ac29c9e"}, - {file = "coverage-7.4.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a178b7b1ac0f1530bb28d2e51f88c0bab3e5949835851a60dda80bff6052510c"}, - {file = "coverage-7.4.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:06fe398145a2e91edaf1ab4eee66149c6776c6b25b136f4a86fcbbb09512fd10"}, - {file = "coverage-7.4.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:18cac867950943fe93d6cd56a67eb7dcd2d4a781a40f4c1e25d6f1ed98721a55"}, - {file = "coverage-7.4.2-cp311-cp311-win32.whl", hash = "sha256:f72cdd2586f9a769570d4b5714a3837b3a59a53b096bb954f1811f6a0afad305"}, - {file = "coverage-7.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:d779a48fac416387dd5673fc5b2d6bd903ed903faaa3247dc1865c65eaa5a93e"}, - {file = "coverage-7.4.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:adbdfcda2469d188d79771d5696dc54fab98a16d2ef7e0875013b5f56a251047"}, - {file = "coverage-7.4.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ac4bab32f396b03ebecfcf2971668da9275b3bb5f81b3b6ba96622f4ef3f6e17"}, - {file = "coverage-7.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:006d220ba2e1a45f1de083d5022d4955abb0aedd78904cd5a779b955b019ec73"}, - {file = "coverage-7.4.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3733545eb294e5ad274abe131d1e7e7de4ba17a144505c12feca48803fea5f64"}, - {file = "coverage-7.4.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42a9e754aa250fe61f0f99986399cec086d7e7a01dd82fd863a20af34cbce962"}, - {file = "coverage-7.4.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:2ed37e16cf35c8d6e0b430254574b8edd242a367a1b1531bd1adc99c6a5e00fe"}, - {file = "coverage-7.4.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:b953275d4edfab6cc0ed7139fa773dfb89e81fee1569a932f6020ce7c6da0e8f"}, - {file = "coverage-7.4.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:32b4ab7e6c924f945cbae5392832e93e4ceb81483fd6dc4aa8fb1a97b9d3e0e1"}, - {file = "coverage-7.4.2-cp312-cp312-win32.whl", hash = "sha256:f5df76c58977bc35a49515b2fbba84a1d952ff0ec784a4070334dfbec28a2def"}, - {file = "coverage-7.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:34423abbaad70fea9d0164add189eabaea679068ebdf693baa5c02d03e7db244"}, - {file = "coverage-7.4.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5b11f9c6587668e495cc7365f85c93bed34c3a81f9f08b0920b87a89acc13469"}, - {file = "coverage-7.4.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:51593a1f05c39332f623d64d910445fdec3d2ac2d96b37ce7f331882d5678ddf"}, - {file = "coverage-7.4.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69f1665165ba2fe7614e2f0c1aed71e14d83510bf67e2ee13df467d1c08bf1e8"}, - {file = "coverage-7.4.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3c8bbb95a699c80a167478478efe5e09ad31680931ec280bf2087905e3b95ec"}, - {file = "coverage-7.4.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:175f56572f25e1e1201d2b3e07b71ca4d201bf0b9cb8fad3f1dfae6a4188de86"}, - {file = "coverage-7.4.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:8562ca91e8c40864942615b1d0b12289d3e745e6b2da901d133f52f2d510a1e3"}, - {file = "coverage-7.4.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:d9a1ef0f173e1a19738f154fb3644f90d0ada56fe6c9b422f992b04266c55d5a"}, - {file = "coverage-7.4.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:f40ac873045db4fd98a6f40387d242bde2708a3f8167bd967ccd43ad46394ba2"}, - {file = "coverage-7.4.2-cp38-cp38-win32.whl", hash = "sha256:d1b750a8409bec61caa7824bfd64a8074b6d2d420433f64c161a8335796c7c6b"}, - {file = "coverage-7.4.2-cp38-cp38-win_amd64.whl", hash = "sha256:b4ae777bebaed89e3a7e80c4a03fac434a98a8abb5251b2a957d38fe3fd30088"}, - {file = "coverage-7.4.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3ff7f92ae5a456101ca8f48387fd3c56eb96353588e686286f50633a611afc95"}, - {file = "coverage-7.4.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:861d75402269ffda0b33af94694b8e0703563116b04c681b1832903fac8fd647"}, - {file = "coverage-7.4.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3507427d83fa961cbd73f11140f4a5ce84208d31756f7238d6257b2d3d868405"}, - {file = "coverage-7.4.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bf711d517e21fb5bc429f5c4308fbc430a8585ff2a43e88540264ae87871e36a"}, - {file = "coverage-7.4.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c00e54f0bd258ab25e7f731ca1d5144b0bf7bec0051abccd2bdcff65fa3262c9"}, - {file = "coverage-7.4.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f8e845d894e39fb53834da826078f6dc1a933b32b1478cf437007367efaf6f6a"}, - {file = "coverage-7.4.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:840456cb1067dc350af9080298c7c2cfdddcedc1cb1e0b30dceecdaf7be1a2d3"}, - {file = "coverage-7.4.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c11ca2df2206a4e3e4c4567f52594637392ed05d7c7fb73b4ea1c658ba560265"}, - {file = "coverage-7.4.2-cp39-cp39-win32.whl", hash = "sha256:3ff5bdb08d8938d336ce4088ca1a1e4b6c8cd3bef8bb3a4c0eb2f37406e49643"}, - {file = "coverage-7.4.2-cp39-cp39-win_amd64.whl", hash = "sha256:ac9e95cefcf044c98d4e2c829cd0669918585755dd9a92e28a1a7012322d0a95"}, - {file = "coverage-7.4.2-pp38.pp39.pp310-none-any.whl", hash = "sha256:f593a4a90118d99014517c2679e04a4ef5aee2d81aa05c26c734d271065efcb6"}, - {file = "coverage-7.4.2.tar.gz", hash = "sha256:1a5ee18e3a8d766075ce9314ed1cb695414bae67df6a4b0805f5137d93d6f1cb"}, + {file = "coverage-7.4.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8580b827d4746d47294c0e0b92854c85a92c2227927433998f0d3320ae8a71b6"}, + {file = "coverage-7.4.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:718187eeb9849fc6cc23e0d9b092bc2348821c5e1a901c9f8975df0bc785bfd4"}, + {file = "coverage-7.4.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:767b35c3a246bcb55b8044fd3a43b8cd553dd1f9f2c1eeb87a302b1f8daa0524"}, + {file = "coverage-7.4.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae7f19afe0cce50039e2c782bff379c7e347cba335429678450b8fe81c4ef96d"}, + {file = "coverage-7.4.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba3a8aaed13770e970b3df46980cb068d1c24af1a1968b7818b69af8c4347efb"}, + {file = "coverage-7.4.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ee866acc0861caebb4f2ab79f0b94dbfbdbfadc19f82e6e9c93930f74e11d7a0"}, + {file = "coverage-7.4.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:506edb1dd49e13a2d4cac6a5173317b82a23c9d6e8df63efb4f0380de0fbccbc"}, + {file = "coverage-7.4.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd6545d97c98a192c5ac995d21c894b581f1fd14cf389be90724d21808b657e2"}, + {file = "coverage-7.4.3-cp310-cp310-win32.whl", hash = "sha256:f6a09b360d67e589236a44f0c39218a8efba2593b6abdccc300a8862cffc2f94"}, + {file = "coverage-7.4.3-cp310-cp310-win_amd64.whl", hash = "sha256:18d90523ce7553dd0b7e23cbb28865db23cddfd683a38fb224115f7826de78d0"}, + {file = "coverage-7.4.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cbbe5e739d45a52f3200a771c6d2c7acf89eb2524890a4a3aa1a7fa0695d2a47"}, + {file = "coverage-7.4.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:489763b2d037b164846ebac0cbd368b8a4ca56385c4090807ff9fad817de4113"}, + {file = "coverage-7.4.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:451f433ad901b3bb00184d83fd83d135fb682d780b38af7944c9faeecb1e0bfe"}, + {file = "coverage-7.4.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fcc66e222cf4c719fe7722a403888b1f5e1682d1679bd780e2b26c18bb648cdc"}, + {file = "coverage-7.4.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b3ec74cfef2d985e145baae90d9b1b32f85e1741b04cd967aaf9cfa84c1334f3"}, + {file = "coverage-7.4.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:abbbd8093c5229c72d4c2926afaee0e6e3140de69d5dcd918b2921f2f0c8baba"}, + {file = "coverage-7.4.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:35eb581efdacf7b7422af677b92170da4ef34500467381e805944a3201df2079"}, + {file = "coverage-7.4.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8249b1c7334be8f8c3abcaaa996e1e4927b0e5a23b65f5bf6cfe3180d8ca7840"}, + {file = "coverage-7.4.3-cp311-cp311-win32.whl", hash = "sha256:cf30900aa1ba595312ae41978b95e256e419d8a823af79ce670835409fc02ad3"}, + {file = "coverage-7.4.3-cp311-cp311-win_amd64.whl", hash = "sha256:18c7320695c949de11a351742ee001849912fd57e62a706d83dfc1581897fa2e"}, + {file = "coverage-7.4.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b51bfc348925e92a9bd9b2e48dad13431b57011fd1038f08316e6bf1df107d10"}, + {file = "coverage-7.4.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d6cdecaedea1ea9e033d8adf6a0ab11107b49571bbb9737175444cea6eb72328"}, + {file = "coverage-7.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3b2eccb883368f9e972e216c7b4c7c06cabda925b5f06dde0650281cb7666a30"}, + {file = "coverage-7.4.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6c00cdc8fa4e50e1cc1f941a7f2e3e0f26cb2a1233c9696f26963ff58445bac7"}, + {file = "coverage-7.4.3-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b9a4a8dd3dcf4cbd3165737358e4d7dfbd9d59902ad11e3b15eebb6393b0446e"}, + {file = "coverage-7.4.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:062b0a75d9261e2f9c6d071753f7eef0fc9caf3a2c82d36d76667ba7b6470003"}, + {file = "coverage-7.4.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:ebe7c9e67a2d15fa97b77ea6571ce5e1e1f6b0db71d1d5e96f8d2bf134303c1d"}, + {file = "coverage-7.4.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:c0a120238dd71c68484f02562f6d446d736adcc6ca0993712289b102705a9a3a"}, + {file = "coverage-7.4.3-cp312-cp312-win32.whl", hash = "sha256:37389611ba54fd6d278fde86eb2c013c8e50232e38f5c68235d09d0a3f8aa352"}, + {file = "coverage-7.4.3-cp312-cp312-win_amd64.whl", hash = "sha256:d25b937a5d9ffa857d41be042b4238dd61db888533b53bc76dc082cb5a15e914"}, + {file = "coverage-7.4.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:28ca2098939eabab044ad68850aac8f8db6bf0b29bc7f2887d05889b17346454"}, + {file = "coverage-7.4.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:280459f0a03cecbe8800786cdc23067a8fc64c0bd51dc614008d9c36e1659d7e"}, + {file = "coverage-7.4.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c0cdedd3500e0511eac1517bf560149764b7d8e65cb800d8bf1c63ebf39edd2"}, + {file = "coverage-7.4.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9a9babb9466fe1da12417a4aed923e90124a534736de6201794a3aea9d98484e"}, + {file = "coverage-7.4.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dec9de46a33cf2dd87a5254af095a409ea3bf952d85ad339751e7de6d962cde6"}, + {file = "coverage-7.4.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:16bae383a9cc5abab9bb05c10a3e5a52e0a788325dc9ba8499e821885928968c"}, + {file = "coverage-7.4.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:2c854ce44e1ee31bda4e318af1dbcfc929026d12c5ed030095ad98197eeeaed0"}, + {file = "coverage-7.4.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ce8c50520f57ec57aa21a63ea4f325c7b657386b3f02ccaedeccf9ebe27686e1"}, + {file = "coverage-7.4.3-cp38-cp38-win32.whl", hash = "sha256:708a3369dcf055c00ddeeaa2b20f0dd1ce664eeabde6623e516c5228b753654f"}, + {file = "coverage-7.4.3-cp38-cp38-win_amd64.whl", hash = "sha256:1bf25fbca0c8d121a3e92a2a0555c7e5bc981aee5c3fdaf4bb7809f410f696b9"}, + {file = "coverage-7.4.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3b253094dbe1b431d3a4ac2f053b6d7ede2664ac559705a704f621742e034f1f"}, + {file = "coverage-7.4.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:77fbfc5720cceac9c200054b9fab50cb2a7d79660609200ab83f5db96162d20c"}, + {file = "coverage-7.4.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6679060424faa9c11808598504c3ab472de4531c571ab2befa32f4971835788e"}, + {file = "coverage-7.4.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4af154d617c875b52651dd8dd17a31270c495082f3d55f6128e7629658d63765"}, + {file = "coverage-7.4.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8640f1fde5e1b8e3439fe482cdc2b0bb6c329f4bb161927c28d2e8879c6029ee"}, + {file = "coverage-7.4.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:69b9f6f66c0af29642e73a520b6fed25ff9fd69a25975ebe6acb297234eda501"}, + {file = "coverage-7.4.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:0842571634f39016a6c03e9d4aba502be652a6e4455fadb73cd3a3a49173e38f"}, + {file = "coverage-7.4.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a78ed23b08e8ab524551f52953a8a05d61c3a760781762aac49f8de6eede8c45"}, + {file = "coverage-7.4.3-cp39-cp39-win32.whl", hash = "sha256:c0524de3ff096e15fcbfe8f056fdb4ea0bf497d584454f344d59fce069d3e6e9"}, + {file = "coverage-7.4.3-cp39-cp39-win_amd64.whl", hash = "sha256:0209a6369ccce576b43bb227dc8322d8ef9e323d089c6f3f26a597b09cb4d2aa"}, + {file = "coverage-7.4.3-pp38.pp39.pp310-none-any.whl", hash = "sha256:7cbde573904625509a3f37b6fecea974e363460b556a627c60dc2f47e2fffa51"}, + {file = "coverage-7.4.3.tar.gz", hash = "sha256:276f6077a5c61447a48d133ed13e759c09e62aff0dc84274a68dc18660104d52"}, ] [package.dependencies] @@ -1117,19 +1117,19 @@ gitlab = ["python-gitlab (>=1.3.0)"] [[package]] name = "setuptools" -version = "69.1.0" +version = "69.1.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-69.1.0-py3-none-any.whl", hash = "sha256:c054629b81b946d63a9c6e732bc8b2513a7c3ea645f11d0139a2191d735c60c6"}, - {file = "setuptools-69.1.0.tar.gz", hash = "sha256:850894c4195f09c4ed30dba56213bf7c3f21d86ed6bdaafb5df5972593bfc401"}, + {file = "setuptools-69.1.1-py3-none-any.whl", hash = "sha256:02fa291a0471b3a18b2b2481ed902af520c69e8ae0919c13da936542754b4c56"}, + {file = "setuptools-69.1.1.tar.gz", hash = "sha256:5c0806c7d9af348e6dd3777b4f4dbb42c7ad85b190104837488eab9a7c945cf8"}, ] [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "six" @@ -1208,13 +1208,13 @@ files = [ [[package]] name = "typing-extensions" -version = "4.9.0" +version = "4.10.0" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"}, - {file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"}, + {file = "typing_extensions-4.10.0-py3-none-any.whl", hash = "sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475"}, + {file = "typing_extensions-4.10.0.tar.gz", hash = "sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb"}, ] [[package]] @@ -1333,4 +1333,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "03185a5a544bb4d226b0dd139d4640984c17d4675d9b3373eb975d0019c20f1b" +content-hash = "03bcad4e3f6c3ac1f3b0d9230be5b3c79c6588e06621de1baee00dff49725dd4" diff --git a/pyproject.toml b/pyproject.toml index 3752824..5162be1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,8 +69,10 @@ dynaconf = "^3.1.12" pip = "^23.1.2" gunicorn = "^21.2.0" json-log-formatter = "^0.5.2" +Jinja2 = ">=3.1.3" [tool.poetry.dev-dependencies] +Jinja2 = ">=3.1.3" pytest = "^6.2.5" flake8 = "^4.0.1" pylint = "^2.15.4" diff --git a/tests/api/server_test.py b/tests/api/server_test.py index 98c3d16..6675e22 100644 --- a/tests/api/server_test.py +++ b/tests/api/server_test.py @@ -27,6 +27,7 @@ def test_search_with_scores_with_berlin(test_client_with_berlin): response = test_client_with_berlin.get( "/berlin/search?q=Dentists+in+Lyuliakovo&state=BG&limit=2&with_scores=1" ) + print(response.json) assert response.status_code == 200 assert isinstance(response.json, dict) assert response.json == { @@ -40,14 +41,14 @@ def test_search_with_scores_with_berlin(test_client_with_berlin): "codes": ["blo"], "state": ["bg", "ISO-3166-1-bg"], "subdiv": ["02", "ISO-3166-2-bg:02"], - }, - "match": { - "offset": [12, 22], - "score": 1010 + }, + 'scores': { + 'offset': [12, 22], + 'score': 1010 } - }] + }], + 'query': 'Dentists in ' } - print(response.json) def test_search_with_state_with_berlin(test_client_with_berlin): response = test_client_with_berlin.get( @@ -67,18 +68,18 @@ def test_search_with_state_with_berlin(test_client_with_berlin): 'subdiv': ['02', 'ISO-3166-2-bg:02'], 'words': ['lyuliakovo'] }, - 'match': { + 'scores': { 'offset': [0, 10], 'score': 1010 } - }] + }], + 'query': '' } print(response.json) def test_search_with_state(test_client): response = test_client.get("/berlin/search?q=Manch&state=GB&limit=2&with_scores=1") - print(response.json) assert response.status_code == 200 assert isinstance(response.json, dict) assert response.json == { @@ -93,12 +94,12 @@ def test_search_with_state(test_client): 'subdiv': ['mac', 'gb-mac-name'], 'words': ['Manchester'] }, - 'match': { + 'scores': { 'offset': [0, 10], 'score': 1010 - } - }] + }], + 'query': '' } print(response.json)