Skip to main content

Library to parse and apply unified diffs.

Project description

CI Status PyPI

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)

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

paatch-1.20.2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paatch-1.20.2-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file paatch-1.20.2.tar.gz.

File metadata

  • Download URL: paatch-1.20.2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for paatch-1.20.2.tar.gz
Algorithm Hash digest
SHA256 3baf632f7d1db199a1e3771546ddd17b705a548259d44bfd7098159485ae24d9
MD5 0c6d56f1bf56c3d3dbcc3f85d68c0e42
BLAKE2b-256 a7e004212fd58a5cb7c7eeff61eb2826370cb183d8e507f3cf46cdec56658c05

See more details on using hashes here.

File details

Details for the file paatch-1.20.2-py3-none-any.whl.

File metadata

  • Download URL: paatch-1.20.2-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for paatch-1.20.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ca305e11ddd9ccc55c6d8ac5589ef648c16ab938a835a1f07408a29aaf212e3
MD5 7637da8843c2468ed14d2ef9b9cf9508
BLAKE2b-256 67ed83c8c8e44fe2931a71a8547822604f08441ca7ad627a6aca6587e49d37dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page