Skip to content

Commit a536fc8

Browse files
committed
some more linting, readme, etc
1 parent bf9d3b5 commit a536fc8

File tree

7 files changed

+94
-46
lines changed

7 files changed

+94
-46
lines changed

README.md

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,59 @@
11
# robotframework-jupyterlibrary
2-
> A Robot Framework library for testing Jupyter end-user applications and extensions
2+
> A [Robot Framework][] library for automating (testing of) [Jupyter][] end-user applications and extensions
3+
4+
[Robot Framework]: http://robotframework.org
5+
[Jupyter]: https://jupyter.org
36

47
[![binder-badge][]][binder] [![pipeline-badge]][pipeline]
58

6-
> _TODO: rtd, pip, conda_
9+
# Using
10+
Write `.robot` files that use `JupyterLibrary` keywords.
11+
12+
*** Settings ***
13+
Library JupyterLibrary
14+
Suite Setup Wait for New Jupyter Server to be Ready
15+
Test Teardown Reset JupyterLab and Close
16+
Suite Teardown Terminate All Jupyter Servers
17+
18+
*** Test Cases ***
19+
A Notebook in JupyterLab
20+
Open JupyterLab
21+
Launch a new JupyterLab Document
22+
Add and Run JupyterLab Code Cell
23+
Wait Until JupyterLab Kernel Is Idle
24+
Capture Page Screenshot
25+
26+
See the [acceptance tests][] for examples.
27+
728

829
# Installation
30+
> _TODO: release on pypi, conda-forge_
931
1032
## Development Installation
33+
1134
- get Firefox
12-
- get Miniconda
13-
- update and activate
14-
```bash
15-
conda env update
16-
conda activate robotframework-jupyterlibrary
17-
```
18-
- then
19-
```bash
20-
pip install -e . --no-deps --ignore-installed
21-
```
22-
- run the tests
23-
```
24-
python -m scripts.atest
25-
```
35+
- Chrome works, too, but more fickle
36+
- get [Miniconda3][] (as in Python 3.6+)
37+
- clone this repo...
2638

27-
# Using
28-
> _TODO: Figure out a documentation strategy that works with
29-
janky-imported resources_
39+
git clone https://github.com/bollwyvl/robotframework-jupyterlibrary
40+
cd robotframework-jupyterlibrary
41+
42+
- update and activate...
43+
44+
conda env update
45+
conda activate robotframework-jupyterlibrary
46+
47+
- then...
48+
49+
pip install -e . --no-deps --ignore-installed
3050

31-
Write `.robot` files that use `JupyterLibrary` keywords. See the
32-
[acceptance tests](./atest/acceptance) for examples.
51+
- run the tests...
3352

53+
python -m scripts.atest
3454

55+
[acceptance tests]: https://github.com/bollwyvl/robotframework-jupyterlab
56+
[Miniconda3]: https://conda.io/miniconda.html
3557
[binder-badge]: https://mybinder.org/badge_logo.svg
3658
[binder]: https://mybinder.org/v2/gh/bollwyvl/robotframework-jupyterlibrary/master?urlpath=lab/tree/README.md
3759
[pipeline-badge]: https://dev.azure.com/nickbollweg/nickbollweg/_apis/build/status/bollwyvl.robotframework-jupyterlibrary

docs/INSTALL.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,20 @@
8383
"- get Miniconda\n",
8484
"- clone\n",
8585
" \n",
86-
" git clone http://github.com/bollwyvl/robotframework-jupyterlibrary\n",
86+
" git clone http://github.com/bollwyvl/robotframework-jupyterlibrary\n",
8787
"\n",
8888
"- update and activate\n",
8989
"\n",
90-
" conda env update\n",
91-
" conda activate robotframework-jupyterlibrary\n",
90+
" conda env update\n",
91+
" conda activate robotframework-jupyterlibrary\n",
9292
"\n",
9393
"- then\n",
9494
"\n",
95-
" pip install -e . --no-deps --ignore-installed\n",
95+
" pip install -e . --no-deps --ignore-installed\n",
9696
"\n",
9797
"- run the tests\n",
9898
"\n",
99-
" python -m scripts.atest"
99+
" python -m scripts.atest"
100100
]
101101
},
102102
{

docs/KEYWORDS.ipynb

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,20 @@
2525
},
2626
{
2727
"cell_type": "code",
28-
"execution_count": 3,
28+
"execution_count": 6,
29+
"metadata": {
30+
"jupyter": {
31+
"source_hidden": true
32+
}
33+
},
34+
"outputs": [],
35+
"source": [
36+
"iframe = lambda url: __import__(\"IPython\").display.HTML(f\"\"\"<iframe src=\"_static/{url}.html\" id=\"{url}\" width=\"100%\"></iframe>\"\"\")"
37+
]
38+
},
39+
{
40+
"cell_type": "code",
41+
"execution_count": 7,
2942
"metadata": {
3043
"jupyter": {
3144
"source_hidden": true
@@ -35,27 +48,18 @@
3548
{
3649
"data": {
3750
"text/html": [
38-
"\n",
39-
" <iframe\n",
40-
" width=\"100%\"\n",
41-
" height=\"\"\n",
42-
" src=\"_static/JupyterLibrary.html\"\n",
43-
" frameborder=\"0\"\n",
44-
" allowfullscreen\n",
45-
" ></iframe>\n",
46-
" "
51+
"<iframe src=\"_static/JupyterLibrary.html\" id=\"JupyterLibrary\" width=\"100%\"></iframe>"
4752
],
4853
"text/plain": [
49-
"<IPython.lib.display.IFrame at 0x7ff15c58c4a8>"
54+
"<IPython.core.display.HTML object>"
5055
]
5156
},
52-
"execution_count": 3,
57+
"execution_count": 7,
5358
"metadata": {},
5459
"output_type": "execute_result"
5560
}
5661
],
5762
"source": [
58-
"iframe = lambda url: __import__(\"IPython\").display.IFrame(f\"_static/{url}.html\", width=\"100%\", height=\"\")\n",
5963
"iframe(\"JupyterLibrary\")"
6064
]
6165
},

docs/_static/css/custom.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ a {
4343

4444
iframe {
4545
height: 95vh;
46+
border: 0;
4647
}
4748

4849
a:hover, a:active {

docs/index.ipynb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
"cell_type": "markdown",
1212
"metadata": {},
1313
"source": [
14-
"> A Robot Framework library for testing Jupyter end-user applications and extensions"
14+
"> A [Robot Framework][] library for automating (testing of) [Jupyter][] end-user applications and extensions\n",
15+
"\n",
16+
"[Robot Framework]: http://robotframework.org\n",
17+
"[Jupyter]: https://jupyter.org"
1518
]
1619
},
1720
{
@@ -23,17 +26,17 @@
2326
"```robotframework\n",
2427
"*** Settings ***\n",
2528
"Library JupyterLibrary\n",
26-
"Suite Setup Wait for New Jupyter Server to be Ready\n",
29+
"Suite Setup Wait for New Jupyter Server to be Ready\n",
2730
"Test Teardown Reset JupyterLab and Close\n",
2831
"Suite Teardown Terminate All Jupyter Servers\n",
2932
"\n",
3033
"*** Test Cases ***\n",
31-
"IPython Notebook\n",
34+
"A Notebook in JupyterLab\n",
3235
" Open JupyterLab\n",
3336
" Launch a new JupyterLab Document\n",
34-
" Add and Run JupyterLab Code Cell print(\"hello world\")\n",
37+
" Add and Run JupyterLab Code Cell\n",
3538
" Wait Until JupyterLab Kernel Is Idle\n",
36-
" Capture Page Screenshot ipython.png\n",
39+
" Capture Page Screenshot\n",
3740
"```"
3841
]
3942
},

scripts/lint.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
from pathlib import Path
12
from subprocess import check_call
23

4+
from nbformat import NO_CONVERT, read, write
5+
36

47
PY_SRC = ["src", "setup.py", "scripts", "docs"]
58
RF_SRC = ["atest", "src"]
@@ -13,6 +16,20 @@ def lint():
1316
for src in RF_SRC:
1417
check_call(["python", "-m", "robot.tidy", "-r", src])
1518

19+
for nbp in (Path(__file__).parent / "docs").rglob("*.ipynb"):
20+
nbf = read(nbp, NO_CONVERT)
21+
changed = False
22+
for cell in nbf:
23+
if cell.cell_type == "code_cell":
24+
if cell.outputs:
25+
cell.outputs = []
26+
changed = True
27+
if cell.execution_count:
28+
cell.execution_count = None
29+
changed = True
30+
if changed:
31+
write(nbf, nbp)
32+
1633

1734
if __name__ == "__main__":
1835
lint()

setup.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[metadata]
22
name = robotframework-jupyterlibrary
3-
description = A Robot Framework library for testing Jupyter end-user applications and extensions
4-
long_description = file: README.md, CHANGELOG.md
3+
description = A Robot Framework library for automating (testing of) Jupyter end-user applications and extensions
4+
long_description = file: README.md
5+
long_description_content_type = text/markdown
56
url = https://github.com/robots-from-jupyter/robotframework-jupyterlibrary
67
author = Nicholas Bollweg
78
author_email = nick.bollweg@gmail.com

0 commit comments

Comments
 (0)