Skip to content

Commit c5d878c

Browse files
committed
fixes #33
1 parent ae89ce3 commit c5d878c

File tree

7 files changed

+33
-20
lines changed

7 files changed

+33
-20
lines changed

01_actions.ipynb

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"from ghapi.templates import *\n",
3434
"\n",
3535
"import textwrap\n",
36+
"from contextlib import contextmanager\n",
3637
"from enum import Enum"
3738
]
3839
},
@@ -597,21 +598,31 @@
597598
"outputs": [],
598599
"source": [
599600
"#export\n",
601+
"@contextmanager\n",
600602
"def actions_group(title):\n",
601-
" \"Print the special `::group` line for `title`\"\n",
602-
" print(f\"::group::{title}\")"
603+
" \"Context manager to print the special `::group`/`::endgroup` lines for `title`\"\n",
604+
" print(f\"::group::{title}\")\n",
605+
" yield\n",
606+
" print(f\"::endgroup::\")"
603607
]
604608
},
605609
{
606610
"cell_type": "code",
607611
"execution_count": null,
608612
"metadata": {},
609-
"outputs": [],
613+
"outputs": [
614+
{
615+
"name": "stdout",
616+
"output_type": "stream",
617+
"text": [
618+
"::group::Adding numbers...\n",
619+
"2\n",
620+
"::endgroup::\n"
621+
]
622+
}
623+
],
610624
"source": [
611-
"#export\n",
612-
"def actions_endgroup():\n",
613-
" \"Print the special `::endgroup`\"\n",
614-
" print(f\"::endgroup::\")"
625+
"with actions_group('Adding numbers...'): print(1+1)"
615626
]
616627
},
617628
{
@@ -684,11 +695,15 @@
684695
"text": [
685696
"Converted 00_core.ipynb.\n",
686697
"Converted 01_actions.ipynb.\n",
698+
"Converted 02_auth.ipynb.\n",
699+
"Converted 03_page.ipynb.\n",
700+
"Converted 04_event.ipynb.\n",
687701
"Converted 10_cli.ipynb.\n",
688702
"Converted 50_fullapi.ipynb.\n",
703+
"Converted 80_tutorial_actions.ipynb.\n",
689704
"Converted 90_build_lib.ipynb.\n",
690-
"Converted index.ipynb.\n",
691-
"Converted tutorial_actions.ipynb.\n"
705+
"Converted ghapi demo.ipynb.\n",
706+
"Converted index.ipynb.\n"
692707
]
693708
}
694709
],

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ docs: $(SRC)
2121
test:
2222
nbdev_test_nbs
2323

24-
release: pypi #conda_release
24+
release: pypi conda_release
2525
nbdev_bump_version
2626

2727
conda_release:

ghapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.1.14"
1+
__version__ = "0.1.15"
22

ghapi/_nbdev.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"actions_warn": "01_actions.ipynb",
3939
"actions_error": "01_actions.ipynb",
4040
"actions_group": "01_actions.ipynb",
41-
"actions_endgroup": "01_actions.ipynb",
4241
"actions_mask": "01_actions.ipynb",
4342
"set_git_user": "01_actions.ipynb",
4443
"Scope": "02_auth.ipynb",

ghapi/actions.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'context_secrets', 'context_strategy', 'context_matrix', 'context_needs', 'env_github', 'user_repo', 'Event',
55
'create_workflow_files', 'fill_workflow_templates', 'env_contexts', 'def_pipinst', 'create_workflow',
66
'gh_create_workflow', 'example_payload', 'github_token', 'actions_output', 'actions_debug', 'actions_warn',
7-
'actions_error', 'actions_group', 'actions_endgroup', 'actions_mask', 'set_git_user']
7+
'actions_error', 'actions_group', 'actions_mask', 'set_git_user']
88

99
# Cell
1010
from fastcore.utils import *
@@ -15,6 +15,7 @@
1515
from .templates import *
1616

1717
import textwrap
18+
from contextlib import contextmanager
1819
from enum import Enum
1920

2021
# Cell
@@ -137,13 +138,11 @@ def actions_error(message, details=''):
137138
print(f"::error {details}::{message}")
138139

139140
# Cell
141+
@contextmanager
140142
def actions_group(title):
141-
"Print the special `::group` line for `title`"
143+
"Context manager to print the special `::group`/`::endgroup` lines for `title`"
142144
print(f"::group::{title}")
143-
144-
# Cell
145-
def actions_endgroup():
146-
"Print the special `::endgroup`"
145+
yield
147146
print(f"::endgroup::")
148147

149148
# Cell

ghapi/page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ def _call_page(i, oper, args, kwargs, per_page):
6767
def pages(oper, n_pages, *args, n_workers=None, per_page=100, **kwargs):
6868
"Get `n_pages` pages from `oper(*args,**kwargs)`"
6969
return parallel(_call_page, range(1,n_pages+1), oper=oper, per_page=per_page, args=args, kwargs=kwargs,
70-
progress=False, n_workers=ifnone(n_workers,n_pages), threadpool=True)
70+
progress=False, n_workers=ifnone(n_workers,n_pages), threadpool=True)

settings.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author = Jeremy Howard
88
author_email = [email protected]
99
copyright = fastai
1010
branch = master
11-
version = 0.1.14
11+
version = 0.1.15
1212
min_python = 3.6
1313
audience = Developers
1414
language = English

0 commit comments

Comments
 (0)