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 3.8+
- 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
Install the library in editable mode
uv pip install -e .
Do whatever modifications you want and file a pull request, thanks !
Metadata
Release files for patch-package 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| patch_package-0.1.4.tar.gz | 10.7 kB | Without provenance | Details for patch_package-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| patch_package-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for patch_package-0.1.4-py3-none-any.whl |
Total release size: 15.4 kB
Release files / patch_package-0.1.4.tar.gz
| Download URL | patch_package-0.1.4.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3c94e39a5f828bad9c12a8f5c0ded63bd8cd6f2e976dedc3d4eb4665b81c74d
|
|
BLAKE2b-256 checksum How to use checksums |
6d247ab99181fe4552131cce94521187f1c4467d0826284b8c5405d939bde953
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / patch_package-0.1.4-py3-none-any.whl
| Download URL | patch_package-0.1.4-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e4ef927a66e1b8d7d7d74b02b6fe29721ee1bf20f1f81f0775c83f74584277b
|
|
BLAKE2b-256 checksum How to use checksums |
c65dc2ed87ac99e1375bf2f59050f9cf6a88861d81edfeca0533fe8dee8f77d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for patch-package 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.