Skip to main content
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?

Metadata

Release files for compat-patcher-core 2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for compat-patcher-core 2.4
File Size Uploaded
compat_patcher_core-2.4.tar.gz 26.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for compat-patcher-core 2.4
File Interpreter ABI Platform
compat_patcher_core-2.4-py3-none-any.whl Python 3 none any Details

Total release size: 47.5 kB

Release files / compat_patcher_core-2.4.tar.gz

Download URL compat_patcher_core-2.4.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
706d548b5db71d3a7c1a7fb89df6fbbf5fc56db71ba1103546f2b54ce0d587ef
BLAKE2b-256 checksum
How to use checksums
910767271cec4870e23f439be6dd67de434842ab23831153b8b8f58e9d9dec01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / compat_patcher_core-2.4-py3-none-any.whl

Download URL compat_patcher_core-2.4-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e98fe5a7ee6ef07a32b4fcef81d4ef1e3401de5c00308791796a5172579aaf7
BLAKE2b-256 checksum
How to use checksums
30fb3b1f23ef923d996effccb5b77790b18b168d0f957bf9caa334ba464ec6de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

2.4 This release

2 release files

2.3

2 release files

2.2

1 release file

2.1

1 release file

2.0

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page