Skip to content

Commit 3c75ea5

Browse files
authored
Update sdk (#201)
* Update Globus SDK * Updates
1 parent fd50025 commit 3c75ea5

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

conda/dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
- pip=21.0.1
99
- python=3.7.10
1010
- six=1.16.0
11-
- globus-sdk=2.0.1
11+
- globus-sdk=3.2.1
1212
- fair-research-login=0.2.0
1313
# Developer Tools
1414
# =================

conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ requirements:
2222
run:
2323
- python >=3.6
2424
- six
25-
- globus-sdk >=2,<3
25+
- globus-sdk >=2
2626
- fair-research-login
2727

2828
test:

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
packages=find_packages(include=["zstash", "zstash.*"]),
1010
install_requires=[
1111
"six==1.16.0",
12-
"globus-sdk==2.0.1",
13-
"fair-research-login==0.2.0",
12+
"globus-sdk<4.0.0>=3.0.0",
13+
"fair-research-login==0.2.6",
1414
],
1515
entry_points={"console_scripts": ["zstash=zstash.main:main"]},
1616
)

tests/test_globus.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import unittest
77

88
from fair_research_login.client import NativeClient
9-
from globus_sdk import DeleteData, TransferClient
10-
from globus_sdk.exc import TransferAPIError
9+
from globus_sdk import DeleteData, TransferAPIError, TransferClient
1110

1211
from tests.base import TOP_LEVEL, ZSTASH_PATH, TestZstash, print_starred, run_cmd
1312

@@ -63,7 +62,7 @@ def preactivate_globus(self):
6362
transfer_authorizer = native_client.get_authorizers().get(
6463
"transfer.api.globus.org"
6564
)
66-
self.transfer_client = TransferClient(transfer_authorizer)
65+
self.transfer_client = TransferClient(authorizer=transfer_authorizer)
6766

6867
for ep_id in [hpss_globus_endpoint, local_endpoint]:
6968
r = self.transfer_client.endpoint_autoactivate(ep_id, if_expires_in=600)
@@ -96,7 +95,9 @@ def delete_files_globus(self):
9695
with 5 second timeout limit. If the task is ACTIVE after time runs
9796
out 'task_wait' returns False, and True otherwise.
9897
"""
99-
while not self.transfer_client.task_wait(task_id, 5, 5):
98+
while not self.transfer_client.task_wait(
99+
task_id, timeout=5, polling_interval=5
100+
):
100101
task = self.transfer_client.get_task(task_id)
101102
if task.get("is_paused"):
102103
break

zstash/globus.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import sys
88

99
from fair_research_login.client import NativeClient
10-
from globus_sdk import TransferClient, TransferData
11-
from globus_sdk.exc import TransferAPIError
10+
from globus_sdk import TransferAPIError, TransferClient, TransferData
1211

1312
from .settings import logger
1413

@@ -83,7 +82,7 @@ def globus_transfer( # noqa: C901
8382
)
8483
native_client.login(no_local_server=True, refresh_tokens=True)
8584
transfer_authorizer = native_client.get_authorizers().get("transfer.api.globus.org")
86-
tc = TransferClient(transfer_authorizer)
85+
tc = TransferClient(authorizer=transfer_authorizer)
8786

8887
for ep_id in [src_ep, dst_ep]:
8988
r = tc.endpoint_autoactivate(ep_id, if_expires_in=600)
@@ -134,7 +133,7 @@ def globus_transfer( # noqa: C901
134133
with 20 second timeout limit. If the task is ACTIVE after time runs
135134
out 'task_wait' returns False, and True otherwise.
136135
"""
137-
while not tc.task_wait(task_id, 20, 20):
136+
while not tc.task_wait(task_id, timeout=20, polling_interval=20):
138137
pass
139138
"""
140139
The Globus transfer job (task) has been finished (SUCCEEDED or FAILED).

0 commit comments

Comments
 (0)