Check if a dependency is importable, otherwise raise an error.
(module_name: str, backend: Backend, extra: str)
| 14 | |
| 15 | |
| 16 | def _require(module_name: str, backend: Backend, extra: str) -> None: |
| 17 | """Check if a dependency is importable, otherwise raise an error.""" |
| 18 | if find_spec(module_name) is None: |
| 19 | raise OptionalDependencyError(backend, extra) |
| 20 | |
| 21 | |
| 22 | def get_backend_class(backend: Backend | str) -> type[AbstractBackend]: |
no test coverage detected
searching dependent graphs…