GitPython 3.1.60__py3-none-any.whl → 3.1.61__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
git/__init__.py CHANGED
@@ -86,7 +86,7 @@ __all__ = [
86
86
  "to_hex_sha",
87
87
  ]
88
88
 
89
- __version__ = '3.1.60'
89
+ __version__ = '3.1.61'
90
90
 
91
91
  from typing import Any, List, Optional, Sequence, TYPE_CHECKING, Tuple, Union
92
92
 
git/util.py CHANGED
@@ -80,6 +80,7 @@ from typing import (
80
80
  Sequence,
81
81
  Tuple,
82
82
  TYPE_CHECKING,
83
+ Type,
83
84
  TypeVar,
84
85
  Union,
85
86
  cast,
@@ -108,6 +109,7 @@ from git.types import (
108
109
 
109
110
  T_IterableObj = TypeVar("T_IterableObj", bound=Union["IterableObj", "Has_id_attribute"], covariant=True)
110
111
  # So IterableList[Head] is subtype of IterableList[IterableObj].
112
+ T_Actor = TypeVar("T_Actor", bound="Actor")
111
113
 
112
114
  _logger = logging.getLogger(__name__)
113
115
 
@@ -853,11 +855,27 @@ class CallableRemoteProgress(RemoteProgress):
853
855
  self._callable(*args, **kwargs)
854
856
 
855
857
 
858
+ class _DeprecatedActorNameEmailRegex:
859
+ _pattern = re.compile(r"(.*) <(.*?)>")
860
+
861
+ def __get__(self, _instance: Any, _owner: Any) -> Pattern[str]:
862
+ warnings.warn(
863
+ "Actor.name_email_regex is deprecated and will be removed in GitPython 4.0.0 because searching long "
864
+ "malformed strings with it can take quadratic time. Use Actor.from_string() to parse actor identities, "
865
+ "or Actor(name, email) when the fields are already separate.",
866
+ DeprecationWarning,
867
+ stacklevel=2,
868
+ )
869
+ return self._pattern
870
+
871
+
856
872
  class Actor:
857
873
  """Actors hold information about a person acting on the repository. They can be
858
874
  committers and authors or anything with a name and an email as mentioned in the git
859
875
  log entries."""
860
876
 
877
+ name_email_regex = _DeprecatedActorNameEmailRegex()
878
+
861
879
  # ENVIRONMENT VARIABLES
862
880
  # These are read when creating new commits.
863
881
  env_author_name = "GIT_AUTHOR_NAME"
@@ -891,7 +909,7 @@ class Actor:
891
909
  return '<git.Actor "%s <%s>">' % (self.name, self.email)
892
910
 
893
911
  @classmethod
894
- def _from_string(cls, string: str) -> "Actor":
912
+ def from_string(cls: Type[T_Actor], string: str) -> T_Actor:
895
913
  """Create an :class:`Actor` from a string.
896
914
 
897
915
  :param string:
@@ -906,10 +924,12 @@ class Actor:
906
924
  left_bracket = line.find("<")
907
925
  right_bracket = line.find(">", left_bracket + 1)
908
926
  if left_bracket >= 0 and right_bracket >= 0:
909
- return Actor(line[:left_bracket].rstrip(), line[left_bracket + 1 : right_bracket])
927
+ return cls(line[:left_bracket].rstrip(), line[left_bracket + 1 : right_bracket])
910
928
 
911
929
  # Assume the best and use the whole string as name.
912
- return Actor(string, None)
930
+ return cls(string, None)
931
+
932
+ _from_string = from_string
913
933
 
914
934
  @classmethod
915
935
  def _main_actor(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GitPython
3
- Version: 3.1.60
3
+ Version: 3.1.61
4
4
  Summary: GitPython is a Python library used to interact with Git repositories
5
5
  Home-page: https://github.com/gitpython-developers/GitPython
6
6
  Author: Sebastian Thiel, Michael Trier
@@ -1,4 +1,4 @@
1
- git/__init__.py,sha256=wqCnZT2brJ5_CGnA-7ZUMBDKSNys3SD-ZBDfUbwd9xo,8899
1
+ git/__init__.py,sha256=0tbJRj66bYNZaWePYb-fxyuSQKcz_fjyfOazQu83IPc,8899
2
2
  git/cmd.py,sha256=y-7TVp8PVWVkXcQrKqrSO2vaD6Bdiue73ZzFlWzLryU,77137
3
3
  git/compat.py,sha256=y1E6y6O2q5r8clSlr8ZNmuIWG9nmHuehQEsVsmBffs8,4526
4
4
  git/config.py,sha256=XTKrw9MQM6cy4JQm0fEEFl4S5yxYK1QGaAVKZHOlKYQ,40052
@@ -8,7 +8,7 @@ git/exc.py,sha256=Gc7g1pHpn8OmTse30NHmJVsBJ2CYH8LxaR8y8UA3lIM,7119
8
8
  git/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  git/remote.py,sha256=d68K7XmkYXZUlIoLBDRpRom_df6mbkhWMrcPAP5s11c,46900
10
10
  git/types.py,sha256=d3oDduUGjfoqffcUL_GOD-3qroF8m3r9ai6Xi9_FraM,10279
11
- git/util.py,sha256=j49ea4S4jSWBIDkH81k8LMPVmO_gmEd7toZnLs2ZzEE,47948
11
+ git/util.py,sha256=NPPk11jSohWD7E9-LNY0AlL_x8Qp6G2H_cBpn3vUiuw,48679
12
12
  git/index/__init__.py,sha256=i-Nqb8Lufp9aFbmxpQBORmmQnjEVVM1Pn58fsQkyGgQ,406
13
13
  git/index/base.py,sha256=cOeIjjS2LYZwqKdSGvrcgVC37TNZcTNtQzHWbGPyRwk,64775
14
14
  git/index/fun.py,sha256=AIW3T6Gr6h5E22z_2wKHevzh5K0HhjjEO9kXAK3nHOM,22419
@@ -36,9 +36,9 @@ git/refs/tag.py,sha256=Gm1jn9kClc6f6jGQXRrpLyelrM3-KDcqHRRkD0mL4SE,5510
36
36
  git/repo/__init__.py,sha256=CILSVH36fX_WxVFSjD9o1WF5LgsNedPiJvSngKZqfVU,210
37
37
  git/repo/base.py,sha256=AGUo8RCtkjWoDL8pnFiAD4aC_YBKTJAdqKzpHNm1fj8,67336
38
38
  git/repo/fun.py,sha256=LeInQM4xN_DuNcTJ0vlRhjTzgBcZ1m5Os9_RO-Xep-w,24901
39
- gitpython-3.1.60.dist-info/licenses/AUTHORS,sha256=Iucx_CH3w7_4084yjM6C5BvKfLA8cVfYHWW2pVmpxSk,2410
40
- gitpython-3.1.60.dist-info/licenses/LICENSE,sha256=hvyUwyGpr7wRUUcTURuv3tIl8lEA3MD3NQ6CvCMbi-s,1503
41
- gitpython-3.1.60.dist-info/METADATA,sha256=MjkbZs9NBaGu8B58zfeufXUBGRGNyRo3ZK493ynRqqM,13558
42
- gitpython-3.1.60.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
43
- gitpython-3.1.60.dist-info/top_level.txt,sha256=0hzDuIp8obv624V3GmbqsagBWkk8ohtGU-Bc1PmTT0o,4
44
- gitpython-3.1.60.dist-info/RECORD,,
39
+ gitpython-3.1.61.dist-info/licenses/AUTHORS,sha256=Iucx_CH3w7_4084yjM6C5BvKfLA8cVfYHWW2pVmpxSk,2410
40
+ gitpython-3.1.61.dist-info/licenses/LICENSE,sha256=hvyUwyGpr7wRUUcTURuv3tIl8lEA3MD3NQ6CvCMbi-s,1503
41
+ gitpython-3.1.61.dist-info/METADATA,sha256=Q042PXvN6RJkTkUxhGRFiohoFlwleFHX6nU7tSv7iD8,13558
42
+ gitpython-3.1.61.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
43
+ gitpython-3.1.61.dist-info/top_level.txt,sha256=0hzDuIp8obv624V3GmbqsagBWkk8ohtGU-Bc1PmTT0o,4
44
+ gitpython-3.1.61.dist-info/RECORD,,