The error is due to the fact that psutil is included in the tests optional-dependencies only, although it seems like it is needed by the Audit features.
Can you replicate the behavior? If yes, how?
Yes, here is how :
Create a test_pydra_tutorial.py file containing:
# Contents of test_pydra_tutorial.py
from pydra.mark import task
from pydra.utils.messenger import AuditFlag, PrintMessenger
@task
def add_var(a: int, b: int) -> {'out': int}:
return a+b
task0 = add_var(
a = 4, b = 5,
audit_flags = AuditFlag.RESOURCE # This line causes the error
)
task0()
print(task0.result())
What version of Pydra are you using?
0.23 (Python 3.10.11)
What were you trying to do?
Following the tutorial (commit e1c91e3) for FunctionTask#Using Audit part.
What did you expect will happen?
I expected the provided code to run nicely.
What actually happened?
The error is due to the fact that
psutil
is included in thetests
optional-dependencies only, although it seems like it is needed by theAudit
features.Can you replicate the behavior? If yes, how?
Yes, here is how :
Create a
test_pydra_tutorial.py
file containing:Create a virtualenv and activate it
Then inside the virtualenv