Everyday tasks

The commands you need most days.

Apply your patches

venv-patcher apply -f patches.yml

Run it after each pip install into a new venv. It is safe to run again.

Apply the patches of one package

venv-patcher apply -f patches.yml -p requests

All other entries in the file are skipped.

See what is patched

venv-patcher list

Undo all patches

venv-patcher reset

Undo the patches of one package

venv-patcher reset -p requests

Change a patch and apply it again

venv-patcher apply --force -f patches.yml -p requests

--force first undoes the patches of requests. Then it applies the file. See Work on a patch.

Look at a patched package

Each patched package is a git repository:

cd "$(python -c 'import requests, pathlib; print(pathlib.Path(requests.__file__).parent)')"
git log --oneline
git diff HEAD~1

[!TIP] Look, but do not commit there yourself. reset goes back to the initial commit and drops anything on top.

Upgrade a patched package

pip install -U requests
venv-patcher apply --force -p requests -f patches.yml

See Upgrade a patched package.