Skip to content

Commit

Permalink
FIX: bad import
Browse files Browse the repository at this point in the history
  • Loading branch information
d-krupke committed Feb 25, 2024
1 parent af19f32 commit 88b554e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/slurminade/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,4 @@ def join():
get_dispatcher().join()


from .function import slurmify


@slurmify()
def exec(cmd: typing.Union[str, typing.List[str]]):
"""
Execute a command.
:param cmd: The command to be executed.
"""
subprocess.run(cmd, check=True)
10 changes: 10 additions & 0 deletions src/slurminade/function.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import inspect
import typing
from enum import Enum
import subprocess

from .dispatcher import FunctionCall, dispatch, get_dispatcher
from .function_map import FunctionMap
Expand Down Expand Up @@ -189,3 +190,12 @@ def dec(func) -> SlurmFunction:
return SlurmFunction(args, func, func_id)

return dec


@slurmify()
def exec(cmd: typing.Union[str, typing.List[str]]):
"""
Execute a command.
:param cmd: The command to be executed.
"""
subprocess.run(cmd, check=True)

0 comments on commit 88b554e

Please sign in to comment.