Skip to content

Instantly share code, notes, and snippets.

@Samk13
Last active August 28, 2023 10:02
Show Gist options
  • Save Samk13/edfc7fc73ef6d8db0b70344afaea40f6 to your computer and use it in GitHub Desktop.
Save Samk13/edfc7fc73ef6d8db0b70344afaea40f6 to your computer and use it in GitHub Desktop.
How to apply a patch for a python package

Working:

Download the patch:

curl 

Didn't work as expected

Instructions to apply a specific PR to a package (invenio-rdm-records as example)

  1. Uninstall the current version of the package (if already installed)
pip uninstall invenio-rdm-records 
  1. Install the invenio-rdm-records package with the specific PR applied
pip install git+https://github.com/inveniosoftware/invenio-rdm-records.git@master#egg=invenio-rdm-records --install-option="--patch" --install-option="https://github.com/inveniosoftware/invenio-rdm-records/pull/1303.patch"

If you need to install diffrent version you can change @master to @v1.3.5 the verison you want

Note: Make sure to test the modified package in a development or staging environment to ensure that it behaves as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment