diff --git a/conda/dev.yml b/conda/dev.yml index dddfcbb2..8f121ce3 100644 --- a/conda/dev.yml +++ b/conda/dev.yml @@ -8,7 +8,7 @@ dependencies: - pip=21.0.1 - python=3.7.10 - six=1.16.0 - - globus-sdk=2.0.1 + - globus-sdk=3.2.1 - fair-research-login=0.2.0 # Developer Tools # ================= diff --git a/conda/meta.yaml b/conda/meta.yaml index f96bbbd0..ca7edcf3 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -22,7 +22,7 @@ requirements: run: - python >=3.6 - six - - globus-sdk >=2,<3 + - globus-sdk >=2 - fair-research-login test: diff --git a/setup.py b/setup.py index 6feca374..498b4b03 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,8 @@ packages=find_packages(include=["zstash", "zstash.*"]), install_requires=[ "six==1.16.0", - "globus-sdk==2.0.1", - "fair-research-login==0.2.0", + "globus-sdk<4.0.0>=3.0.0", + "fair-research-login==0.2.6", ], entry_points={"console_scripts": ["zstash=zstash.main:main"]}, ) diff --git a/tests/test_globus.py b/tests/test_globus.py index 9ff7443e..9d9aede1 100644 --- a/tests/test_globus.py +++ b/tests/test_globus.py @@ -6,8 +6,7 @@ import unittest from fair_research_login.client import NativeClient -from globus_sdk import DeleteData, TransferClient -from globus_sdk.exc import TransferAPIError +from globus_sdk import DeleteData, TransferAPIError, TransferClient from tests.base import TOP_LEVEL, ZSTASH_PATH, TestZstash, print_starred, run_cmd @@ -63,7 +62,7 @@ def preactivate_globus(self): transfer_authorizer = native_client.get_authorizers().get( "transfer.api.globus.org" ) - self.transfer_client = TransferClient(transfer_authorizer) + self.transfer_client = TransferClient(authorizer=transfer_authorizer) for ep_id in [hpss_globus_endpoint, local_endpoint]: r = self.transfer_client.endpoint_autoactivate(ep_id, if_expires_in=600) @@ -96,7 +95,9 @@ def delete_files_globus(self): with 5 second timeout limit. If the task is ACTIVE after time runs out 'task_wait' returns False, and True otherwise. """ - while not self.transfer_client.task_wait(task_id, 5, 5): + while not self.transfer_client.task_wait( + task_id, timeout=5, polling_interval=5 + ): task = self.transfer_client.get_task(task_id) if task.get("is_paused"): break diff --git a/zstash/globus.py b/zstash/globus.py index 64267c1a..07a877f7 100644 --- a/zstash/globus.py +++ b/zstash/globus.py @@ -7,8 +7,7 @@ import sys from fair_research_login.client import NativeClient -from globus_sdk import TransferClient, TransferData -from globus_sdk.exc import TransferAPIError +from globus_sdk import TransferAPIError, TransferClient, TransferData from .settings import logger @@ -83,7 +82,7 @@ def globus_transfer( # noqa: C901 ) native_client.login(no_local_server=True, refresh_tokens=True) transfer_authorizer = native_client.get_authorizers().get("transfer.api.globus.org") - tc = TransferClient(transfer_authorizer) + tc = TransferClient(authorizer=transfer_authorizer) for ep_id in [src_ep, dst_ep]: r = tc.endpoint_autoactivate(ep_id, if_expires_in=600) @@ -134,7 +133,7 @@ def globus_transfer( # noqa: C901 with 20 second timeout limit. If the task is ACTIVE after time runs out 'task_wait' returns False, and True otherwise. """ - while not tc.task_wait(task_id, 20, 20): + while not tc.task_wait(task_id, timeout=20, polling_interval=20): pass """ The Globus transfer job (task) has been finished (SUCCEEDED or FAILED).