Skip to content

Commit

Permalink
Setup doc structure (#3)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
agoscinski authored Dec 20, 2024
1 parent f05ea45 commit 1e109c7
Show file tree
Hide file tree
Showing 16 changed files with 2,722 additions and 111 deletions.
3 changes: 2 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ build:
apt_packages:
- cmake
tools:
python: "3.10"
python: "3.11"
nodejs: "20"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
93 changes: 1 addition & 92 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,95 +1,4 @@
Contributing
============

This is an instruction of the developer tools that help you contributing.

Running tests
-------------

Tests can be with run using

.. code-block:: bash
tox -e tests
You can source the test environment of tox after a run using

.. code-block:: bash
source .tox/tests/bin/activate
Converting notebook test files
##############################

The we store the notebooks as converted Python file using `jupytext` for the conversion
for better versioning

.. code-block:: bash
jupytext tests/notebooks/*.py --to ipynb
Be aware that when runnng the tests with tox all `*.ipynb` are overwriten by their
corresponding `*.py` file. For example, the file `test_widget_cue_box.ipynb` is
overwritten by the conversion of `test_widget_cue_box.py` when running the test.


Running with UI
###############

We use selenium to test the widgets on user actions (like a button click). To run it in
in the CI where no display is available. We run the browsers in headless model to not
load the UI. For debugging a test however, it is often benificial to see what is
happening in the window. To run the tests with the browser UI please use

.. code-block:: bash
pytest --driver Firefox
Port issues
###########

For the notebook server we fixed the port to 8815, if this port is not available you .
It can happen that notebook process is not properly killed and remains as zombie
process. You can check if a notebook with this port is already running using

.. code-block:: bash
jupyter notebook list | grep 8815
or if some process is using it

.. code-block:: bash
netstat -l | grep 8815
Formatting code
---------------

Your code can be formatted using

.. code-block:: bash
tox -e format
The formatting should fix most issues with linting, but sometimes you need to manually
fix some issues. To run the linter use

.. code-block:: bash
tox -e lint
Building documentation
----------------------

To build the docs please use

.. code-block:: bash
tox -e docs
To open the doc with for example firefox you can run

.. code-block:: bash
firefox docs/build/html/index.html
Please read the `developer documentation <developers.html>`_.
46 changes: 46 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
scwidgets = {file = "."}
anywidget = "==0.9.13"
asttokens = "==3.0.0"
comm = "==0.2.2"
contourpy = "==1.3.1"
cycler = "==0.12.1"
decorator = "==5.1.1"
executing = "==2.1.0"
fonttools = "==4.55.3"
ipython = "==8.30.0"
ipywidgets = "==8.1.5"
jedi = "==0.19.2"
jupyterlab-widgets = "==3.0.13"
kiwisolver = "==1.4.7"
matplotlib = "==3.9.4"
matplotlib-inline = "==0.1.7"
numpy = "==1.26.4"
packaging = "==24.2"
parso = "==0.8.4"
pexpect = "==4.9.0"
pillow = "==11.0.0"
prompt-toolkit = "==3.0.48"
psygnal = "==0.11.1"
ptyprocess = "==0.7.0"
pure-eval = "==0.2.3"
pygments = "==2.18.0"
pyparsing = "==3.2.0"
python-dateutil = "==2.9.0.post0"
six = "==1.17.0"
stack-data = "==0.6.3"
termcolor = "==2.5.0"
traitlets = "==5.14.3"
typing-extensions = "==4.12.2"
wcwidth = "==0.2.13"
widgetsnbextension = "==4.0.13"

[dev-packages]

[requires]
python_version = "3.11"
Loading

0 comments on commit 1e109c7

Please sign in to comment.