From 69714d5b5c9d0b58e39b22c650dac87d41e2bdb6 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sun, 1 Mar 2020 17:51:03 +0200 Subject: [PATCH] Use top-level module for api version number instead of a fixed value --- server/service_repo/service_repo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/service_repo/service_repo.py b/server/service_repo/service_repo.py index 78aabe4..545a894 100644 --- a/server/service_repo/service_repo.py +++ b/server/service_repo/service_repo.py @@ -9,6 +9,7 @@ import jsonmodels.models import timing_context from apierrors import APIError from apierrors.errors.bad_request import RequestPathHasInvalidVersion +from api_version import __version__ as _api_version_ from config import config from service_repo.base import PartialVersion from .apicall import APICall @@ -34,7 +35,7 @@ class ServiceRepo(object): """If the check is set, parsing will fail for endpoint request with the version that is grater than the current maximum """ - _max_version = PartialVersion("2.6") + _max_version = PartialVersion(".".join(_api_version_.split(".")[:2])) """ Maximum version number (the highest min_version value across all endpoints) """ _endpoint_exp = ( @@ -166,7 +167,7 @@ class ServiceRepo(object): return assert isinstance(endpoint, Endpoint) - call.actual_endpoint_version: PartialVersion = endpoint.min_version + call.actual_endpoint_version = endpoint.min_version call.requires_authorization = endpoint.authorize return endpoint