| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 58d1271 commit 3955534
61 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,26 +30,29 @@ | |||
| 30 | 30 | import os | |
| 31 | 31 | import typing | |
| 32 | 32 | ||
| 33 | - # Low level API | ||
| 34 | - from ._pygit2 import * | ||
| 35 | - from ._pygit2 import _cache_enums | ||
| 36 | - | ||
| 37 | 33 | # High level API | |
| 38 | 34 | from . import enums | |
| 39 | 35 | from ._build import __version__ | |
| 36 | + | ||
| 37 | + # Low level API | ||
| 38 | + from ._pygit2 import * | ||
| 39 | + from ._pygit2 import _cache_enums | ||
| 40 | 40 | from .blame import Blame, BlameHunk | |
| 41 | 41 | from .blob import BlobIO | |
| 42 | - from .callbacks import Payload, RemoteCallbacks, CheckoutCallbacks, StashApplyCallbacks | ||
| 43 | 42 | from .callbacks import ( | |
| 43 | + CheckoutCallbacks, | ||
| 44 | + Payload, | ||
| 45 | + RemoteCallbacks, | ||
| 46 | + StashApplyCallbacks, | ||
| 47 | + get_credentials, | ||
| 44 | 48 | git_clone_options, | |
| 45 | 49 | git_fetch_options, | |
| 46 | 50 | git_proxy_options, | |
| 47 | - get_credentials, | ||
| 48 | 51 | ) | |
| 49 | 52 | from .config import Config | |
| 50 | 53 | from .credentials import * | |
| 51 | - from .errors import check_error, Passthrough | ||
| 52 | - from .ffi import ffi, C | ||
| 54 | + from .errors import Passthrough, check_error | ||
| 55 | + from .ffi import C, ffi | ||
| 53 | 56 | from .filter import Filter | |
| 54 | 57 | from .index import Index, IndexEntry | |
| 55 | 58 | from .legacyenums import * | |
@@ -60,7 +63,6 @@ | |||
| 60 | 63 | from .submodules import Submodule | |
| 61 | 64 | from .utils import to_bytes, to_str | |
| 62 | 65 | ||
| 63 | - | ||
| 64 | 66 | # Features | |
| 65 | 67 | features = enums.Feature(C.git_libgit2_features()) | |
| 66 | 68 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,8 +23,8 @@ | |||
| 23 | 23 | # the Free Software Foundation, 51 Franklin Street, Fifth Floor, | |
| 24 | 24 | # Boston, MA 02110-1301, USA. | |
| 25 | 25 | ||
| 26 | - from typing import Literal, overload, NewType, TypeVar, Generic, Any, SupportsIndex | ||
| 27 | - from typing import NewType, Literal, TypeVar, Generic, overload | ||
| 26 | + from typing import Any, Generic, Literal, NewType, SupportsIndex, TypeVar, overload | ||
| 27 | + | ||
| 28 | 28 | from pygit2._pygit2 import Repository | |
| 29 | 29 | ||
| 30 | 30 | T = TypeVar('T') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,25 +1,37 @@ | |||
| 1 | + import tarfile | ||
| 2 | + from collections.abc import Generator | ||
| 3 | + from io import DEFAULT_BUFFER_SIZE, IOBase | ||
| 4 | + from pathlib import Path | ||
| 5 | + from queue import Queue | ||
| 6 | + from threading import Event | ||
| 1 | 7 | from typing import ( | |
| 8 | + Generic, | ||
| 2 | 9 | Iterator, | |
| 3 | 10 | Literal, | |
| 4 | 11 | Optional, | |
| 5 | - overload, | ||
| 6 | 12 | Type, | |
| 7 | 13 | TypedDict, | |
| 8 | 14 | TypeVar, | |
| 9 | - Generic, | ||
| 15 | + overload, | ||
| 10 | 16 | ) | |
| 11 | - from io import IOBase, DEFAULT_BUFFER_SIZE | ||
| 12 | - from pathlib import Path | ||
| 13 | - from queue import Queue | ||
| 14 | - import tarfile | ||
| 15 | - from threading import Event | ||
| 17 | + | ||
| 16 | 18 | from . import Index | |
| 19 | + from ._libgit2.ffi import ( | ||
| 20 | + GitCommitC, | ||
| 21 | + GitObjectC, | ||
| 22 | + GitProxyOptionsC, | ||
| 23 | + GitRepositoryC, | ||
| 24 | + GitSignatureC, | ||
| 25 | + _Pointer, | ||
| 26 | + ) | ||
| 27 | + from .blame import Blame | ||
| 28 | + from .callbacks import CheckoutCallbacks | ||
| 17 | 29 | from .enums import ( | |
| 18 | - AttrCheck, | ||
| 19 | 30 | ApplyLocation, | |
| 20 | - BranchType, | ||
| 21 | - BlobFilter, | ||
| 31 | + AttrCheck, | ||
| 22 | 32 | BlameFlag, | |
| 33 | + BlobFilter, | ||
| 34 | + BranchType, | ||
| 23 | 35 | CheckoutStrategy, | |
| 24 | 36 | DeltaStatus, | |
| 25 | 37 | DiffFind, | |
@@ -36,22 +48,9 @@ from .enums import ( | |||
| 36 | 48 | ResetMode, | |
| 37 | 49 | SortMode, | |
| 38 | 50 | ) | |
| 39 | - from collections.abc import Generator | ||
| 40 | - | ||
| 41 | - from ._libgit2.ffi import ( | ||
| 42 | - _Pointer, | ||
| 43 | - GitObjectC, | ||
| 44 | - GitCommitC, | ||
| 45 | - GitRepositoryC, | ||
| 46 | - GitProxyOptionsC, | ||
| 47 | - GitSignatureC, | ||
| 48 | - ) | ||
| 49 | - | ||
| 50 | - from .repository import BaseRepository | ||
| 51 | - from .submodules import SubmoduleCollection, Submodule | ||
| 52 | 51 | from .remotes import Remote | |
| 53 | - from .callbacks import CheckoutCallbacks | ||
| 54 | - from .blame import Blame | ||
| 52 | + from .repository import BaseRepository | ||
| 53 | + from .submodules import Submodule, SubmoduleCollection | ||
| 55 | 54 | ||
| 56 | 55 | GIT_OBJ_BLOB = Literal[3] | |
| 57 | 56 | GIT_OBJ_COMMIT = Literal[1] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,8 +29,8 @@ | |||
| 29 | 29 | ||
| 30 | 30 | # Import from the Standard Library | |
| 31 | 31 | import codecs | |
| 32 | - from pathlib import Path | ||
| 33 | 32 | import sys | |
| 33 | + from pathlib import Path | ||
| 34 | 34 | ||
| 35 | 35 | # Import from cffi | |
| 36 | 36 | from cffi import FFI # type: ignore | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,15 +23,16 @@ | |||
| 23 | 23 | # the Free Software Foundation, 51 Franklin Street, Fifth Floor, | |
| 24 | 24 | # Boston, MA 02110-1301, USA. | |
| 25 | 25 | ||
| 26 | - from typing import Iterator, TYPE_CHECKING | ||
| 26 | + from typing import TYPE_CHECKING, Iterator | ||
| 27 | + | ||
| 28 | + from ._pygit2 import Oid, Repository, Signature | ||
| 27 | 29 | ||
| 28 | 30 | # Import from pygit2 | |
| 29 | - from .ffi import ffi, C | ||
| 31 | + from .ffi import C, ffi | ||
| 30 | 32 | from .utils import GenericIterator | |
| 31 | - from ._pygit2 import Signature, Oid, Repository | ||
| 32 | 33 | ||
| 33 | 34 | if TYPE_CHECKING: | |
| 34 | - from ._libgit2.ffi import GitSignatureC, GitHunkC, GitBlameC | ||
| 35 | + from ._libgit2.ffi import GitBlameC, GitHunkC, GitSignatureC | ||
| 35 | 36 | ||
| 36 | 37 | ||
| 37 | 38 | def wrap_signature(csig: 'GitSignatureC') -> None | Signature: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,8 +2,8 @@ | |||
| 2 | 2 | import threading | |
| 3 | 3 | import time | |
| 4 | 4 | from contextlib import AbstractContextManager | |
| 5 | - from typing import Optional | ||
| 6 | 5 | from queue import Queue | |
| 6 | + from typing import Optional | ||
| 7 | 7 | ||
| 8 | 8 | from ._pygit2 import Blob, Oid | |
| 9 | 9 | from .enums import BlobFilter | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,10 +24,11 @@ | |||
| 24 | 24 | # Boston, MA 02110-1301, USA. | |
| 25 | 25 | ||
| 26 | 26 | from __future__ import annotations | |
| 27 | + | ||
| 27 | 28 | from typing import TYPE_CHECKING | |
| 28 | 29 | ||
| 29 | - from .enums import BranchType, ReferenceType | ||
| 30 | 30 | from ._pygit2 import Commit, Oid | |
| 31 | + from .enums import BranchType, ReferenceType | ||
| 31 | 32 | ||
| 32 | 33 | # Need BaseRepository for type hints, but don't let it cause a circular dependency | |
| 33 | 34 | if TYPE_CHECKING: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,22 +65,23 @@ | |||
| 65 | 65 | # Standard Library | |
| 66 | 66 | from contextlib import contextmanager | |
| 67 | 67 | from functools import wraps | |
| 68 | - from typing import Optional, Union, TYPE_CHECKING, Callable, Generator | ||
| 68 | + from typing import TYPE_CHECKING, Callable, Generator, Optional, Union | ||
| 69 | 69 | ||
| 70 | 70 | # pygit2 | |
| 71 | - from ._pygit2 import Oid, DiffFile | ||
| 71 | + from ._pygit2 import DiffFile, Oid | ||
| 72 | + from .credentials import Keypair, Username, UserPass | ||
| 72 | 73 | from .enums import CheckoutNotify, CheckoutStrategy, CredentialType, StashApplyProgress | |
| 73 | - from .errors import check_error, Passthrough | ||
| 74 | - from .ffi import ffi, C | ||
| 75 | - from .utils import maybe_string, to_bytes, ptr_to_bytes, StrArray | ||
| 76 | - from .credentials import Username, UserPass, Keypair | ||
| 74 | + from .errors import Passthrough, check_error | ||
| 75 | + from .ffi import C, ffi | ||
| 76 | + from .utils import StrArray, maybe_string, ptr_to_bytes, to_bytes | ||
| 77 | 77 | ||
| 78 | 78 | _Credentials = Username | UserPass | Keypair | |
| 79 | 79 | ||
| 80 | 80 | if TYPE_CHECKING: | |
| 81 | - from .remotes import TransferProgress | ||
| 82 | - from ._pygit2 import PushOptions, CloneOptions | ||
| 83 | 81 | from pygit2._libgit2.ffi import GitProxyOptionsC | |
| 82 | + | ||
| 83 | + from ._pygit2 import CloneOptions, PushOptions | ||
| 84 | + from .remotes import TransferProgress | ||
| 84 | 85 | # | |
| 85 | 86 | # The payload is the way to pass information from the pygit2 API, through | |
| 86 | 87 | # libgit2, to the Python callbacks. And back. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | 31 | # Import from pygit2 | |
| 32 | 32 | from .errors import check_error | |
| 33 | - from .ffi import ffi, C | ||
| 33 | + from .ffi import C, ffi | ||
| 34 | 34 | from .utils import to_bytes | |
| 35 | 35 | ||
| 36 | 36 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,6 @@ | |||
| 29 | 29 | ||
| 30 | 30 | from .enums import CredentialType | |
| 31 | 31 | ||
| 32 | - | ||
| 33 | 32 | if TYPE_CHECKING: | |
| 34 | 33 | from pathlib import Path | |
| 35 | 34 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments