Skip to content

Commit 4e96c1d

Browse files
committed
Some type annotation work:
For static checking: tell mypy to ignore missing imports - specifically Client when the globus compute SDK is not installed. For dynamic type annotations: tell Python to use deferred type resolution. This lets the module be imported even though the Client type annotation does not exist in some setups.
1 parent 4205969 commit 4e96c1d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

mypy.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ ignore_missing_imports = True
177177
#[mypy-multiprocessing.synchronization.*]
178178
#ignore_missing_imports = True
179179

180+
[mypy-globus_compute_sdk.*]
181+
ignore_missing_imports = True
182+
180183
[mypy-pandas.*]
181184
ignore_missing_imports = True
182185

parsl/executors/globus_compute.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import uuid
24
from concurrent.futures import Future
35
from typing import Any, Callable, Dict, Optional, Union
@@ -11,7 +13,6 @@
1113
_globus_compute_enabled = True
1214
except ImportError:
1315
_globus_compute_enabled = False
14-
Client: Any # type: ignore[no-redef]
1516

1617
UUID_LIKE_T = Union[uuid.UUID, str]
1718

0 commit comments

Comments
 (0)