Commit bc63b02
fix: restore Actor.name_email_regex (#2220)
<!-- agent -->
GitPython 3.1.60 removed the Actor.name_email_regex class attribute while
replacing internal actor parsing, which broke downstream consumers such as
python-semantic-release.
Bring back the historical compiled pattern for downstream compatibility,
but emit DeprecationWarning whenever the class member is accessed. The warning
explains its quadratic behavior on long malformed strings and points callers to
the public Actor(name, email) constructor when fields are separate, or direct
string parsing when they are not.
Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>
# 252a84ac Add public Actor.from_string constructor (#2220)
Add public Actor.from_string constructor (#2220)
Promote the existing actor identity parser to Actor.from_string while retaining _from_string as a compatibility alias. Point the name_email_regex deprecation warning to the new public constructor or Actor(name, email).
Validation:
- actor-related test/test_actor.py and test/test_util.py cases: 12 passed
- ruff check and format checks passed
- basedpyright git/util.py: no errors
Co-authored-by: Codex GPT-5 <codex@openai.com>
# dd2181d8 Address review feedback about Actor subclasses
Address review feedback about Actor subclasses
Review feedback: Actor.from_string() should preserve the class on which the public classmethod is called instead of always returning a base Actor.
Construct through cls on both parsing paths and cover subclass construction directly.
Validation:
- actor-related test/test_actor.py and test/test_util.py cases: 13 passed
- ruff check and format checks passed
- basedpyright git/util.py: no errors
# fcf1ecb1 Address review feedback about constructor typing
Address review feedback about constructor typing
Review feedback: Actor.from_string() constructs subclasses at runtime but its Actor return annotation prevents type checkers from preserving subclass-specific members.
Use the project existing Python 3.7-compatible bound TypeVar pattern so the declared return type follows cls.
Validation:
- actor-related test/test_actor.py and test/test_util.py cases: 13 passed
- ruff check and format checks passed
- basedpyright git/util.py: no errors
Co-authored-by: Codex GPT-5 <codex@openai.com>1 parent a9fb008 commit bc63b02
2 files changed
Lines changed: 49 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
853 | 855 | | |
854 | 856 | | |
855 | 857 | | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
856 | 872 | | |
857 | 873 | | |
858 | 874 | | |
859 | 875 | | |
860 | 876 | | |
| 877 | + | |
| 878 | + | |
861 | 879 | | |
862 | 880 | | |
863 | 881 | | |
| |||
891 | 909 | | |
892 | 910 | | |
893 | 911 | | |
894 | | - | |
| 912 | + | |
895 | 913 | | |
896 | 914 | | |
897 | 915 | | |
| |||
906 | 924 | | |
907 | 925 | | |
908 | 926 | | |
909 | | - | |
| 927 | + | |
910 | 928 | | |
911 | 929 | | |
912 | | - | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
913 | 933 | | |
914 | 934 | | |
915 | 935 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
33 | | - | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
36 | 53 | | |
37 | | - | |
| 54 | + | |
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
| |||
45 | 62 | | |
46 | 63 | | |
47 | 64 | | |
48 | | - | |
| 65 | + | |
49 | 66 | | |
50 | 67 | | |
51 | | - | |
| 68 | + | |
52 | 69 | | |
53 | 70 | | |
54 | 71 | | |
55 | | - | |
| 72 | + | |
56 | 73 | | |
0 commit comments