| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,14 +1,6 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "files": { | |
| 3 | 3 | "./git/config.py": [ | |
| 4 | - { | ||
| 5 | - "code": "reportGeneralTypeIssues", | ||
| 6 | - "range": { | ||
| 7 | - "startColumn": 11, | ||
| 8 | - "endColumn": 26, | ||
| 9 | - "lineCount": 1 | ||
| 10 | - } | ||
| 11 | - }, | ||
| 12 | 4 | { | |
| 13 | 5 | "code": "reportInvalidTypeVarUse", | |
| 14 | 6 | "range": { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,7 +89,7 @@ jobs: | |||
| 89 | 89 | command -v git python | |
| 90 | 90 | git version | |
| 91 | 91 | python --version | |
| 92 | - python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")' | ||
| 92 | + python -c 'import os, sys; print(f"{sys.platform=}, {os.name=}")' | ||
| 93 | 93 | ||
| 94 | 94 | - name: Test with pytest | |
| 95 | 95 | run: | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,7 +133,7 @@ jobs: | |||
| 133 | 133 | command -v git python | |
| 134 | 134 | git version | |
| 135 | 135 | python --version | |
| 136 | - python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")' | ||
| 136 | + python -c 'import os, sys; print(f"{sys.platform=}, {os.name=}")' | ||
| 137 | 137 | ||
| 138 | 138 | - name: Test with pytest (${{ matrix.additional-pytest-args }}) | |
| 139 | 139 | run: | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,12 +11,12 @@ permissions: | |||
| 11 | 11 | ||
| 12 | 12 | jobs: | |
| 13 | 13 | test: | |
| 14 | - runs-on: ${{ matrix.python-version == '3.7' && 'ubuntu-22.04' || 'ubuntu-latest' }} | ||
| 14 | + runs-on: ubuntu-latest | ||
| 15 | 15 | strategy: | |
| 16 | 16 | fail-fast: false | |
| 17 | 17 | matrix: | |
| 18 | 18 | project: [smmap, gitdb] | |
| 19 | - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.13t"] | ||
| 19 | + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.13t"] | ||
| 20 | 20 | ||
| 21 | 21 | steps: | |
| 22 | 22 | - uses: actions/checkout@v7 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,22 +17,14 @@ jobs: | |||
| 17 | 17 | strategy: | |
| 18 | 18 | matrix: | |
| 19 | 19 | os-type: [ubuntu, macos, windows] | |
| 20 | - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"] | ||
| 20 | + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"] | ||
| 21 | 21 | exclude: | |
| 22 | - - os-type: macos | ||
| 23 | - python-version: "3.7" # Not available for the ARM-based macOS runners. | ||
| 24 | 22 | - os-type: macos | |
| 25 | 23 | python-version: "3.14t" | |
| 26 | 24 | - os-type: macos | |
| 27 | 25 | python-version: "3.15t" | |
| 28 | 26 | include: | |
| 29 | - - os-ver: latest | ||
| 30 | - - os-type: ubuntu | ||
| 31 | - python-version: "3.7" | ||
| 32 | - os-ver: "22.04" | ||
| 33 | 27 | - build-docs: true # We ensure documentation builds, except on very old interpreters. | |
| 34 | - - python-version: "3.7" | ||
| 35 | - build-docs: false | ||
| 36 | 28 | - python-version: "3.8" | |
| 37 | 29 | build-docs: false | |
| 38 | 30 | - experimental: false | |
@@ -43,7 +35,7 @@ jobs: | |||
| 43 | 35 | ||
| 44 | 36 | fail-fast: false | |
| 45 | 37 | ||
| 46 | - runs-on: ${{ matrix.os-type }}-${{ matrix.os-ver }} | ||
| 38 | + runs-on: ${{ matrix.os-type }}-latest | ||
| 47 | 39 | ||
| 48 | 40 | defaults: | |
| 49 | 41 | run: | |
@@ -140,7 +132,7 @@ jobs: | |||
| 140 | 132 | command -v git python | |
| 141 | 133 | git version | |
| 142 | 134 | python --version | |
| 143 | - python -c 'import os, sys; print(f"sys.platform={sys.platform!r}, os.name={os.name!r}")' | ||
| 135 | + python -c 'import os, sys; print(f"{sys.platform=}, {os.name=}")' | ||
| 144 | 136 | ||
| 145 | 137 | # For debugging hook tests on native Windows systems that may have WSL. | |
| 146 | 138 | - name: Show bash.exe candidates (Windows) | |
@@ -152,7 +144,7 @@ jobs: | |||
| 152 | 144 | continue-on-error: true | |
| 153 | 145 | ||
| 154 | 146 | - name: Check types with mypy | |
| 155 | - if: matrix.python-version != '3.7' && matrix.python-version != '3.8' | ||
| 147 | + if: matrix.python-version != '3.8' | ||
| 156 | 148 | run: | | |
| 157 | 149 | mypy --python-version="${PYTHON_VERSION%t}" # Version only, with no "t" for free-threaded. | |
| 158 | 150 | env: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,7 @@ GitPython needs the `git` executable to be installed on the system and available | |||
| 44 | 44 | by setting the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable. | |
| 45 | 45 | ||
| 46 | 46 | - Git (1.7.x or newer) | |
| 47 | - - Python >= 3.7 | ||
| 47 | + - Python >= 3.8 | ||
| 48 | 48 | ||
| 49 | 49 | The list of dependencies are listed in [`./requirements.txt`](https://github.com/gitpython-developers/GitPython/blob/main/requirements.txt) and [`./test-requirements.txt`](https://github.com/gitpython-developers/GitPython/blob/main/test-requirements.txt). | |
| 50 | 50 | The installer takes care of installing them for you. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ The object database implementation is optimized for handling large quantities of | |||
| 13 | 13 | Requirements | |
| 14 | 14 | ============ | |
| 15 | 15 | ||
| 16 | - * `Python`_ >= 3.7 | ||
| 16 | + * `Python`_ >= 3.8 | ||
| 17 | 17 | * `Git`_ 1.7.0 or newer | |
| 18 | 18 | It should also work with older versions, but it may be that some operations | |
| 19 | 19 | involving remotes will not work as expected. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,7 +49,7 @@ def read_lines_from_file(file_path: str) -> list: | |||
| 49 | 49 | except FileNotFoundError: | |
| 50 | 50 | print(f"File not found: {file_path}") | |
| 51 | 51 | return [] | |
| 52 | - except IOError as e: | ||
| 52 | + except OSError as e: | ||
| 53 | 53 | print(f"Error reading file {file_path}: {e}") | |
| 54 | 54 | return [] | |
| 55 | 55 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -295,6 +295,6 @@ def refresh(path: Optional[PathLike] = None) -> None: | |||
| 295 | 295 | try: | |
| 296 | 296 | refresh() | |
| 297 | 297 | except Exception as _exc: | |
| 298 | - raise ImportError("Failed to initialize: {0}".format(_exc)) from _exc | ||
| 298 | + raise ImportError(f"Failed to initialize: {_exc}") from _exc | ||
| 299 | 299 | ||
| 300 | 300 | # } END initialize git executable path | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,7 @@ | |||
| 28 | 28 | Dict, | |
| 29 | 29 | Generic, | |
| 30 | 30 | List, | |
| 31 | + OrderedDict, | ||
| 31 | 32 | Sequence, | |
| 32 | 33 | Tuple, | |
| 33 | 34 | TypeVar, | |
@@ -47,15 +48,7 @@ | |||
| 47 | 48 | T_ConfigParser = TypeVar("T_ConfigParser", bound="GitConfigParser") | |
| 48 | 49 | T_OMD_value = TypeVar("T_OMD_value", str, bytes, int, float, bool, None) | |
| 49 | 50 | ||
| 50 | - if sys.version_info[:3] < (3, 7, 2): | ||
| 51 | - # typing.Ordereddict not added until Python 3.7.2. | ||
| 52 | - from collections import OrderedDict | ||
| 53 | - | ||
| 54 | - OrderedDict_OMD = OrderedDict | ||
| 55 | - else: | ||
| 56 | - from typing import OrderedDict | ||
| 57 | - | ||
| 58 | - OrderedDict_OMD = OrderedDict[str, List[T_OMD_value]] # type: ignore[assignment, misc] | ||
| 51 | + OrderedDict_OMD = OrderedDict[str, List[T_OMD_value]] | ||
| 59 | 52 | ||
| 60 | 53 | # ------------------------------------------------------------- | |
| 61 | 54 | ||
@@ -259,7 +252,7 @@ def setlast(self, key: str, value: Any) -> None: | |||
| 259 | 252 | ||
| 260 | 253 | self.getall(key)[-1] = value | |
| 261 | 254 | ||
| 262 | - def get(self, key: str, default: Union[_T, None] = None) -> Union[_T, None]: | ||
| 255 | + def get(self, key: str, default: Union[_T, None] = None) -> Union[_T, None]: # type: ignore[override] | ||
| 263 | 256 | return super().get(self._key(key), [default])[-1] | |
| 264 | 257 | ||
| 265 | 258 | def getall(self, key: str) -> List[_T]: | |
@@ -381,7 +374,7 @@ def __init__( | |||
| 381 | 374 | Reference to repository to use if ``[includeIf]`` sections are found in | |
| 382 | 375 | configuration files. | |
| 383 | 376 | """ | |
| 384 | - cp.RawConfigParser.__init__(self, dict_type=_OMD, allow_no_value=True) | ||
| 377 | + cp.RawConfigParser.__init__(self, dict_type=cast(Any, _OMD), allow_no_value=True) | ||
| 385 | 378 | self._dict: Callable[..., _OMD] | |
| 386 | 379 | self._defaults: _OMD | |
| 387 | 380 | self._sections: _OMD | |
@@ -458,7 +451,7 @@ def release(self) -> None: | |||
| 458 | 451 | ||
| 459 | 452 | try: | |
| 460 | 453 | self.write() | |
| 461 | - except IOError: | ||
| 454 | + except OSError: | ||
| 462 | 455 | _logger.error("Exception during destruction of GitConfigParser", exc_info=True) | |
| 463 | 456 | except ReferenceError: | |
| 464 | 457 | # This happens in Python 3... and usually means that some state cannot be | |
@@ -774,7 +767,7 @@ def read(self) -> None: # type: ignore[override] | |||
| 774 | 767 | with open(file_path, "rb") as fp: | |
| 775 | 768 | file_ok = True | |
| 776 | 769 | self._read(fp, fp.name) | |
| 777 | - except IOError: | ||
| 770 | + except OSError: | ||
| 778 | 771 | continue | |
| 779 | 772 | ||
| 780 | 773 | # Read includes and append those that we didn't handle yet. We expect all | |
@@ -924,7 +917,7 @@ def write(self) -> None: | |||
| 924 | 917 | ||
| 925 | 918 | def _assure_writable(self, method_name: str) -> None: | |
| 926 | 919 | if self.read_only: | |
| 927 | - raise IOError("Cannot execute non-constant method %s.%s" % (self, method_name)) | ||
| 920 | + raise OSError(f"Cannot execute non-constant method {self}.{method_name}") | ||
| 928 | 921 | ||
| 929 | 922 | def add_section(self, section: "cp._SectionName") -> None: | |
| 930 | 923 | """Assures added options will stay in order.""" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments