Use monkey patching for linkml patches #2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Monkey patching is also done in
dump-things-service, see https://hub.psychoinformatics.de/orinoco/dump-things-service/src/branch/master/dump_things_service/patches/init.py.If we follow this route, we also have to attend to the environment in which the monkey patches will be applied and available. This in turn depends on how we run linkml commands, which depends on #1. If we switch do using linkml python api, monkey patches can be applied in the same way as for
dump-things-service. If we stick tosubprocess, we will need to apply monkey patches for the base environment of each subprocess call.An approach if sticking to subprocess is to use
sitecustomizeto define how patching is done (i.e. importing the monkey patches) and then pass that to theenvargument ofsubprocessto let the process apply the patches.IIUC it would be e.g.
./site_bootstrap/sitecustomize.pycontaining:and then the subprocess environment config would be set up, and passed to
subprocess.run: