From b2e1eb0a8c9529fc228ce78c7d480c84cd47dcc9 Mon Sep 17 00:00:00 2001 From: malmans2 Date: Thu, 14 Nov 2024 10:54:42 +0100 Subject: [PATCH] restore optional import --- cdsapi/api.py | 5 +++-- setup.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cdsapi/api.py b/cdsapi/api.py index d136335..051186d 100644 --- a/cdsapi/api.py +++ b/cdsapi/api.py @@ -22,7 +22,6 @@ except ImportError: from urlparse import urljoin -from datapi.legacy_api_client import LegacyApiClient from tqdm import tqdm @@ -283,7 +282,9 @@ def __new__(cls, url=None, key=None, *args, **kwargs): if ":" in token: return super().__new__(cls) - return super().__new__(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 6f347a3..88c8d10 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ def read(fname): include_package_data=True, python_requires=">=3.8", install_requires=[ - # "datapi", + # "datapi", "requests>=2.5.0", "tqdm", ],