Could we have a config option to define additional paths where to search for modules?
I do not think so. We want to stick with standard Python.
So you can use standard Python tools to install your modules the way you want like using venv, PYTHONPATH
, .local
etc.
Ok thanks for reply. Coming back to dev, I’ve tried using PYTHONPATH with tryton docker using a volume with modules.
Problem: trytond-admin has not seen new modules. If I add a symbolic link in /usr/local/lib/python3.7/dist-packages/trytond/modules to a new module, I have no problem with trytond-admin. My conclusion is that there is a problem with searching trytond modules in PYTHONPATH
For .local, I don’t see what you intend to do. Adding a “/home/trytond/.local/trytond” folder with modules?
trytond search for modules only in its modules
directory or via entry-points.
If you are using docker image, you should customize the docker image to install the modules you need.
You mean with symbolic links in “modules” directory?
Ok but this is with setup.py when installing module.
So for development, there is only the symbolic link solution?
I do not know. I never understood how it could be preferred to use a docker image for development.
I speak globally, not with docker in mind
When developing custom module, we usually use just a virtual environment and install the developed module using python setup.py develop
.
When developing on standard module, we still use a virtual environment but just install the requirements.txt
and requirements-dev.txt
generated by the .hooks/update_requirements
of tryton-env: log repository.