Skip to content

Commit

Permalink
Bugfix: add ipykernel and nbconvert to test requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed May 17, 2021
1 parent a162fe5 commit 6389d23
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
path: dist

- name: Install build + test dependencies
run: pip install pytest dist/*.whl
run: pip install pytest dist/*.whl nbconvert ipykernel

- name: Test package
run: jupyter nbconvert examples/**/*.ipynb src/**/*.ipynb --to=notebook --execute --output-dir=$(mktemp -d)
Expand Down
112 changes: 18 additions & 94 deletions src/literary/core/transformers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@
"cell_type": "code",
"execution_count": 1,
"id": "eaa04dfe-1007-44a8-ad14-28f16f82f5c5",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:07.671316Z",
"iopub.status.busy": "2021-05-17T16:24:07.670669Z",
"iopub.status.idle": "2021-05-17T16:24:07.959810Z",
"shell.execute_reply": "2021-05-17T16:24:07.958354Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"%load_ext literary.notebook\n",
Expand All @@ -38,12 +31,6 @@
"execution_count": 2,
"id": "extended-national",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:07.965391Z",
"iopub.status.busy": "2021-05-17T16:24:07.964182Z",
"iopub.status.idle": "2021-05-17T16:24:07.967385Z",
"shell.execute_reply": "2021-05-17T16:24:07.968202Z"
},
"tags": [
"export"
]
Expand All @@ -62,12 +49,6 @@
"execution_count": 3,
"id": "elect-event",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:07.974379Z",
"iopub.status.busy": "2021-05-17T16:24:07.973776Z",
"iopub.status.idle": "2021-05-17T16:24:07.977045Z",
"shell.execute_reply": "2021-05-17T16:24:07.977552Z"
},
"tags": [
"export"
]
Expand All @@ -82,12 +63,6 @@
"execution_count": 4,
"id": "opponent-bottle",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:07.981273Z",
"iopub.status.busy": "2021-05-17T16:24:07.980672Z",
"iopub.status.idle": "2021-05-17T16:24:07.983199Z",
"shell.execute_reply": "2021-05-17T16:24:07.983787Z"
},
"tags": [
"export"
]
Expand Down Expand Up @@ -118,12 +93,6 @@
"execution_count": 5,
"id": "swedish-denial",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:07.995409Z",
"iopub.status.busy": "2021-05-17T16:24:07.994720Z",
"iopub.status.idle": "2021-05-17T16:24:07.998263Z",
"shell.execute_reply": "2021-05-17T16:24:07.997281Z"
},
"tags": [
"export"
]
Expand Down Expand Up @@ -175,14 +144,7 @@
"cell_type": "code",
"execution_count": 6,
"id": "imperial-character",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:08.004341Z",
"iopub.status.busy": "2021-05-17T16:24:08.003348Z",
"iopub.status.idle": "2021-05-17T16:24:08.005602Z",
"shell.execute_reply": "2021-05-17T16:24:08.004995Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"ipython_transformer = IPythonTransformer(error_if_ipython=True)"
Expand All @@ -200,14 +162,7 @@
"cell_type": "code",
"execution_count": 7,
"id": "transsexual-chart",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:08.009670Z",
"iopub.status.busy": "2021-05-17T16:24:08.009018Z",
"iopub.status.idle": "2021-05-17T16:24:08.011318Z",
"shell.execute_reply": "2021-05-17T16:24:08.011828Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"node = ast.parse(\"get_ipython().magic('matplotlib inline')\")"
Expand All @@ -225,14 +180,7 @@
"cell_type": "code",
"execution_count": 8,
"id": "guided-planning",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:08.016506Z",
"iopub.status.busy": "2021-05-17T16:24:08.015891Z",
"iopub.status.idle": "2021-05-17T16:24:08.018662Z",
"shell.execute_reply": "2021-05-17T16:24:08.018038Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"with pytest.raises(ValueError):\n",
Expand All @@ -253,12 +201,6 @@
"execution_count": 9,
"id": "indonesian-prior",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:08.031708Z",
"iopub.status.busy": "2021-05-17T16:24:08.031058Z",
"iopub.status.idle": "2021-05-17T16:24:08.035317Z",
"shell.execute_reply": "2021-05-17T16:24:08.033968Z"
},
"tags": [
"export"
]
Expand Down Expand Up @@ -360,14 +302,7 @@
"cell_type": "code",
"execution_count": 10,
"id": "rental-ladder",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:08.040967Z",
"iopub.status.busy": "2021-05-17T16:24:08.040280Z",
"iopub.status.idle": "2021-05-17T16:24:08.042713Z",
"shell.execute_reply": "2021-05-17T16:24:08.042069Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"transformer = PatchTransformer(patch_decorator_id=\"patch\")"
Expand All @@ -377,14 +312,7 @@
"cell_type": "code",
"execution_count": 11,
"id": "speaking-yellow",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:08.046797Z",
"iopub.status.busy": "2021-05-17T16:24:08.046189Z",
"iopub.status.idle": "2021-05-17T16:24:08.049001Z",
"shell.execute_reply": "2021-05-17T16:24:08.048399Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"node = ast.parse(\n",
Expand All @@ -407,31 +335,27 @@
"cell_type": "code",
"execution_count": 12,
"id": "polyphonic-airfare",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:08.053388Z",
"iopub.status.busy": "2021-05-17T16:24:08.052793Z",
"iopub.status.idle": "2021-05-17T16:24:08.055769Z",
"shell.execute_reply": "2021-05-17T16:24:08.055148Z"
}
},
"metadata": {},
"outputs": [],
"source": [
"new_node = transformer.visit(node)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8b266ea1-cf33-4911-bca6-2141119d3a15",
"metadata": {},
"outputs": [],
"source": [
"raise ValueError"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "charitable-regular",
"metadata": {
"execution": {
"iopub.execute_input": "2021-05-17T16:24:08.060187Z",
"iopub.status.busy": "2021-05-17T16:24:08.059551Z",
"iopub.status.idle": "2021-05-17T16:24:08.063878Z",
"shell.execute_reply": "2021-05-17T16:24:08.063338Z"
}
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down

0 comments on commit 6389d23

Please sign in to comment.