diff options
| author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-03-17 17:49:09 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-17 17:49:09 +0800 |
| commit | 6643a9feb39d4d49c894c1d25e3d4d71e180208a (patch) | |
| tree | 002c4c12c1da90f1889672942cdb500ad0dce47d /git/__init__.py | |
| parent | 690722a611a25a1afcdb0163d3cfd0a8c89d1d04 (diff) | |
| parent | c93e971f3e0aa4dea12a0cb169539fe85681e381 (diff) | |
| download | gitpython-6643a9feb39d4d49c894c1d25e3d4d71e180208a.tar.gz | |
Merge pull request #1202 from Yobmod/main
Add more types
Diffstat (limited to 'git/__init__.py')
| -rw-r--r-- | git/__init__.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/git/__init__.py b/git/__init__.py index 53440830..ae9254a2 100644 --- a/git/__init__.py +++ b/git/__init__.py @@ -5,18 +5,20 @@ # the BSD License: http://www.opensource.org/licenses/bsd-license.php # flake8: noqa #@PydevCodeAnalysisIgnore +from git.exc import * # @NoMove @IgnorePep8 import inspect import os import sys - import os.path as osp +from typing import Optional +from git.types import PathLike __version__ = 'git' #{ Initialization -def _init_externals(): +def _init_externals() -> None: """Initialize external projects by putting them into the path""" if __version__ == 'git' and 'PYOXIDIZER' not in os.environ: sys.path.insert(1, osp.join(osp.dirname(__file__), 'ext', 'gitdb')) @@ -29,13 +31,13 @@ def _init_externals(): #} END initialization + ################# _init_externals() ################# #{ Imports -from git.exc import * # @NoMove @IgnorePep8 try: from git.config import GitConfigParser # @NoMove @IgnorePep8 from git.objects import * # @NoMove @IgnorePep8 @@ -65,7 +67,8 @@ __all__ = [name for name, obj in locals().items() #{ Initialize git executable path GIT_OK = None -def refresh(path=None): + +def refresh(path: Optional[PathLike] = None) -> None: """Convenience method for setting the git executable path.""" global GIT_OK GIT_OK = False @@ -78,6 +81,7 @@ def refresh(path=None): GIT_OK = True #} END initialize git executable path + ################# try: refresh() |
