From 43e841b1cbc757add8e1a170fb3d7f4b53564bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Mon, 16 Mar 2020 17:56:09 +0100 Subject: [PATCH] Add instructions for xblock development As per https://discuss.overhang.io/t/best-practice-xblock-development-in-tutor-dev-mode/345 --- docs/dev.rst | 21 +++++++++++++++++++++ docs/troubleshooting.rst | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/dev.rst b/docs/dev.rst index 804858d..028edeb 100644 --- a/docs/dev.rst +++ b/docs/dev.rst @@ -108,6 +108,27 @@ To debug a local edx-platform repository, add a ``import ipdb; ipdb.set_trace()` tutor dev runserver -v /path/to/edx-platform:/openedx/edx-platform lms +XBlock and edx-platform plugin development +------------------------------------------ + +In some cases you will have to develop features for packages that are pip-installed next to edx-platform. This is quite easy with Tutor. Just add your packages to the `$(tutor config printroot)/env/build/openedx/requirements/private.txt`` file. To avoid re-building the openedx Docker image at every change, you should add your package in editable mode. For instance:: + + echo "-e ./mypackage" >> "$(tutor config printroot)/env/build/openedx/requirements/private.txt" + +The ``requirements`` folder should have the following content:: + + env/build/openedx/requirements/ + private.txt + mypackage/ + setup.py + ... + +You will have to re-build the openedx Docker image once:: + + tutor images build openedx + +You should then run the development server as usual, with ``runserver``. Every change made to the ``mypackage`` folder will be picked up and the development server will be automatically reloaded. + .. _theming: Customised themes diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index 2ad7d93..2887eb4 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -47,7 +47,7 @@ This is not an error with Tutor, but with your Docker installation. This is freq docker run --rm hello-world -If the above command does not work, you should fix your Docker installation. Some people will suggest to run Docker as root, or with `sudo`; *do not do this*. Instead, what you should probably do is to add your user to the "docker" group. For more information, check out the `official Docker installation instructions `__. +If the above command does not work, you should fix your Docker installation. Some people will suggest to run Docker as root, or with ``sudo``; **do not do this**. Instead, what you should probably do is to add your user to the "docker" group. For more information, check out the `official Docker installation instructions `__. Help! The Docker containers are eating all my RAM/CPU/CHEESE ------------------------------------------------------------