summaryrefslogtreecommitdiff
path: root/git/__init__.py
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-03-16 22:08:20 +0000
committerYobmod <yobmod@gmail.com>2021-03-16 22:08:20 +0000
commit5232c89de10872a6df6227c5dcea169bd1aa6550 (patch)
treedc23db6e4a360c9a36321050bed7d5f445b4922f /git/__init__.py
parent9562ae2e2436e052d31c40d5f9d3d0318f6c4575 (diff)
downloadgitpython-5232c89de10872a6df6227c5dcea169bd1aa6550.tar.gz
add types to git.__init__, compat, db, diff, exc, util
Diffstat (limited to 'git/__init__.py')
-rw-r--r--git/__init__.py12
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()