fix: add missing shutil import in setup.py (fixes #5060) - #5108
Conversation
|
Correct one-line fix for a real crash path — Two of the local # hermes_cli/setup.py now has:
# line ~17: import shutil (this PR — good)
# line 1121: import shutil (redundant, dead-ish import)
# line 1308: import shutil (redundant, dead-ish import)ruff's Ship it — fixes the actual crash. The redundant-import cleanup can happen whenever someone touches those functions next. |
|
Thanks for the review! Agreed on the redundant imports — happy to clean those up in this PR if preferred, rather than waiting for a follow-up. @trevorgordon981 I see you've opened #5136 — should I incorporate that cleanup here, or would you prefer to keep them separate? |
7bafdf7 to
1afaa3a
Compare
Problem
When running
hermes setupwith E2EE enabled, the setup wizard crashes atline 2126 of
setup.pywithNameError: name 'shutil' is not defined.This happens because:
matrix-nio[e2e]fails to import (ModuleNotFoundError)uvviashutil.which("uv")shutilwas never imported at the module level — only locallyinside other functions (lines 951, 1397, 1513)
Fix
Add
import shutilat the top ofhermes_cli/setup.pyalongside theother standard library imports.
Fixes #5060