Skip to content

Commit

Permalink
wrap import covalent for convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
araghukas committed Jan 18, 2024
1 parent 54ccaf0 commit bfed86e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion covalent_slurm_plugin/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
import cloudpickle as pickle


def _import_covalent() -> None:
# Wrapped import for convenience in testing.
import covalent


def _check_setup() -> None:
"""Use these checks to create more informative error messages."""

Expand All @@ -33,7 +38,7 @@ def _check_setup() -> None:
try:
# covalent is needed because the @electron function
# executes inside `wrapper_fn` to apply deps
import covalent
_import_covalent()

except ImportError as _exception:
msg = "The covalent SDK is not installed in the Slurm job environment."
Expand Down

0 comments on commit bfed86e

Please sign in to comment.