Installing extra pip packages

If we want to install a custom xBlock or a Django app, we need to put them into private.txt. Being able to specify the requirements directly in config.yml is a neater / simpler approach. For example - in e-commerce one can simply specify the requirements in ECOMMERCE_EXTRA_PIP_REQUIREMENTS and the packages get installed during the docker image build.

Can we have a similar OPENEDX_EXTRA_PIP_REQUIREMENTS config? So that we can specify dependencies directly in config.yml? And this will also make the way of specifying extra requirements consistent across images.

Well, technically, it’s already possible to pip-install extra packages in the openedx Docker image – either via private.txt, like you mentioned, or via the “openedx-dockerfile-post-python-requirements” patch. I am usually opposed to adding many new tutor settings. Yet, I agree with you that users very frequently have to pip-install custom requirements themselves in the openedx Docker image. So yes, I think it’s a good idea to introduce this new setting. I suggest to set it to a default value of ["openedx-scorm-xblock<13.0.0,>=12.0.0"] (and remove the corresponding line from the Dockerfile).

What do other @maintainers think about this proposal?

@regis I will create a PR soon to add the new configuration to Tutor. :slight_smile:

1 Like

@regis I’ve noticed that if OPENEDX_EXTRA_PIP_REQUIREMENTS setting is set in config.yml, it overwrites the value from the template config, which means the openedx-scorm-xblock package (which by default is set in as an extra package in the template config) wouldn’t get installed, and it wouldn’t be obvious to the user. I’m not familiar enough with tutor to know which implications that might have. Do you think this behavior is ok?

I think it’s OK if the behaviour of this variable is properly documented :slight_smile: