Skip to content

Commit

Permalink
Some type annotation work:
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
benclifford committed Oct 24, 2024
1 parent 4205969 commit 4e96c1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ ignore_missing_imports = True
#[mypy-multiprocessing.synchronization.*]
#ignore_missing_imports = True

[mypy-globus_compute_sdk.*]
ignore_missing_imports = True

[mypy-pandas.*]
ignore_missing_imports = True

Expand Down
3 changes: 2 additions & 1 deletion parsl/executors/globus_compute.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import uuid
from concurrent.futures import Future
from typing import Any, Callable, Dict, Optional, Union
Expand All @@ -11,7 +13,6 @@
_globus_compute_enabled = True
except ImportError:
_globus_compute_enabled = False
Client: Any # type: ignore[no-redef]

UUID_LIKE_T = Union[uuid.UUID, str]

Expand Down

0 comments on commit 4e96c1d

Please sign in to comment.