Skip to content

Commit 1e109c7

Browse files
authored
Setup doc structure (#3)
Initialize doc structure using notebooks: getting started, checks, exercise, nbgrader. Use nbsphinx for execution of notebooks and add stripping of docs to `tox -e format` in the `tox.ini`. nbsphinx has can visualize the widgets when executing while sphinx-gallery does not properly display the widgets after execution. Add pipfile and its lockfile for mybinder. Set doc style to sphinx-material. Move developers information in `CONTRIBUTING.rst` to docs. Updating README.rst removing prototype text.
1 parent f05ea45 commit 1e109c7

16 files changed

+2722
-111
lines changed

Diff for: .readthedocs.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ build:
1111
apt_packages:
1212
- cmake
1313
tools:
14-
python: "3.10"
14+
python: "3.11"
15+
nodejs: "20"
1516

1617
# Build documentation in the docs/ directory with Sphinx
1718
sphinx:

Diff for: CONTRIBUTING.rst

+1-92
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,4 @@
11
Contributing
22
============
33

4-
This is an instruction of the developer tools that help you contributing.
5-
6-
Running tests
7-
-------------
8-
9-
Tests can be with run using
10-
11-
.. code-block:: bash
12-
13-
tox -e tests
14-
15-
You can source the test environment of tox after a run using
16-
17-
.. code-block:: bash
18-
19-
source .tox/tests/bin/activate
20-
21-
Converting notebook test files
22-
##############################
23-
24-
The we store the notebooks as converted Python file using `jupytext` for the conversion
25-
for better versioning
26-
27-
.. code-block:: bash
28-
29-
jupytext tests/notebooks/*.py --to ipynb
30-
31-
Be aware that when runnng the tests with tox all `*.ipynb` are overwriten by their
32-
corresponding `*.py` file. For example, the file `test_widget_cue_box.ipynb` is
33-
overwritten by the conversion of `test_widget_cue_box.py` when running the test.
34-
35-
36-
Running with UI
37-
###############
38-
39-
We use selenium to test the widgets on user actions (like a button click). To run it in
40-
in the CI where no display is available. We run the browsers in headless model to not
41-
load the UI. For debugging a test however, it is often benificial to see what is
42-
happening in the window. To run the tests with the browser UI please use
43-
44-
.. code-block:: bash
45-
46-
pytest --driver Firefox
47-
48-
Port issues
49-
###########
50-
51-
For the notebook server we fixed the port to 8815, if this port is not available you .
52-
It can happen that notebook process is not properly killed and remains as zombie
53-
process. You can check if a notebook with this port is already running using
54-
55-
.. code-block:: bash
56-
57-
jupyter notebook list | grep 8815
58-
59-
or if some process is using it
60-
61-
.. code-block:: bash
62-
63-
netstat -l | grep 8815
64-
65-
Formatting code
66-
---------------
67-
68-
Your code can be formatted using
69-
70-
.. code-block:: bash
71-
72-
tox -e format
73-
74-
The formatting should fix most issues with linting, but sometimes you need to manually
75-
fix some issues. To run the linter use
76-
77-
.. code-block:: bash
78-
79-
tox -e lint
80-
81-
82-
Building documentation
83-
----------------------
84-
85-
To build the docs please use
86-
87-
.. code-block:: bash
88-
89-
tox -e docs
90-
91-
To open the doc with for example firefox you can run
92-
93-
.. code-block:: bash
94-
95-
firefox docs/build/html/index.html
4+
Please read the `developer documentation <developers.html>`_.

Diff for: Pipfile

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
scwidgets = {file = "."}
8+
anywidget = "==0.9.13"
9+
asttokens = "==3.0.0"
10+
comm = "==0.2.2"
11+
contourpy = "==1.3.1"
12+
cycler = "==0.12.1"
13+
decorator = "==5.1.1"
14+
executing = "==2.1.0"
15+
fonttools = "==4.55.3"
16+
ipython = "==8.30.0"
17+
ipywidgets = "==8.1.5"
18+
jedi = "==0.19.2"
19+
jupyterlab-widgets = "==3.0.13"
20+
kiwisolver = "==1.4.7"
21+
matplotlib = "==3.9.4"
22+
matplotlib-inline = "==0.1.7"
23+
numpy = "==1.26.4"
24+
packaging = "==24.2"
25+
parso = "==0.8.4"
26+
pexpect = "==4.9.0"
27+
pillow = "==11.0.0"
28+
prompt-toolkit = "==3.0.48"
29+
psygnal = "==0.11.1"
30+
ptyprocess = "==0.7.0"
31+
pure-eval = "==0.2.3"
32+
pygments = "==2.18.0"
33+
pyparsing = "==3.2.0"
34+
python-dateutil = "==2.9.0.post0"
35+
six = "==1.17.0"
36+
stack-data = "==0.6.3"
37+
termcolor = "==2.5.0"
38+
traitlets = "==5.14.3"
39+
typing-extensions = "==4.12.2"
40+
wcwidth = "==0.2.13"
41+
widgetsnbextension = "==4.0.13"
42+
43+
[dev-packages]
44+
45+
[requires]
46+
python_version = "3.11"

0 commit comments

Comments
 (0)