Open rtibbles opened 1 year ago
It doesn't do completely nothing. It's used in kolibri.utils.main.initialize
to provide to Django when loading the settings. Unfortunately, the validation of the --settings
CLI option doesn't take it into account, so it effectively doesn't do anything since that's the only reason you'd use --pythonpath
.
It seems like the appropriate fix here then is to migrate this from kolibri.utils.main.initialize
to earlier in the CLI pipeline (before the settings option is processed).
I suppose, but the both the parsed pythonpath
and settings
option are passed to initialize
. It seems like a bit of a circular dependency - you need to parse and process pythonpath
before settings
. To me the simpler solution is to not do validate_module
at option parsing time or maybe not at all since it's only used for the django setup and django will certainly validate it.
It's possible with Click to require that one setting is parsed before another, so that would allow pythonpath to be processed first.
This has probably been extant for quite some time, and probably got lost in a CLI refactor/reshuffle at some point.
The --pythonpath option should validate the file path, and append the path to the PYTHONPATH.