| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,9 +88,12 @@ jobs: | |||
| 88 | 88 | ||
| 89 | 89 | - name: Check types with mypy | |
| 90 | 90 | run: | | |
| 91 | - mypy -p git | ||
| 92 | - # With new versions of mypy new issues might arise. This is a problem if there is nobody able to fix them, | ||
| 93 | - # so we have to ignore errors until that changes. | ||
| 91 | + mypy --python-version=${{ matrix.python-version }} -p git | ||
| 92 | + env: | ||
| 93 | + MYPY_FORCE_COLOR: "1" | ||
| 94 | + TERM: "xterm-256color" # For color: https://github.com/python/mypy/issues/13817 | ||
| 95 | + # With new versions of mypy new issues might arise. This is a problem if there is | ||
| 96 | + # nobody able to fix them, so we have to ignore errors until that changes. | ||
| 94 | 97 | continue-on-error: true | |
| 95 | 98 | ||
| 96 | 99 | - name: Test with pytest | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,38 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | 6 | # @PydevCodeAnalysisIgnore | |
| 7 | 7 | ||
| 8 | - __version__ = "git" | ||
| 9 | - | ||
| 10 | - from typing import List, Optional, Sequence, Tuple, Union, TYPE_CHECKING | ||
| 11 | - | ||
| 12 | - from gitdb.util import to_hex_sha | ||
| 13 | - from git.exc import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 14 | - from git.types import PathLike | ||
| 15 | - | ||
| 16 | - try: | ||
| 17 | - from git.compat import safe_decode # @NoMove @IgnorePep8 | ||
| 18 | - from git.config import GitConfigParser # @NoMove @IgnorePep8 | ||
| 19 | - from git.objects import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 20 | - from git.refs import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 21 | - from git.diff import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 22 | - from git.db import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 23 | - from git.cmd import Git # @NoMove @IgnorePep8 | ||
| 24 | - from git.repo import Repo # @NoMove @IgnorePep8 | ||
| 25 | - from git.remote import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 26 | - from git.index import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 27 | - from git.util import ( # @NoMove @IgnorePep8 | ||
| 28 | - LockFile, | ||
| 29 | - BlockingLockFile, | ||
| 30 | - Stats, | ||
| 31 | - Actor, | ||
| 32 | - remove_password_if_present, | ||
| 33 | - rmtree, | ||
| 34 | - ) | ||
| 35 | - except GitError as _exc: # noqa: F405 | ||
| 36 | - raise ImportError("%s: %s" % (_exc.__class__.__name__, _exc)) from _exc | ||
| 37 | - | ||
| 38 | - # __all__ must be statically defined by py.typed support | ||
| 39 | - # __all__ = [name for name, obj in locals().items() if not (name.startswith("_") or inspect.ismodule(obj))] | ||
| 40 | 8 | __all__ = [ # noqa: F405 | |
| 41 | 9 | "Actor", | |
| 42 | 10 | "AmbiguousObjectName", | |
@@ -52,6 +20,7 @@ | |||
| 52 | 20 | "CommandError", | |
| 53 | 21 | "Commit", | |
| 54 | 22 | "Diff", | |
| 23 | + "DiffConstants", | ||
| 55 | 24 | "DiffIndex", | |
| 56 | 25 | "Diffable", | |
| 57 | 26 | "FetchInfo", | |
@@ -65,18 +34,19 @@ | |||
| 65 | 34 | "HEAD", | |
| 66 | 35 | "Head", | |
| 67 | 36 | "HookExecutionError", | |
| 37 | + "INDEX", | ||
| 68 | 38 | "IndexEntry", | |
| 69 | 39 | "IndexFile", | |
| 70 | 40 | "IndexObject", | |
| 71 | 41 | "InvalidDBRoot", | |
| 72 | 42 | "InvalidGitRepositoryError", | |
| 73 | - "List", | ||
| 43 | + "List", # Deprecated - import this from `typing` instead. | ||
| 74 | 44 | "LockFile", | |
| 75 | 45 | "NULL_TREE", | |
| 76 | 46 | "NoSuchPathError", | |
| 77 | 47 | "ODBError", | |
| 78 | 48 | "Object", | |
| 79 | - "Optional", | ||
| 49 | + "Optional", # Deprecated - import this from `typing` instead. | ||
| 80 | 50 | "ParseError", | |
| 81 | 51 | "PathLike", | |
| 82 | 52 | "PushInfo", | |
@@ -90,31 +60,62 @@ | |||
| 90 | 60 | "RepositoryDirtyError", | |
| 91 | 61 | "RootModule", | |
| 92 | 62 | "RootUpdateProgress", | |
| 93 | - "Sequence", | ||
| 63 | + "Sequence", # Deprecated - import from `typing`, or `collections.abc` in 3.9+. | ||
| 94 | 64 | "StageType", | |
| 95 | 65 | "Stats", | |
| 96 | 66 | "Submodule", | |
| 97 | 67 | "SymbolicReference", | |
| 98 | - "TYPE_CHECKING", | ||
| 68 | + "TYPE_CHECKING", # Deprecated - import this from `typing` instead. | ||
| 99 | 69 | "Tag", | |
| 100 | 70 | "TagObject", | |
| 101 | 71 | "TagReference", | |
| 102 | 72 | "Tree", | |
| 103 | 73 | "TreeModifier", | |
| 104 | - "Tuple", | ||
| 105 | - "Union", | ||
| 74 | + "Tuple", # Deprecated - import this from `typing` instead. | ||
| 75 | + "Union", # Deprecated - import this from `typing` instead. | ||
| 106 | 76 | "UnmergedEntriesError", | |
| 107 | 77 | "UnsafeOptionError", | |
| 108 | 78 | "UnsafeProtocolError", | |
| 109 | 79 | "UnsupportedOperation", | |
| 110 | 80 | "UpdateProgress", | |
| 111 | 81 | "WorkTreeRepositoryUnsupported", | |
| 82 | + "refresh", | ||
| 112 | 83 | "remove_password_if_present", | |
| 113 | 84 | "rmtree", | |
| 114 | 85 | "safe_decode", | |
| 115 | 86 | "to_hex_sha", | |
| 116 | 87 | ] | |
| 117 | 88 | ||
| 89 | + __version__ = "git" | ||
| 90 | + | ||
| 91 | + from typing import List, Optional, Sequence, Tuple, Union, TYPE_CHECKING | ||
| 92 | + | ||
| 93 | + from gitdb.util import to_hex_sha | ||
| 94 | + from git.exc import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 95 | + from git.types import PathLike | ||
| 96 | + | ||
| 97 | + try: | ||
| 98 | + from git.compat import safe_decode # @NoMove @IgnorePep8 | ||
| 99 | + from git.config import GitConfigParser # @NoMove @IgnorePep8 | ||
| 100 | + from git.objects import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 101 | + from git.refs import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 102 | + from git.diff import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 103 | + from git.db import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 104 | + from git.cmd import Git # @NoMove @IgnorePep8 | ||
| 105 | + from git.repo import Repo # @NoMove @IgnorePep8 | ||
| 106 | + from git.remote import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 107 | + from git.index import * # noqa: F403 # @NoMove @IgnorePep8 | ||
| 108 | + from git.util import ( # @NoMove @IgnorePep8 | ||
| 109 | + LockFile, | ||
| 110 | + BlockingLockFile, | ||
| 111 | + Stats, | ||
| 112 | + Actor, | ||
| 113 | + remove_password_if_present, | ||
| 114 | + rmtree, | ||
| 115 | + ) | ||
| 116 | + except GitError as _exc: # noqa: F405 | ||
| 117 | + raise ImportError("%s: %s" % (_exc.__class__.__name__, _exc)) from _exc | ||
| 118 | + | ||
| 118 | 119 | # { Initialize git executable path | |
| 119 | 120 | GIT_OK = None | |
| 120 | 121 | ||
@@ -146,7 +147,7 @@ def refresh(path: Optional[PathLike] = None) -> None: | |||
| 146 | 147 | if not Git.refresh(path=path): | |
| 147 | 148 | return | |
| 148 | 149 | if not FetchInfo.refresh(): # noqa: F405 | |
| 149 | - return # type: ignore [unreachable] | ||
| 150 | + return # type: ignore[unreachable] | ||
| 150 | 151 | ||
| 151 | 152 | GIT_OK = True | |
| 152 | 153 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments