From cdcde1615e7d5aed10b3f5e52586eb4bb0aa1304 Mon Sep 17 00:00:00 2001 From: Mattia Almansi Date: Tue, 19 Nov 2024 09:54:35 +0100 Subject: [PATCH] Migrate to datapi (#132) * use datapi dependency --- cdsapi/api.py | 5 +++-- setup.py | 2 +- tests/test_api.py | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cdsapi/api.py b/cdsapi/api.py index a8ea1a9..051186d 100644 --- a/cdsapi/api.py +++ b/cdsapi/api.py @@ -281,9 +281,10 @@ def __new__(cls, url=None, key=None, *args, **kwargs): _, token, _ = get_url_key_verify(url, key, None) if ":" in token: return super().__new__(cls) - import cads_api_client.legacy_api_client - return super().__new__(cads_api_client.legacy_api_client.LegacyApiClient) + import datapi.legacy_api_client + + return super().__new__(datapi.legacy_api_client.LegacyApiClient) def __init__( self, diff --git a/setup.py b/setup.py index a3546d0..3396fea 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ def read(fname): include_package_data=True, python_requires=">=3.8", install_requires=[ - "cads-api-client>=1.4.7", + "datapi", "requests>=2.5.0", "tqdm", ], diff --git a/tests/test_api.py b/tests/test_api.py index ac5d10b..69e86f8 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,6 +1,6 @@ import os -import cads_api_client.legacy_api_client +import datapi.legacy_api_client import pytest import cdsapi @@ -33,7 +33,7 @@ def test_request(): ), ( "", - cads_api_client.legacy_api_client.LegacyApiClient, + datapi.legacy_api_client.LegacyApiClient, ), ], )