diff --git a/Dockerfile b/Dockerfile index 96ed47e..ef189c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,22 @@ FROM ubuntu:22.04 + RUN apt-get update && \ - apt-get install -y python3-pip + apt-get install -y python3-pip git # Use modern setuptools from pip instead of apt RUN pip3 install pip setuptools --upgrade -RUN apt-get purge python3-setuptools +RUN apt-get purge -y python3-setuptools + + +# Install mypackage +WORKDIR /tmp/ +RUN git clone https://github.com/jorgensd/reproducibility && \ + pip3 install ./reproducibility[docs] + +RUN rm -rf /tmp # Create user with a home directory ARG NB_USER diff --git a/Makefile b/Makefile index 75906e5..5e9f700 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,9 @@ doc: # Generate Sphinx HTML documentation, including API docs @for file in ${DOCS}; do \ cp $$file docs/. ;\ done +# We use --set-kernel with jupytext to make it possible for binder to pick it up @for demo in ${DEMOS}; do \ - jupytext --to=ipynb demo/$$demo.py --output=docs/$$demo.ipynb ;\ + jupytext --to=ipynb --set-kernel=python3 demo/$$demo.py --output=docs/$$demo.ipynb ;\ jupyter book build -W docs ;\ done diff --git a/README.md b/README.md index 1ef19be..8acdb02 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,7 @@ This repository is a template for how to set up a reproducible python environmen ## Python-packaging -To be able to create a python package, we need a folder with the name of the package (in this repository `mypackage`), and a `pyproject.toml` file. - +To be able to create a python package, we need a folder with the name of the package (in this repository it is called `mypackage`, located under `src/mypackage`), and a `pyproject.toml` file. ## Make a repository citable diff --git a/docs/_config.yml b/docs/_config.yml index 4bc9884..15df70a 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -15,33 +15,28 @@ execute: # Information about where the book exists on the web repository: url: https://github.com/jorgensd/reproducibility # Online location of your book - path_to_book: docs # Optional path to your book, relative to the repository root - branch: main # Which branch of the repository should be used when creating links (optional) - - -sphinx: - extra_extensions: - - 'sphinx.ext.autodoc' - - 'sphinx.ext.napoleon' - - 'sphinx.ext.viewcode' - + path_to_book: _sources # Optional path to your book, relative to the repository root + branch: gh-pages # Which branch of the repository should be used when creating links (optional) launch_buttons: notebook_interface: "jupyterlab" # The interface interactive links will activate ["classic", "jupyterlab"] binderhub_url: "https://mybinder.org" - colab_url: "https://colab.research.google.com" - - -# Add GitHub buttons to your book -# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository html: use_issues_button: true use_repository_button: true - parse: myst_enable_extensions: - amsmath - dollarmath - - linkify \ No newline at end of file + - linkify + +sphinx: + extra_extensions: + - 'sphinx.ext.autodoc' + - 'sphinx.ext.napoleon' + - 'sphinx.ext.viewcode' + + +