Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psutil dependency missing for Audit features #760

Open
bclenet opened this issue Jun 27, 2024 · 0 comments
Open

psutil dependency missing for Audit features #760

bclenet opened this issue Jun 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bclenet
Copy link

bclenet commented Jun 27, 2024

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?

ModuleNotFoundError: No module named 'psutil'

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())

Create a virtualenv and activate it

virtualenv pydra_test_venv
source pydra_test_venv/bin/activate

Then inside the virtualenv

pip install pydra
python test_pydra_tutorial.py
@bclenet bclenet added the bug Something isn't working label Jun 27, 2024
@bclenet bclenet changed the title psutil dependency psutil dependency missing for Audit features Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant