|
35 | 35 | "from urllib.parse import quote\n", |
36 | 36 | "from datetime import datetime,timedelta\n", |
37 | 37 | "from pprint import pprint\n", |
| 38 | + "from time import sleep\n", |
38 | 39 | "import os" |
39 | 40 | ] |
40 | 41 | }, |
|
261 | 262 | "text/markdown": [ |
262 | 263 | "---\n", |
263 | 264 | "\n", |
| 265 | + "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L110){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 266 | + "\n", |
264 | 267 | "### GhApi.__call__\n", |
265 | 268 | "\n", |
266 | 269 | "> GhApi.__call__ (path:str, verb:str=None, headers:dict=None,\n", |
|
271 | 274 | "text/plain": [ |
272 | 275 | "---\n", |
273 | 276 | "\n", |
| 277 | + "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L110){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 278 | + "\n", |
274 | 279 | "### GhApi.__call__\n", |
275 | 280 | "\n", |
276 | 281 | "> GhApi.__call__ (path:str, verb:str=None, headers:dict=None,\n", |
|
314 | 319 | "text/markdown": [ |
315 | 320 | "```json\n", |
316 | 321 | "{ 'node_id': 'MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy',\n", |
317 | | - " 'object': { 'sha': '037bf40e4e5eb32a165db42a35dd89e1c1546493',\n", |
| 322 | + " 'object': { 'sha': '3d27c573b7f9bdea704289567603f1d02e7e113b',\n", |
318 | 323 | " 'type': 'commit',\n", |
319 | | - " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/037bf40e4e5eb32a165db42a35dd89e1c1546493'},\n", |
| 324 | + " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/3d27c573b7f9bdea704289567603f1d02e7e113b'},\n", |
320 | 325 | " 'ref': 'refs/heads/master',\n", |
321 | 326 | " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master'}\n", |
322 | 327 | "```" |
|
325 | 330 | "{'ref': 'refs/heads/master',\n", |
326 | 331 | " 'node_id': 'MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy',\n", |
327 | 332 | " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master',\n", |
328 | | - " 'object': {'sha': '037bf40e4e5eb32a165db42a35dd89e1c1546493',\n", |
| 333 | + " 'object': {'sha': '3d27c573b7f9bdea704289567603f1d02e7e113b',\n", |
329 | 334 | " 'type': 'commit',\n", |
330 | | - " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/037bf40e4e5eb32a165db42a35dd89e1c1546493'}}" |
| 335 | + " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/3d27c573b7f9bdea704289567603f1d02e7e113b'}}" |
331 | 336 | ] |
332 | 337 | }, |
333 | 338 | "execution_count": null, |
|
350 | 355 | "text/markdown": [ |
351 | 356 | "---\n", |
352 | 357 | "\n", |
| 358 | + "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L134){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 359 | + "\n", |
353 | 360 | "### GhApi.__getitem__\n", |
354 | 361 | "\n", |
355 | 362 | "> GhApi.__getitem__ (k)\n", |
|
359 | 366 | "text/plain": [ |
360 | 367 | "---\n", |
361 | 368 | "\n", |
| 369 | + "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L134){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 370 | + "\n", |
362 | 371 | "### GhApi.__getitem__\n", |
363 | 372 | "\n", |
364 | 373 | "> GhApi.__getitem__ (k)\n", |
|
392 | 401 | "text/markdown": [ |
393 | 402 | "```json\n", |
394 | 403 | "{ 'node_id': 'MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy',\n", |
395 | | - " 'object': { 'sha': '037bf40e4e5eb32a165db42a35dd89e1c1546493',\n", |
| 404 | + " 'object': { 'sha': '3d27c573b7f9bdea704289567603f1d02e7e113b',\n", |
396 | 405 | " 'type': 'commit',\n", |
397 | | - " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/037bf40e4e5eb32a165db42a35dd89e1c1546493'},\n", |
| 406 | + " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/3d27c573b7f9bdea704289567603f1d02e7e113b'},\n", |
398 | 407 | " 'ref': 'refs/heads/master',\n", |
399 | 408 | " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master'}\n", |
400 | 409 | "```" |
|
403 | 412 | "{'ref': 'refs/heads/master',\n", |
404 | 413 | " 'node_id': 'MDM6UmVmMzE1NzEyNTg4OnJlZnMvaGVhZHMvbWFzdGVy',\n", |
405 | 414 | " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/refs/heads/master',\n", |
406 | | - " 'object': {'sha': '037bf40e4e5eb32a165db42a35dd89e1c1546493',\n", |
| 415 | + " 'object': {'sha': '3d27c573b7f9bdea704289567603f1d02e7e113b',\n", |
407 | 416 | " 'type': 'commit',\n", |
408 | | - " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/037bf40e4e5eb32a165db42a35dd89e1c1546493'}}" |
| 417 | + " 'url': 'https://api.github.com/repos/fastai/ghapi-test/git/commits/3d27c573b7f9bdea704289567603f1d02e7e113b'}}" |
409 | 418 | ] |
410 | 419 | }, |
411 | 420 | "execution_count": null, |
|
439 | 448 | { |
440 | 449 | "data": { |
441 | 450 | "text/plain": [ |
442 | | - "'037bf40e4e5eb32a165db42a35dd89e1c1546493'" |
| 451 | + "'3d27c573b7f9bdea704289567603f1d02e7e113b'" |
443 | 452 | ] |
444 | 453 | }, |
445 | 454 | "execution_count": null, |
|
476 | 485 | "name": "stdout", |
477 | 486 | "output_type": "stream", |
478 | 487 | "text": [ |
479 | | - "Quota remaining: 4995 of 5000\n" |
| 488 | + "Quota remaining: 4847 of 5000\n" |
480 | 489 | ] |
481 | 490 | }, |
482 | 491 | { |
|
512 | 521 | { |
513 | 522 | "data": { |
514 | 523 | "text/plain": [ |
515 | | - "'4995'" |
| 524 | + "'4847'" |
516 | 525 | ] |
517 | 526 | }, |
518 | 527 | "execution_count": null, |
|
926 | 935 | { |
927 | 936 | "data": { |
928 | 937 | "text/plain": [ |
929 | | - "5" |
| 938 | + "2" |
930 | 939 | ] |
931 | 940 | }, |
932 | 941 | "execution_count": null, |
|
961 | 970 | "name": "stdout", |
962 | 971 | "output_type": "stream", |
963 | 972 | "text": [ |
964 | | - "2022-08-08T08:42:29Z -> 2022-08-08 08:42:29\n" |
| 973 | + "2022-09-10T06:47:38Z -> 2022-09-10 06:47:38\n" |
965 | 974 | ] |
966 | 975 | } |
967 | 976 | ], |
|
1048 | 1057 | { |
1049 | 1058 | "data": { |
1050 | 1059 | "text/plain": [ |
1051 | | - "('https://gist.github.com/817fc7eb3446de412395570ee2f9af7b', 'some content')" |
| 1060 | + "('https://gist.github.com/b3e4356506c67cfa311e555edc3cd20a', 'some content')" |
1052 | 1061 | ] |
1053 | 1062 | }, |
1054 | 1063 | "execution_count": null, |
|
1185 | 1194 | "metadata": {}, |
1186 | 1195 | "outputs": [], |
1187 | 1196 | "source": [ |
| 1197 | + "sleep(0.2)\n", |
1188 | 1198 | "rels = api.repos.list_releases()\n", |
1189 | 1199 | "test_eq(len(rels), 1)" |
1190 | 1200 | ] |
|
1216 | 1226 | "text/markdown": [ |
1217 | 1227 | "---\n", |
1218 | 1228 | "\n", |
1219 | | - "#### GhApi.delete_release\n", |
| 1229 | + "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L160){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 1230 | + "\n", |
| 1231 | + "### GhApi.delete_release\n", |
1220 | 1232 | "\n", |
1221 | 1233 | "> GhApi.delete_release (release)\n", |
1222 | 1234 | "\n", |
1223 | 1235 | "Delete a release and its associated tag" |
1224 | 1236 | ], |
1225 | 1237 | "text/plain": [ |
1226 | | - "<nbdev.showdoc.BasicMarkdownRenderer>" |
| 1238 | + "---\n", |
| 1239 | + "\n", |
| 1240 | + "[source](https://github.com/fastai/ghapi/blob/master/ghapi/core.py#L160){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", |
| 1241 | + "\n", |
| 1242 | + "### GhApi.delete_release\n", |
| 1243 | + "\n", |
| 1244 | + "> GhApi.delete_release (release)\n", |
| 1245 | + "\n", |
| 1246 | + "Delete a release and its associated tag" |
1227 | 1247 | ] |
1228 | 1248 | }, |
1229 | 1249 | "execution_count": null, |
|
1667 | 1687 | "cell_type": "code", |
1668 | 1688 | "execution_count": null, |
1669 | 1689 | "metadata": {}, |
1670 | | - "outputs": [ |
1671 | | - { |
1672 | | - "data": { |
1673 | | - "text/markdown": [ |
1674 | | - "```json\n", |
1675 | | - "{}\n", |
1676 | | - "```" |
1677 | | - ], |
1678 | | - "text/plain": [ |
1679 | | - "{}" |
1680 | | - ] |
1681 | | - }, |
1682 | | - "execution_count": null, |
1683 | | - "metadata": {}, |
1684 | | - "output_type": "execute_result" |
1685 | | - } |
1686 | | - ], |
| 1690 | + "outputs": [], |
1687 | 1691 | "source": [ |
1688 | 1692 | "res = api.enable_pages(branch='new-branch', path='/')\n", |
| 1693 | + "\n", |
1689 | 1694 | "test_eq(res.source.branch, 'new-branch')\n", |
1690 | 1695 | "test_eq(res.source.path, '/')\n", |
| 1696 | + "\n", |
1691 | 1697 | "api.repos.delete_pages_site()\n", |
1692 | 1698 | "api.delete_branch('new-branch')" |
1693 | 1699 | ] |
|
0 commit comments