Set python requirement via [tutor] plugin

Hi,

I’ve implemented a tutor plugin (in Yaml-syntax) to add additional social auth backends. That works very well.

As I add social auth backends, that are not part of the main python-social-auth package, I have to install my own python package, containing the appropriate backends.

Currently, I set this dependency/requirement by adding it to $(tutor config printroot)/env/build/openedx/requirements/private.txt. That works…but it is not as elegant as I’d like to have it :slight_smile:

I’d like to integrate setting this requirement also within the tutor-plugin.

So far, I tried it by adding

openedx-common-settings:
    OPENEDX_EXTRA_PIP_REQUIREMENTS: "git+https://link/to/my/git/project.git"  

Is this the correct way?

Hi @rk_n4e

If you want to add a git based requirement you can add it in your config.yml

tutor config save --append OPENEDX_EXTRA_PIP_REQUIREMENTS=git+https://link/to/my/git/project.git

After this

perform following
tutor images build openedx

bests,
rax

Yes for sure, that is an option I’m already aware of.
But this is not what I am looking for…cause I’d like to have all the additional stuff via the plugin configuration. Being able to hold all the parameter (related to the social auth modifications) in one place…especially because the plugin is also a git project.
So I’m looking for an option, to add the config parameter to config.yml by the plugin.

But as this is not an available patch (see Template patch catalog — Tutor documentation)…it seems to be not possible by intention :frowning:

Hi @rk_n4e, I’m not sure if this is the best approach but you could try the CONFIG_OVERRIDES Filter in tutor hooks api to add your requirements. Maybe something similar to this:

from tutor import hooks
hooks.Filters.CONFIG_OVERRIDES.add_item(
    ("OPENEDX_EXTRA_PIP_REQUIREMENTS", "git+https://link/to/my/git/project.git")
)