(hook: Hook)
| 44 | |
| 45 | |
| 46 | def _hook_installed(hook: Hook) -> bool: |
| 47 | lang = languages[hook.language] |
| 48 | if lang.ENVIRONMENT_DIR is None: |
| 49 | return True |
| 50 | |
| 51 | venv = environment_dir( |
| 52 | hook.prefix, |
| 53 | lang.ENVIRONMENT_DIR, |
| 54 | hook.language_version, |
| 55 | ) |
| 56 | return ( |
| 57 | ( |
| 58 | os.path.exists(_state_filename_v2(venv)) or |
| 59 | _read_state(venv) == _state(hook.additional_dependencies) |
| 60 | ) and |
| 61 | not lang.health_check(hook.prefix, hook.language_version) |
| 62 | ) |
| 63 | |
| 64 | |
| 65 | def _hook_install(hook: Hook) -> None: |