`AttributeError` when running `showyourwork clean --deep`
wtbarnes opened this issue · comments
Will Barnes commented
When doing a "deep clean" of the environment, with showyourwork clean --deep
, I get the following exception,
Building DAG of jobs...
Traceback (most recent call last):
File "/Users/wtbarnes/mambaforge/bin/showyourwork", line 8, in <module>
sys.exit(entry_point())
File "/Users/wtbarnes/mambaforge/lib/python3.9/site-packages/showyourwork/cli/__init__.py", line 59, in entry_point
main()
File "/Users/wtbarnes/mambaforge/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/Users/wtbarnes/mambaforge/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/wtbarnes/mambaforge/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/wtbarnes/mambaforge/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/wtbarnes/mambaforge/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/wtbarnes/mambaforge/lib/python3.9/site-packages/showyourwork/cli/main.py", line 300, in clean
commands.clean(
File "/Users/wtbarnes/mambaforge/lib/python3.9/site-packages/showyourwork/cli/commands/clean.py", line 42, in clean
if paths.user().home_temp.exists():
AttributeError: 'user' object has no attribute 'home_temp'
As far as I can tell, there is no home_temp
attribute exposed on paths.user()
:
showyourwork/showyourwork/paths.py
Lines 54 to 77 in 8038af8
temp
?Dan Foreman-Mackey commented
Thanks for the report! It looks like temp
is cleaned up above, so I expect this should just be removed. Would you be willing to open a PR?
Will Barnes commented
Sure! Is this just a matter of removing the last conditional inside of the if deep
conditional?
Dan Foreman-Mackey commented
Great! Yeah - that seems like it should do the trick. Thanks!