Announcing django-compat-patcher 0.2

Pascal Chambon chambon.pascal at gmail.com
Wed Feb 1 14:15:30 EST 2017


*** django-compat-patcher 0.2 has been released. ***

DCP is a “magic” package which adds backwards/forwards compatibility 
patches to Django, so that your app ecosystem doesn’t get broken by 
trivial changes made to the core of the framework.

It injects compatibility shims like function/attribute aliases, restores 
data structures which were replaced by stdlib ones, extends the 
behaviour of callables (eg. referring to a view by object, by name, or 
by dotted path), and can even preserve deprecated module as “import 
aliases” (ex. keep importing from “django.contrib.comments” instead of 
the now external “django_comments”).

This allows to you upgrade your dependencies one at a time, to 
fork/patch them when you have a proper opportunity, and most importantly 
to not get stuck, when deadlines are tight and your dependencies 
suddenly have conflicting requirements. DCP somehow relaxes the 
deprecation policy of Django, so that it comes closer to semantic 
versioning.

Technically, DCP manages a set of “fixers”, small utilities which 
advertise the change that they make, the versions of Django that they 
support, and which on monkey-patch the Django framework on demand. By 
applying these fixers in a proper order (sometimes before, sometimes 
after django.setup()), DCP can workaround multiple breaking changes 
which target the same part of the code (eg. a tag library being added 
and then removed).

Beware, DCP is aimed at project maintainers. If you are developing a 
reusable Django application, you can’t expect all your users to 
integrate DCP as well. In this case, to support a wide range of Django 
versions, you should rather use a toolkit like Django-compat 
<https://github.com/arteria/django-compat>. You may think of DCP as a 
“runtime 2to3 for Django’, wherease Django-Compat is rather a “six 
module for Django”.

Feel free to contribute new fixers, for backwards or forwards 
compatibility, depending on the compatibility troubles you encounter on 
your projects

https://pypi.python.org/pypi/django-compat-patcher
https://github.com/pakal/django-compat-patcher


More information about the Python-announce-list mailing list