Skip to main content

A patcher system to allow easy and lasting API compatibility

Project description

https://ci.appveyor.com/api/projects/status/kyxas49ktvrfqu52/branch/master

Long term API compatibility for fast-moving projects

Welcome to Compat Patcher Core, a mini-framework to build Compatibility Patchers. These companion applications allow your favorite software (a framework, a library…) to keep long term API stability towards its ecosystem (plugins, bridges to other applications…), while still keeping the main codebase clean, and getting new features at a good pace.

Compatibility Patchers inject backward/forward compatibility shims (like class/function/attribute aliases), restore features which were dropped/externalized because “not used enough” or “outside the scope of the library”, and tweak the signatures and behaviour of callables (eg. for arguments which disappeared, or which became mandatory). It can even setup lazy “import aliases”, so that code can import a moved module both from its old and new location.

These shims allows you to upgrade your dependencies one at a time, when their maintainer finally had some time for a code update, or when missing features and bugfixes justify a fork. Most importantly, they allow you to not get stuck, when deadlines are tight, and crucial dependencies have conflicting expectations regarding the software version.

Note that compatibility Patchers are not supposed to undo changes related to security (default access permissions, markup escaping, cookie parameters…), because of the risks involved. Also, changes that only impact project-level code (eg. new mandatory settings) should not get patched, since it’s easier and cleaner for to simply update project code.

Technically, Compatibility Patchers are packages which manage a set of fixers, tiny utilities (often less than 10 lines of code) which advertise the change that they make, the software versions that they support, and which patch the target code on demand. By applying these fixers in a proper order (sometimes before, sometimes after the initialization of the patched software itself), Compatibility Patchers can easily “time travel”, and work around multiple breaking changes which target the same part of the code (e.g. a content handler being added and then removed).

Compat Patcher Core holds the core logic of that system, via easily extendable classes: a registry system, monkey-patching utilities, and a generic runner to be called at the very start of your application. It also contains a cookiecutter recipe to setup your own Compatibility Patcher in a few minutes, with test scaffolding and packaging metadata ready for launch.

Documentation is available on Read The Docs

Sources are available on Github

Which applications currently benefit from this system?

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

compat_patcher_core-2.3.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

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

compat_patcher_core-2.3-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file compat_patcher_core-2.3.tar.gz.

File metadata

  • Download URL: compat_patcher_core-2.3.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for compat_patcher_core-2.3.tar.gz
Algorithm Hash digest
SHA256 351872c549ceebaea8dfa9f737fb533f6af3dc1a3e277e97332b3b66798f3bea
MD5 8bbbe086d069570239b86334bb4cb947
BLAKE2b-256 310e0f0a5ea11f0f3beb3e233b02154e47df864f7946e82ce12a964411a7883d

See more details on using hashes here.

File details

Details for the file compat_patcher_core-2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for compat_patcher_core-2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a2ebcca3c81efcba163446f3fe0197cf0654c6b29c94604959f3ea0762c977d1
MD5 15ce93093e4a79123cb283e07f5a7aab
BLAKE2b-256 45b4277668b4239f94923f0ebc4f80e09cdc0f7b2d475e10dbe09746f054c6bc

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