Let's say I have a notebook I was working on that uses pip
in my cells and I want to make it reproducible.
-
Let's open the notebook called
make-notebook-reproducible
, provided innotebooks
folder.NOTE: A warning from the jupyterlab-requirements extension will appear to tell users what should be used to handle dependencies.
-
Run cell with
%horus check
to check the status of your notebook:As you can see, initially there are errors reported because no Pipfile or Pipfile.lock exist for this notebook.
-
Run
%horus convert
, so that the extenstion can convert!pip install
cells to commands that allow reproducibility. -
Run the converted cells to add the requirements to your notebook.
NOTE: If you want to edit some dependencies, you can simply add them again with your specific requirements (
%horus requirement --add
). -
Run cell with
%horus check
to check the status of your notebook. -
Run
%horus lock
to lock dependencies using Thoth resolution engine.If you are interested in a specific recommendation from Thoth, add
--recommendation-type <recommendation-type>
, default islatest
("latest", "stable", "performance", "security").By default, Thoth will discover the runtime environment you are running on. If you want to receive a recommendation for a specific runtime environment, you can use the following flags:
--os-name
--os-version
--python-version
You can also use
%horus lock --pipenv
if you want to lock dependencies with Pipenv resolution engine. -
Run cell with
%horus check
to check the status of your notebook or%horus show
to show the content of your notebook.If you want to show a specific part of your dependencies information stored in the notebook metadata, you can use the following flags:
--pipfile
--pipfile-lock
--thoth-config
(only if Thoth resolution engine was used)
You can consider another use case for managing dependencies: