| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ jobs: | |||
| 15 | 15 | runs-on: ubuntu-latest | |
| 16 | 16 | strategy: | |
| 17 | 17 | matrix: | |
| 18 | - python-version: [3.7, 3.8, 3.9, "3.10.0-beta.4"] | ||
| 18 | + python-version: [3.7, 3.7.5, 3.7.12, 3.8, 3.8.0, 3.8.11, 3.8, 3.9, 3.9.0, 3.9.7] # , "3.10.0-rc.2"] | ||
| 19 | 19 | ||
| 20 | 20 | steps: | |
| 21 | 21 | - uses: actions/checkout@v2 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,3 +22,4 @@ nbproject | |||
| 22 | 22 | .pytest_cache/ | |
| 23 | 23 | monkeytype.sqlite3 | |
| 24 | 24 | output.txt | |
| 25 | + tox.ini | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1 +1 @@ | |||
| 1 | - 3.1.20 | ||
| 1 | + 3.1.21 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,3 @@ | |||
| 1 | - sphinx==4.1.1 | ||
| 1 | + sphinx==4.1.2 | ||
| 2 | 2 | sphinx_rtd_theme | |
| 3 | 3 | sphinx-autodoc-typehints | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,32 +2,60 @@ | |||
| 2 | 2 | Changelog | |
| 3 | 3 | ========= | |
| 4 | 4 | ||
| 5 | - 3.1.20 | ||
| 5 | + 3.1.21 | ||
| 6 | 6 | ====== | |
| 7 | 7 | ||
| 8 | - * This is the second typed release with a lot of improvements under the hood. | ||
| 8 | + * This is the second typed release with a lot of improvements under the hood. | ||
| 9 | + | ||
| 10 | + * General: | ||
| 11 | + - Remove python 3.6 support | ||
| 12 | + - Remove distutils ahead of deprecation in standard library. | ||
| 13 | + - Update sphinx to 4.1.12 and use autodoc-typehints. | ||
| 14 | + | ||
| 15 | + * Typing: | ||
| 16 | + - Add types to ALL functions. | ||
| 17 | + - Ensure py.typed is collected. | ||
| 18 | + - Increase mypy strictness with disallow_untyped_defs, warn_redundant_casts, warn_unreachable. | ||
| 19 | + - Use typing.NamedTuple and typing.OrderedDict now 3.6 dropped. | ||
| 20 | + - Make Protocol classes ABCs at runtime due to new bug in 3.10.0-rc1 | ||
| 21 | + - Remove use of typing.TypeGuard until later release, to allow dependant libs time to update. | ||
| 22 | + - Tracking issue: https://github.com/gitpython-developers/GitPython/issues/1095 | ||
| 23 | + | ||
| 24 | + * Runtime improvements: | ||
| 25 | + - Add clone_multi_options support to submodule.add() | ||
| 26 | + - Delay calling get_user_id() unless essential, to support sand-boxed environments. | ||
| 27 | + - Add timeout to handle_process_output(), in case thread.join() hangs. | ||
| 28 | + | ||
| 29 | + See the following for details: | ||
| 30 | + https://github.com/gitpython-developers/gitpython/milestone/52?closed=1 | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + 3.1.20 (YANKED) | ||
| 34 | + =============== | ||
| 35 | + | ||
| 36 | + * This is the second typed release with a lot of improvements under the hood. | ||
| 9 | 37 | * Tracking issue: https://github.com/gitpython-developers/GitPython/issues/1095 | |
| 10 | - | ||
| 38 | + | ||
| 11 | 39 | See the following for details: | |
| 12 | - https://github.com/gitpython-developers/gitpython/milestone/52?closed=1 | ||
| 40 | + https://github.com/gitpython-developers/gitpython/milestone/52?closed=1 | ||
| 13 | 41 | ||
| 14 | 42 | ||
| 15 | 43 | 3.1.19 (YANKED) | |
| 16 | 44 | =============== | |
| 17 | 45 | ||
| 18 | - * This is the second typed release with a lot of improvements under the hood. | ||
| 46 | + * This is the second typed release with a lot of improvements under the hood. | ||
| 19 | 47 | * Tracking issue: https://github.com/gitpython-developers/GitPython/issues/1095 | |
| 20 | - | ||
| 48 | + | ||
| 21 | 49 | See the following for details: | |
| 22 | - https://github.com/gitpython-developers/gitpython/milestone/51?closed=1 | ||
| 50 | + https://github.com/gitpython-developers/gitpython/milestone/51?closed=1 | ||
| 23 | 51 | ||
| 24 | 52 | 3.1.18 | |
| 25 | 53 | ====== | |
| 26 | 54 | ||
| 27 | 55 | * drop support for python 3.5 to reduce maintenance burden on typing. Lower patch levels of python 3.5 would break, too. | |
| 28 | 56 | ||
| 29 | 57 | See the following for details: | |
| 30 | - https://github.com/gitpython-developers/gitpython/milestone/50?closed=1 | ||
| 58 | + https://github.com/gitpython-developers/gitpython/milestone/50?closed=1 | ||
| 31 | 59 | ||
| 32 | 60 | 3.1.17 | |
| 33 | 61 | ====== | |
@@ -37,7 +65,7 @@ https://github.com/gitpython-developers/gitpython/milestone/50?closed=1 | |||
| 37 | 65 | * Add more static typing information | |
| 38 | 66 | ||
| 39 | 67 | See the following for details: | |
| 40 | - https://github.com/gitpython-developers/gitpython/milestone/49?closed=1 | ||
| 68 | + https://github.com/gitpython-developers/gitpython/milestone/49?closed=1 | ||
| 41 | 69 | ||
| 42 | 70 | 3.1.16 (YANKED) | |
| 43 | 71 | =============== | |
@@ -46,15 +74,15 @@ https://github.com/gitpython-developers/gitpython/milestone/49?closed=1 | |||
| 46 | 74 | * Add more static typing information | |
| 47 | 75 | ||
| 48 | 76 | See the following for details: | |
| 49 | - https://github.com/gitpython-developers/gitpython/milestone/48?closed=1 | ||
| 77 | + https://github.com/gitpython-developers/gitpython/milestone/48?closed=1 | ||
| 50 | 78 | ||
| 51 | 79 | 3.1.15 (YANKED) | |
| 52 | 80 | =============== | |
| 53 | 81 | ||
| 54 | 82 | * add deprectation warning for python 3.5 | |
| 55 | 83 | ||
| 56 | 84 | See the following for details: | |
| 57 | - https://github.com/gitpython-developers/gitpython/milestone/47?closed=1 | ||
| 85 | + https://github.com/gitpython-developers/gitpython/milestone/47?closed=1 | ||
| 58 | 86 | ||
| 59 | 87 | 3.1.14 | |
| 60 | 88 | ====== | |
@@ -65,40 +93,40 @@ https://github.com/gitpython-developers/gitpython/milestone/47?closed=1 | |||
| 65 | 93 | * Drop python 3.4 support | |
| 66 | 94 | ||
| 67 | 95 | See the following for details: | |
| 68 | - https://github.com/gitpython-developers/gitpython/milestone/46?closed=1 | ||
| 96 | + https://github.com/gitpython-developers/gitpython/milestone/46?closed=1 | ||
| 69 | 97 | ||
| 70 | 98 | 3.1.13 | |
| 71 | 99 | ====== | |
| 72 | 100 | ||
| 73 | 101 | See the following for details: | |
| 74 | - https://github.com/gitpython-developers/gitpython/milestone/45?closed=1 | ||
| 102 | + https://github.com/gitpython-developers/gitpython/milestone/45?closed=1 | ||
| 75 | 103 | ||
| 76 | 104 | 3.1.12 | |
| 77 | 105 | ====== | |
| 78 | 106 | ||
| 79 | 107 | See the following for details: | |
| 80 | - https://github.com/gitpython-developers/gitpython/milestone/44?closed=1 | ||
| 108 | + https://github.com/gitpython-developers/gitpython/milestone/44?closed=1 | ||
| 81 | 109 | ||
| 82 | 110 | 3.1.11 | |
| 83 | 111 | ====== | |
| 84 | 112 | ||
| 85 | 113 | Fixes regression of 3.1.10. | |
| 86 | 114 | ||
| 87 | 115 | See the following for details: | |
| 88 | - https://github.com/gitpython-developers/gitpython/milestone/43?closed=1 | ||
| 116 | + https://github.com/gitpython-developers/gitpython/milestone/43?closed=1 | ||
| 89 | 117 | ||
| 90 | 118 | 3.1.10 | |
| 91 | 119 | ====== | |
| 92 | 120 | ||
| 93 | 121 | See the following for details: | |
| 94 | - https://github.com/gitpython-developers/gitpython/milestone/42?closed=1 | ||
| 122 | + https://github.com/gitpython-developers/gitpython/milestone/42?closed=1 | ||
| 95 | 123 | ||
| 96 | 124 | ||
| 97 | 125 | 3.1.9 | |
| 98 | 126 | ===== | |
| 99 | 127 | ||
| 100 | 128 | See the following for details: | |
| 101 | - https://github.com/gitpython-developers/gitpython/milestone/41?closed=1 | ||
| 129 | + https://github.com/gitpython-developers/gitpython/milestone/41?closed=1 | ||
| 102 | 130 | ||
| 103 | 131 | ||
| 104 | 132 | 3.1.8 | |
@@ -109,7 +137,7 @@ https://github.com/gitpython-developers/gitpython/milestone/41?closed=1 | |||
| 109 | 137 | ||
| 110 | 138 | ||
| 111 | 139 | See the following for more details: | |
| 112 | - https://github.com/gitpython-developers/gitpython/milestone/40?closed=1 | ||
| 140 | + https://github.com/gitpython-developers/gitpython/milestone/40?closed=1 | ||
| 113 | 141 | ||
| 114 | 142 | ||
| 115 | 143 | 3.1.7 | |
@@ -135,13 +163,13 @@ https://github.com/gitpython-developers/gitpython/milestone/40?closed=1 | |||
| 135 | 163 | * package size was reduced significantly not placing tests into the package anymore. | |
| 136 | 164 | ||
| 137 | 165 | See the following for details: | |
| 138 | - https://github.com/gitpython-developers/gitpython/milestone/39?closed=1 | ||
| 166 | + https://github.com/gitpython-developers/gitpython/milestone/39?closed=1 | ||
| 139 | 167 | ||
| 140 | 168 | 3.1.3 | |
| 141 | 169 | ===== | |
| 142 | 170 | ||
| 143 | 171 | See the following for details: | |
| 144 | - https://github.com/gitpython-developers/gitpython/milestone/38?closed=1 | ||
| 172 | + https://github.com/gitpython-developers/gitpython/milestone/38?closed=1 | ||
| 145 | 173 | ||
| 146 | 174 | 3.1.2 | |
| 147 | 175 | ===== | |
@@ -190,7 +218,7 @@ Bugfixes | |||
| 190 | 218 | Bugfixes | |
| 191 | 219 | -------- | |
| 192 | 220 | ||
| 193 | - * Fixed Repo.__repr__ when subclassed | ||
| 221 | + * Fixed Repo.__repr__ when subclassed | ||
| 194 | 222 | (`#968 <https://github.com/gitpython-developers/GitPython/pull/968>`_) | |
| 195 | 223 | * Removed compatibility shims for Python < 3.4 and old mock library | |
| 196 | 224 | * Replaced usage of deprecated unittest aliases and Logger.warn | |
@@ -213,7 +241,7 @@ Bugfixes | |||
| 213 | 241 | -------- | |
| 214 | 242 | ||
| 215 | 243 | * Fixed warning for usage of environment variables for paths containing ``$`` or ``%`` | |
| 216 | - (`#832 <https://github.com/gitpython-developers/GitPython/issues/832>`_, | ||
| 244 | + (`#832 <https://github.com/gitpython-developers/GitPython/issues/832>`_, | ||
| 217 | 245 | `#961 <https://github.com/gitpython-developers/GitPython/pull/961>`_) | |
| 218 | 246 | * Added support for parsing Git internal date format (@<unix timestamp> <timezone offset>) | |
| 219 | 247 | (`#965 <https://github.com/gitpython-developers/GitPython/pull/965>`_) | |
@@ -371,7 +399,7 @@ Notable fixes | |||
| 371 | 399 | * The `GIT_DIR` environment variable does not override the `path` argument when | |
| 372 | 400 | initializing a `Repo` object anymore. However, if said `path` unset, `GIT_DIR` | |
| 373 | 401 | will be used to fill the void. | |
| 374 | - | ||
| 402 | + | ||
| 375 | 403 | All issues and PRs can be viewed in all detail when following this URL: | |
| 376 | 404 | https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone%3A%22v2.1.0+-+proper+windows+support%22 | |
| 377 | 405 | ||
@@ -401,7 +429,7 @@ https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone | |||
| 401 | 429 | 2.0.7 - New Features | |
| 402 | 430 | ==================== | |
| 403 | 431 | ||
| 404 | - * `IndexFile.commit(...,skip_hooks=False)` added. This parameter emulates the | ||
| 432 | + * `IndexFile.commit(...,skip_hooks=False)` added. This parameter emulates the | ||
| 405 | 433 | behaviour of `--no-verify` on the command-line. | |
| 406 | 434 | ||
| 407 | 435 | 2.0.6 - Fixes and Features | |
@@ -441,7 +469,7 @@ https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone | |||
| 441 | 469 | commit messages contained ``\r`` characters | |
| 442 | 470 | * Fix: progress handler exceptions are not caught anymore, which would usually just hide bugs | |
| 443 | 471 | previously. | |
| 444 | - * Fix: The `Git.execute` method will now redirect `stdout` to `devnull` if `with_stdout` is false, | ||
| 472 | + * Fix: The `Git.execute` method will now redirect `stdout` to `devnull` if `with_stdout` is false, | ||
| 445 | 473 | which is the intended behaviour based on the parameter's documentation. | |
| 446 | 474 | ||
| 447 | 475 | 2.0.2 - Fixes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,7 @@ | |||
| 3 | 3 | # | |
| 4 | 4 | # This module is part of GitPython and is released under | |
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | - | ||
| 6 | + from __future__ import annotations | ||
| 7 | 7 | from contextlib import contextmanager | |
| 8 | 8 | import io | |
| 9 | 9 | import logging | |
@@ -68,7 +68,7 @@ | |||
| 68 | 68 | # Documentation | |
| 69 | 69 | ## @{ | |
| 70 | 70 | ||
| 71 | - def handle_process_output(process: Union[subprocess.Popen, 'Git.AutoInterrupt'], | ||
| 71 | + def handle_process_output(process: 'Git.AutoInterrupt' | Popen, | ||
| 72 | 72 | stdout_handler: Union[None, | |
| 73 | 73 | Callable[[AnyStr], None], | |
| 74 | 74 | Callable[[List[AnyStr]], None], | |
@@ -78,7 +78,8 @@ def handle_process_output(process: Union[subprocess.Popen, 'Git.AutoInterrupt'], | |||
| 78 | 78 | Callable[[List[AnyStr]], None]], | |
| 79 | 79 | finalizer: Union[None, | |
| 80 | 80 | Callable[[Union[subprocess.Popen, 'Git.AutoInterrupt']], None]] = None, | |
| 81 | - decode_streams: bool = True) -> None: | ||
| 81 | + decode_streams: bool = True, | ||
| 82 | + timeout: float = 10.0) -> None: | ||
| 82 | 83 | """Registers for notifications to learn that process output is ready to read, and dispatches lines to | |
| 83 | 84 | the respective line handlers. | |
| 84 | 85 | This function returns once the finalizer returns | |
@@ -93,9 +94,10 @@ def handle_process_output(process: Union[subprocess.Popen, 'Git.AutoInterrupt'], | |||
| 93 | 94 | their contents to handlers. | |
| 94 | 95 | Set it to False if `universal_newline == True` (then streams are in text-mode) | |
| 95 | 96 | or if decoding must happen later (i.e. for Diffs). | |
| 97 | + :param timeout: float, timeout to pass to t.join() in case it hangs. Default = 10.0 seconds | ||
| 96 | 98 | """ | |
| 97 | 99 | # Use 2 "pump" threads and wait for both to finish. | |
| 98 | - def pump_stream(cmdline: str, name: str, stream: Union[BinaryIO, TextIO], is_decode: bool, | ||
| 100 | + def pump_stream(cmdline: List[str], name: str, stream: Union[BinaryIO, TextIO], is_decode: bool, | ||
| 99 | 101 | handler: Union[None, Callable[[Union[bytes, str]], None]]) -> None: | |
| 100 | 102 | try: | |
| 101 | 103 | for line in stream: | |
@@ -107,22 +109,32 @@ def pump_stream(cmdline: str, name: str, stream: Union[BinaryIO, TextIO], is_dec | |||
| 107 | 109 | else: | |
| 108 | 110 | handler(line) | |
| 109 | 111 | except Exception as ex: | |
| 110 | - log.error("Pumping %r of cmd(%s) failed due to: %r", name, remove_password_if_present(cmdline), ex) | ||
| 111 | - raise CommandError(['<%s-pump>' % name] + remove_password_if_present(cmdline), ex) from ex | ||
| 112 | + log.error(f"Pumping {name!r} of cmd({remove_password_if_present(cmdline)}) failed due to: {ex!r}") | ||
| 113 | + raise CommandError([f'<{name}-pump>'] + remove_password_if_present(cmdline), ex) from ex | ||
| 112 | 114 | finally: | |
| 113 | 115 | stream.close() | |
| 114 | 116 | ||
| 115 | - cmdline = getattr(process, 'args', '') # PY3+ only | ||
| 117 | + if hasattr(process, 'proc'): | ||
| 118 | + process = cast('Git.AutoInterrupt', process) | ||
| 119 | + cmdline: str | Tuple[str, ...] | List[str] = getattr(process.proc, 'args', '') | ||
| 120 | + p_stdout = process.proc.stdout if process.proc else None | ||
| 121 | + p_stderr = process.proc.stderr if process.proc else None | ||
| 122 | + else: | ||
| 123 | + process = cast(Popen, process) | ||
| 124 | + cmdline = getattr(process, 'args', '') | ||
| 125 | + p_stdout = process.stdout | ||
| 126 | + p_stderr = process.stderr | ||
| 127 | + | ||
| 116 | 128 | if not isinstance(cmdline, (tuple, list)): | |
| 117 | 129 | cmdline = cmdline.split() | |
| 118 | 130 | ||
| 119 | - pumps = [] | ||
| 120 | - if process.stdout: | ||
| 121 | - pumps.append(('stdout', process.stdout, stdout_handler)) | ||
| 122 | - if process.stderr: | ||
| 123 | - pumps.append(('stderr', process.stderr, stderr_handler)) | ||
| 131 | + pumps: List[Tuple[str, IO, Callable[..., None] | None]] = [] | ||
| 132 | + if p_stdout: | ||
| 133 | + pumps.append(('stdout', p_stdout, stdout_handler)) | ||
| 134 | + if p_stderr: | ||
| 135 | + pumps.append(('stderr', p_stderr, stderr_handler)) | ||
| 124 | 136 | ||
| 125 | - threads = [] | ||
| 137 | + threads: List[threading.Thread] = [] | ||
| 126 | 138 | ||
| 127 | 139 | for name, stream, handler in pumps: | |
| 128 | 140 | t = threading.Thread(target=pump_stream, | |
@@ -134,7 +146,9 @@ def pump_stream(cmdline: str, name: str, stream: Union[BinaryIO, TextIO], is_dec | |||
| 134 | 146 | ## FIXME: Why Join?? Will block if `stdin` needs feeding... | |
| 135 | 147 | # | |
| 136 | 148 | for t in threads: | |
| 137 | - t.join() | ||
| 149 | + t.join(timeout=timeout) | ||
| 150 | + if t.is_alive(): | ||
| 151 | + raise RuntimeError(f"Thread join() timed out in cmd.handle_process_output(). Timeout={timeout} seconds") | ||
| 138 | 152 | ||
| 139 | 153 | if finalizer: | |
| 140 | 154 | return finalizer(process) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ | |||
| 31 | 31 | # typing------------------------------------------------------- | |
| 32 | 32 | ||
| 33 | 33 | from typing import (Any, Callable, Generic, IO, List, Dict, Sequence, | |
| 34 | - TYPE_CHECKING, Tuple, TypeVar, Union, cast, overload) | ||
| 34 | + TYPE_CHECKING, Tuple, TypeVar, Union, cast) | ||
| 35 | 35 | ||
| 36 | 36 | from git.types import Lit_config_levels, ConfigLevels_Tup, PathLike, assert_never, _T | |
| 37 | 37 | ||
@@ -709,15 +709,6 @@ def read_only(self) -> bool: | |||
| 709 | 709 | """:return: True if this instance may change the configuration file""" | |
| 710 | 710 | return self._read_only | |
| 711 | 711 | ||
| 712 | - @overload | ||
| 713 | - def get_value(self, section: str, option: str, default: None = None) -> Union[int, float, str, bool]: ... | ||
| 714 | - | ||
| 715 | - @overload | ||
| 716 | - def get_value(self, section: str, option: str, default: str) -> str: ... | ||
| 717 | - | ||
| 718 | - @overload | ||
| 719 | - def get_value(self, section: str, option: str, default: float) -> float: ... | ||
| 720 | - | ||
| 721 | 712 | def get_value(self, section: str, option: str, default: Union[int, float, str, bool, None] = None | |
| 722 | 713 | ) -> Union[int, float, str, bool]: | |
| 723 | 714 | # can default or return type include bool? | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -446,6 +446,8 @@ def create_from_tree(cls, repo: 'Repo', tree: Union[Tree, str], message: str, | |||
| 446 | 446 | # assume utf8 encoding | |
| 447 | 447 | enc_section, enc_option = cls.conf_encoding.split('.') | |
| 448 | 448 | conf_encoding = cr.get_value(enc_section, enc_option, cls.default_encoding) | |
| 449 | + if not isinstance(conf_encoding, str): | ||
| 450 | + raise TypeError("conf_encoding could not be coerced to str") | ||
| 449 | 451 | ||
| 450 | 452 | # if the tree is no object, make sure we create one - otherwise | |
| 451 | 453 | # the created commit object is invalid | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | """Module for general utility functions""" | |
| 7 | 7 | ||
| 8 | - from abc import abstractmethod | ||
| 8 | + from abc import ABC, abstractmethod | ||
| 9 | 9 | import warnings | |
| 10 | 10 | from git.util import ( | |
| 11 | 11 | IterableList, | |
@@ -22,10 +22,10 @@ | |||
| 22 | 22 | from datetime import datetime, timedelta, tzinfo | |
| 23 | 23 | ||
| 24 | 24 | # typing ------------------------------------------------------------ | |
| 25 | - from typing import (Any, Callable, Deque, Iterator, NamedTuple, overload, Sequence, | ||
| 25 | + from typing import (Any, Callable, Deque, Iterator, Generic, NamedTuple, overload, Sequence, # NOQA: F401 | ||
| 26 | 26 | TYPE_CHECKING, Tuple, Type, TypeVar, Union, cast) | |
| 27 | 27 | ||
| 28 | - from git.types import Has_id_attribute, Literal, Protocol, runtime_checkable | ||
| 28 | + from git.types import Has_id_attribute, Literal, _T # NOQA: F401 | ||
| 29 | 29 | ||
| 30 | 30 | if TYPE_CHECKING: | |
| 31 | 31 | from io import BytesIO, StringIO | |
@@ -35,6 +35,13 @@ | |||
| 35 | 35 | from .tree import Tree, TraversedTreeTup | |
| 36 | 36 | from subprocess import Popen | |
| 37 | 37 | from .submodule.base import Submodule | |
| 38 | + from git.types import Protocol, runtime_checkable | ||
| 39 | + else: | ||
| 40 | + # Protocol = Generic[_T] # NNeeded for typing bug #572? | ||
| 41 | + Protocol = ABC | ||
| 42 | + | ||
| 43 | + def runtime_checkable(f): | ||
| 44 | + return f | ||
| 38 | 45 | ||
| 39 | 46 | ||
| 40 | 47 | class TraverseNT(NamedTuple): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments