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 1
1
doc : # 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
3
7
jupyter book build docs
4
8
5
9
clean-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:
26
26
- ' sphinx.ext.viewcode'
27
27
28
28
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
+
29
36
# Add GitHub buttons to your book
30
37
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
31
38
html :
Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ format: jb-book
2
2
root : README
3
3
4
4
chapters :
5
- - file : " api"
5
+ - file : " demo"
6
+ - file : " api"
Original file line number Diff line number Diff line change 1
1
[build-system ]
2
2
requires = [" setuptools>=62.1.0" , " wheel" ]
3
3
4
+ [tool .setuptools ]
5
+ py-modules = [" mypackage" ]
4
6
5
7
[project ]
6
8
name = " mypackage"
@@ -28,7 +30,7 @@ test = [
28
30
docs = [
29
31
" sphinx" ,
30
32
" jupyter-book" ,
31
- " pandoc "
33
+ " jupytext "
32
34
]
33
35
34
36
[tool .mypy ]
You can’t perform that action at this time.
0 commit comments