Paatch - parse and apply unified diffs
Installation and Usage
pip install paatch
patch -h
Why did I fork?
This project is a fork of python-patch-ng, which itself is a fork of the original python-patch project.
I needed a tool to apply unified patches with some GNU extensions, ideally in pure Python.
The set of patches I'm interested are the GraalPy patches.
They apply fine with GNU patch, but the BSD patch utility in macOS chokes on some and getting GNU patch to work on Windows was a bit of hit and miss.
This is also why originally the python-patch project was born in the first place:
In 2008 there was no reliable Windows tool to apply patches, and there was no cross-platform solution that could be safely run by web server process.
(UNIX patch utility)[http://www.gnu.org/software/patch/] was (ported to windows)[http://gnuwin32.sourceforge.net/packages/patch.htm], but there were (a couple of bugs) [http://www.google.com/search?q=Assertion+failed%3A+hunk%2C+file+patch.c] that proved that it can not be run securely in web server process. The utility was also hard to tweak without a C compiler, it messed badly with LF and CRLF line end differences, and so this project was born.
patch.py was meant to be a cross-platoform tool with intuitive defaults, taking care of the most problems (e.g. line end differences) automatically.
So I added what I needed, and now have a PyPI package I can use to apply GraalPy patches on each of these platforms and they will be applied in the same manner.
Credits
Reproducing the thanks in the original project:
Alex Stewart Wladimir J. van der Laan (laanwj) azasypkin Philippe Ombredanne mspncp Yen Chi Hsuan (@yan12125)
Metadata
Release files for paatch 1.20.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| paatch-1.20.3-py3-none-any.whl | Python 3 | none | any | Details for paatch-1.20.3-py3-none-any.whl |
Release files / paatch-1.20.3-py3-none-any.whl
| Download URL | paatch-1.20.3-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adfbb2bbc28adc4e138e84976922b1ce1bdebdece0e59681a75baec75348bec8
|
|
BLAKE2b-256 checksum How to use checksums |
83c36b46ac331c64ece4d3663c9e040bbbf36a20f589a0032b0f83ea0b63569f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Security for paatch 1.20.3
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.