pythonandroidandroid-studiopipchaquopy

How to make changes in a built-in library file in chaquopy?


I am facing a problem where I have to change a line in a built-in file in a particular library (installed using pip). I have located the file in

app\build\pip\debug\common\<library folder>

But every time I run the Gradle (for installing or creating APK), the entire folder is recreated, and hence, the file is again the same as previous.

Is there any way to make the change permanent?


Solution

  • As mentioned in the comment by David K Hess, monkey patching may be the easiest solution.

    If monkey patching isn't suitable for your issue, then assuming the library is pure-Python, you can download it from PyPI, edit your local copy, and then install from that:

    In both cases, the install line should probably come first in the requirements list, before anything else which may depend on the library.