Skip to main content

Automatically generate and apply patches to fix installed packages

Project description

patch-package

PyPI - Python Version PyPI

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 !

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

patch_package-0.1.4.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

patch_package-0.1.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file patch_package-0.1.4.tar.gz.

File metadata

  • Download URL: patch_package-0.1.4.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for patch_package-0.1.4.tar.gz
Algorithm Hash digest
SHA256 c3c94e39a5f828bad9c12a8f5c0ded63bd8cd6f2e976dedc3d4eb4665b81c74d
MD5 dc8c0d54fe151eeaf3b19bdde8537492
BLAKE2b-256 6d247ab99181fe4552131cce94521187f1c4467d0826284b8c5405d939bde953

See more details on using hashes here.

File details

Details for the file patch_package-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: patch_package-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for patch_package-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6e4ef927a66e1b8d7d7d74b02b6fe29721ee1bf20f1f81f0775c83f74584277b
MD5 8993ad43faa63c5e3511d9d5ad36590a
BLAKE2b-256 c65dc2ed87ac99e1375bf2f59050f9cf6a88861d81edfeca0533fe8dee8f77d1

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