Automatically generate and apply patches to fix installed packages
Project description
patch-package
patch-package is a Python library to automatically create and apply patches from changes made in installed packages. It is heavily inspired by patch-package which is the equivalent for Node packages.
Features
- Compatible with Python 2.7 and Python 3.5+
- Automatic code change detection between installed package and package source from pip
- Prevent patching when version or code are mismatching
- Automatic matching between import names and package names (e.g. yaml -> PyYAML) and fuzzy matching (e.g. request -> requests)
Usage
Install the library from PyPI
pip install patch-package
Make a change in one of your installed package and then generate the corresponding patch
patch-package <package-name>
Then when reinstalling the package you can apply back your patches
patch-package
All patches are contained in the patches/ folder so it can be commited to git and reapply whenever you want
Development
Make sure you have pyenv installed.
Install the tox library
pip install tox
Run tests
tox
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file patch_package-0.1.3.tar.gz
.
File metadata
- Download URL: patch_package-0.1.3.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.4-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afcf664f79427015a86f67391167d8d634a0f4b284de920294d200b6e3eea788 |
|
MD5 | e354bbb492119ad1ffa8e039e4203dd7 |
|
BLAKE2b-256 | 0b63bdf93fe497d9ce3a36f938d8b0aa9b5059f23af4ea49cdcfbba8406f5219 |
File details
Details for the file patch_package-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: patch_package-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.11.4-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3f35c684dc896c8ad0f38dc5a6e2caf6a8fd2ca811b976fdd1929650bd8352f |
|
MD5 | 770f31b6b6a51e6649442064b9067506 |
|
BLAKE2b-256 | ed8b3d993a2997995c81ba3fac56a0d1a6174ddc2c683fcf32e11eb3f6831688 |