Commit f23da45
authored
Add capability for global laziness (PyGithub#2746)
Adds capability to configure global laziness Github objects through
`Github(lazy=…)` and `GithubIntegration(lazy=…)`. Does not add any
laziness capability to any particular Github object.
Reworks `CompletableGithubObject` to support following features:
- It fetches initial complete JSON, which allows to replace
```python
headers, data = self.__requester.requestJsonAndCheck("GET", f"/users/{login}")
return github.NamedUser.NamedUser(self.__requester, headers, data, completed=True)
```
with
```python
return github.NamedUser.NamedUser(self.__requester, url=f"/users/{login}")
```
Which allows that returned `CompletableGithubObject` to be lazy.
Removes any code related to `CompletableGithubObject` from
`NonCompletableGithubObject`.
- Which requires replacing (for `NonCompletableGithubObject` only)
```python
return github.Branch.Branch(self._requester, headers, data, completed=True)
```
for `NonCompletableGithubObject` with
```python
return github.Branch.Branch(self._requester, headers, data)
```
Fixes PyGithub#23341 parent 19ddb9f commit f23da45
File tree
23 files changed
+283
-149
lines changed- github
- tests
- ReplayData
23 files changed
+283
-149
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
69 | | - | |
| 68 | + | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| |||
146 | 145 | | |
147 | 146 | | |
148 | 147 | | |
149 | | - | |
150 | 148 | | |
151 | 149 | | |
152 | 150 | | |
| |||
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
190 | | - | |
191 | 188 | | |
192 | 189 | | |
193 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
455 | 454 | | |
456 | 455 | | |
457 | 456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| 105 | + | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| |||
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| 124 | + | |
120 | 125 | | |
121 | 126 | | |
122 | 127 | | |
| |||
157 | 162 | | |
158 | 163 | | |
159 | 164 | | |
| 165 | + | |
160 | 166 | | |
161 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
162 | 181 | | |
163 | 182 | | |
164 | 183 | | |
| |||
211 | 230 | | |
212 | 231 | | |
213 | 232 | | |
214 | | - | |
215 | 233 | | |
216 | 234 | | |
217 | 235 | | |
| |||
248 | 266 | | |
249 | 267 | | |
250 | 268 | | |
251 | | - | |
252 | 269 | | |
253 | 270 | | |
254 | 271 | | |
| |||
0 commit comments