File tree Expand file tree Collapse file tree 6 files changed +76
-3
lines changed
Expand file tree Collapse file tree 6 files changed +76
-3
lines changed Original file line number Diff line number Diff line change 1+ # We create a simple docker file that install the necesseary dependencies for the package
2+
3+ FROM ubuntu:22.04
4+
5+ RUN apt-get update && \
6+ apt-get install -y python3-pip
7+
8+ # Use modern setuptools from pip instead of apt
9+ RUN pip3 install pip setuptools --upgrade
10+
11+ RUN apt-get purge python3-setuptools
12+
13+ # Create user with a home directory
14+ ARG NB_USER
15+ ARG NB_UID=1000
16+ ENV USER ${NB_USER}
17+ ENV HOME /home/${NB_USER}
18+
19+ # Copy home directory for usage in binder
20+ WORKDIR ${HOME}
21+ COPY . ${HOME}
22+ USER root
23+ RUN chown -R ${NB_UID} ${HOME}
24+
25+ USER ${NB_USER}
26+ ENTRYPOINT []
Original file line number Diff line number Diff line change 11doc : # Generate Sphinx HTML documentation, including API docs
2- cp README.md docs/README.md
2+ # We want to use the README.md file from the folder as the front page of the book.
3+ # It has been added to _toc.yml as root
4+ cp README.md docs/README.md
5+ # We want to use the demos in the book, we convert them with jupytext and copy them to the documentation
6+ jupytext --to=ipynb demos/demo.py --output=docs/demo.ipynb
37 jupyter book build docs
48
59clean-pytest : # Remove output from pytest
Original file line number Diff line number Diff line change 1+ # + [markdown]
2+ # # An introduction to the light format
3+ #
4+ # Author: Jørgen S. Dokken
5+ #
6+ # SPDX-License-Identifier: MIT
7+ # -
8+
9+ # + [markdown]
10+ # We start a new cell explicitly by using the "+" sign and can explicitly end
11+ # it by using the "-" sign.
12+ # -
13+
14+ # If we do not use explicit indicators for starting or ending a cell, it creates a
15+ # new cell whenever there is a blank line
16+
17+ # This is a new cell
18+
19+ # Comments can be added to code by not adding a new line before the code
20+ import mypackage
21+
22+ # Next we define two numbers, `a` and `b`
23+
24+ a = 1
25+ b = 3
26+
27+ # and add them together
28+
29+ c = mypackage .addition (a , b )
30+
31+ # We check the result
32+
33+ assert c == a + b
Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ sphinx:
2626 - ' sphinx.ext.viewcode'
2727
2828
29+ launch_buttons :
30+ notebook_interface : " jupyterlab" # The interface interactive links will activate ["classic", "jupyterlab"]
31+ binderhub_url : " https://mybinder.org"
32+ colab_url : " https://colab.research.google.com"
33+
34+
35+
2936# Add GitHub buttons to your book
3037# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
3138html :
Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ format: jb-book
22root : README
33
44chapters :
5- - file : " api"
5+ - file : " demo"
6+ - file : " api"
Original file line number Diff line number Diff line change 11[build-system ]
22requires = [" setuptools>=62.1.0" , " wheel" ]
33
4+ [tool .setuptools ]
5+ py-modules = [" mypackage" ]
46
57[project ]
68name = " mypackage"
@@ -28,7 +30,7 @@ test = [
2830docs = [
2931 " sphinx" ,
3032 " jupyter-book" ,
31- " pandoc "
33+ " jupytext "
3234]
3335
3436[tool .mypy ]
You can’t perform that action at this time.
0 commit comments