There’s a Python program that I update regularly. Every time I update the program, I need to modify a specific Python file to change its functionality. Instead of manually patching the file each time, I’d like to automate the process.

I’m looking for a way to automatically apply a patch to a Python file whenever the program updates or if the file doesn’t have the desired modifications.

Any advice or suggestions on how to automate this process would be greatly appreciated!

  • @Diabolo96@lemmy.dbzer0.com
    link
    fedilink
    5
    edit-2
    23 days ago

    Easy. Don’t run the python files directly but create a a launcher script that use md5 hash to check if the python file you wanna run changed and then apply the patch before actually running the patched python file. This avoid ever running the unpatched version.