From 8499a86fdcc51617309945fd44cabbce0269473c Mon Sep 17 00:00:00 2001 From: Daniel Roussel Date: Fri, 1 Dec 2023 16:07:34 +0100 Subject: [PATCH] please the linters --- src/enlyze/api_clients/base.py | 2 +- src/enlyze/api_clients/production_runs/client.py | 2 +- src/enlyze/api_clients/timeseries/client.py | 2 +- src/enlyze/client.py | 6 +++--- tests/enlyze/api_clients/production_runs/test_client.py | 2 +- tests/enlyze/api_clients/test_base.py | 1 - 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/enlyze/api_clients/base.py b/src/enlyze/api_clients/base.py index f7e0a1c..557deb3 100644 --- a/src/enlyze/api_clients/base.py +++ b/src/enlyze/api_clients/base.py @@ -9,7 +9,7 @@ from pydantic import BaseModel, ValidationError from enlyze.auth import TokenAuth -from enlyze.constants import ENLYZE_BASE_URL, HTTPX_TIMEOUT +from enlyze.constants import HTTPX_TIMEOUT from enlyze.errors import EnlyzeError, InvalidTokenError diff --git a/src/enlyze/api_clients/production_runs/client.py b/src/enlyze/api_clients/production_runs/client.py index 24ebdd0..6610913 100644 --- a/src/enlyze/api_clients/production_runs/client.py +++ b/src/enlyze/api_clients/production_runs/client.py @@ -4,7 +4,7 @@ from pydantic import BaseModel from enlyze.api_clients.base import ApiBaseClient, PaginatedResponseBaseModel -from enlyze.constants import ENLYZE_BASE_URL, PRODUCTION_RUNS_API_SUB_PATH +from enlyze.constants import PRODUCTION_RUNS_API_SUB_PATH class _Metadata(BaseModel): diff --git a/src/enlyze/api_clients/timeseries/client.py b/src/enlyze/api_clients/timeseries/client.py index cf4714e..b3385fd 100644 --- a/src/enlyze/api_clients/timeseries/client.py +++ b/src/enlyze/api_clients/timeseries/client.py @@ -4,7 +4,7 @@ from pydantic import AnyUrl from enlyze.api_clients.base import ApiBaseClient, PaginatedResponseBaseModel -from enlyze.constants import ENLYZE_BASE_URL, TIMESERIES_API_SUB_PATH +from enlyze.constants import TIMESERIES_API_SUB_PATH class _PaginatedResponse(PaginatedResponseBaseModel): diff --git a/src/enlyze/client.py b/src/enlyze/client.py index 2124b22..a2c9eff 100644 --- a/src/enlyze/client.py +++ b/src/enlyze/client.py @@ -52,14 +52,14 @@ class EnlyzeClient: """ - def __init__(self, token: str, base_url: str | None = ENLYZE_BASE_URL) -> None: + def __init__(self, token: str, base_url: str | None = None) -> None: self._timeseries_api_client = TimeseriesApiClient( token=token, - base_url=base_url, + base_url=base_url or ENLYZE_BASE_URL, ) self._production_runs_api_client = ProductionRunsApiClient( token=token, - base_url=base_url, + base_url=base_url or ENLYZE_BASE_URL, ) def _get_sites(self) -> Iterator[timeseries_api_models.Site]: diff --git a/tests/enlyze/api_clients/production_runs/test_client.py b/tests/enlyze/api_clients/production_runs/test_client.py index e949f5a..0d6f3bd 100644 --- a/tests/enlyze/api_clients/production_runs/test_client.py +++ b/tests/enlyze/api_clients/production_runs/test_client.py @@ -7,7 +7,7 @@ _Metadata, _PaginatedResponse, ) -from enlyze.constants import ENLYZE_BASE_URL, PRODUCTION_RUNS_API_SUB_PATH +from enlyze.constants import PRODUCTION_RUNS_API_SUB_PATH @pytest.fixture diff --git a/tests/enlyze/api_clients/test_base.py b/tests/enlyze/api_clients/test_base.py index f628e70..3aac723 100644 --- a/tests/enlyze/api_clients/test_base.py +++ b/tests/enlyze/api_clients/test_base.py @@ -12,7 +12,6 @@ ApiBaseModel, PaginatedResponseBaseModel, ) -from enlyze.constants import ENLYZE_BASE_URL from enlyze.errors import EnlyzeError, InvalidTokenError