|
36 | 36 | from functools import reduce, wraps |
37 | 37 | from sys import intern |
38 | 38 | from typing import ( |
39 | | - Any, Callable, cast, ClassVar, Dict, Generic, Hashable, Iterable, List, Mapping, |
40 | | - Optional, Set, Tuple, Type, TypeVar, Union, ValuesView, KeysView, |
41 | | - ItemsView, Sequence, Generator, TYPE_CHECKING) |
| 39 | + TYPE_CHECKING, Any, Callable, ClassVar, Dict, Generator, Generic, Hashable, |
| 40 | + ItemsView, Iterable, KeysView, List, Mapping, Optional, Sequence, Set, Tuple, |
| 41 | + Type, TypeVar, Union, ValuesView, cast) |
42 | 42 |
|
43 | 43 |
|
44 | 44 | if TYPE_CHECKING: |
45 | 45 | import numpy as np |
46 | 46 |
|
| 47 | +if getattr(sys, "_BUILDING_SPHINX_DOCS", False): |
| 48 | + import numpy as np # noqa: F811 |
| 49 | + |
47 | 50 |
|
48 | 51 | try: |
49 | 52 | from typing import Concatenate |
@@ -2475,11 +2478,11 @@ def find_git_revision(tree_root: str) \ |
2475 | 2478 | return git_rev |
2476 | 2479 |
|
2477 | 2480 |
|
2478 | | -def find_module_git_revision(module_file, n_levels_up): |
| 2481 | +def find_module_git_revision(module_file: str, n_levels_up: int) -> Optional[bytes]: |
2479 | 2482 | from os.path import dirname, join |
2480 | 2483 | tree_root = join(*([dirname(module_file)] + [".." * n_levels_up])) |
2481 | 2484 |
|
2482 | | - return find_git_revision(tree_root) # type: ignore[no-untyped-call] |
| 2485 | + return find_git_revision(tree_root) |
2483 | 2486 |
|
2484 | 2487 | # }}} |
2485 | 2488 |
|
|
0 commit comments