diff --git a/changelog.d/20230111_135800_kdmc_egg_info_entrypoint.md b/changelog.d/20230111_135800_kdmc_egg_info_entrypoint.md new file mode 100644 index 00000000000..940dc710f14 --- /dev/null +++ b/changelog.d/20230111_135800_kdmc_egg_info_entrypoint.md @@ -0,0 +1,13 @@ + + + + + +- [Improvement] It is no longer necessary to pip-install any requirements after bind-mounting a local copy of edx-platform. diff --git a/docs/dev.rst b/docs/dev.rst index 4ff7c933a66..17f9991f05f 100644 --- a/docs/dev.rst +++ b/docs/dev.rst @@ -211,9 +211,6 @@ Then, you should run the following commands:: # Run bash in the lms container tutor dev run --mount=/path/to/edx-platform lms bash - # Compile local python requirements - pip install --requirement requirements/edx/development.txt - # Install nodejs packages in node_modules/ npm clean-install diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index b78e6b77fbe..b3282e7cee5 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -210,6 +210,7 @@ ENV DJANGO_SETTINGS_MODULE lms.envs.tutor.production {{ patch("openedx-dockerfile") }} EXPOSE 8000 +ENTRYPOINT ["set-up-and-run"] ###### Intermediate image with dev/test dependencies FROM production as development diff --git a/tutor/templates/build/openedx/bin/set-up-and-run b/tutor/templates/build/openedx/bin/set-up-and-run new file mode 100755 index 00000000000..3e554a91972 --- /dev/null +++ b/tutor/templates/build/openedx/bin/set-up-and-run @@ -0,0 +1,13 @@ +#!/bin/sh + +# If the the entry points info file (within the *egg-info directory) +# doesn't exist or is out-of-date with respect to setup.py, +# then we need to (re-)generate the egg-info by pip-installing this directory. +# Otherwise, XBlocks and Django App Plugins will not be registered. +ENTRY_POINTS_INFO=Open_edX.egg-info/entry_points.txt +if [ ! -f "$ENTRY_POINTS_INFO" ] || [ "$ENTRY_POINTS_INFO" -ot setup.py ]; then + pip install -e . +fi + +# Run all arguments as a command. +"$@" || true