Skip to content

Commit

Permalink
Migrate to datapi (#132)
Browse files Browse the repository at this point in the history
* use datapi dependency
  • Loading branch information
malmans2 authored Nov 19, 2024
1 parent c1eb4d9 commit cdcde16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions cdsapi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

import cads_api_client.legacy_api_client
import datapi.legacy_api_client
import pytest

import cdsapi
Expand Down Expand Up @@ -33,7 +33,7 @@ def test_request():
),
(
"",
cads_api_client.legacy_api_client.LegacyApiClient,
datapi.legacy_api_client.LegacyApiClient,
),
],
)
Expand Down

0 comments on commit cdcde16

Please sign in to comment.