Hello,

thanks for your feedback,

Actually this DCP layer is mainly aimed at backwards compatibility of 
dependencies : running, on the latest version of django (with maximal 
security bugfixes), older reusable apps which are incompatible with 
each-other, or with said latest version of Django.

When I hear "*lax semantic versioning*", it makes me think about an "almost 
alive parrot" or a "mostly non-lethal drink", i.e not something especially 
reassuring ; especially when I remember how the sentences "*Django promises 
API stability and forwards-compatibility since version 1.0. In a nutshell, 
this means that code you develop against a version of Django will continue 
to work with future releases*." were imho untrue. 

If I understand correctly, with the new release process, reusable apps and 
libraries would still be broken every two LTS releases, i.e every 16 
months. For a big software ecosystem, this is still a really short 
lifespan. And since not every developers cares about deprecation warnings 
(when they are visible), it means any pypi package for django which hasn't 
been updated for 6 or 12 months would quite likely be broken. This means 
lots of forks without any added value, without evolutions nor bugfixes, 
just "so that it keeps working" .

Many major languages or frameworks have strong commitments on 
retrocompatibility, and have succeeded on this commitment for years 
(python2 being one of them) ; I remember a blogpost where a Qt developer 
explained at great lengths how they carefully crafted every function 
signature, so that it could evolve without breaking older code. If they can 
achieve this C++, how comes major python frameworks would do less ? 

My opinion is that the "walk or die" approach of Django is harmful to its 
ecosystem, and furthermore unnecessary, since a layer like DCP can ensure 
BOTH a wart-free & fast-moving codebase, and a strong retrocompatibility.

About the current tests of deprecation warnings, to me this is a wrong 
"separation of concerns". Checking that a web framework feature works, and 
checking that it properly triggers specific warnings, are aspects which 
should not be mixed with each other. 
Why ? Because it prevents advanced uses of test suites. For example, how do 
you check that Django version X.Y hasn't broken code written for previous 
releases ? Just because it passes its own test suite ? Just because 
"committers have been careful" ? I don't think it says much. What I'd do, 
is rather run the unit-tests of the previous django version (excluding some 
specifically marked "short-lived" tests), against the newest code. This 
would mean so much more.

Here is my view on why using a compatibility layer in Django (or any 
framework, actually) would be a good idea :

PROs:
- cleaner django codebase
- less work to deprecate features
- automated checks of compatibility between django version
- easily achieve long-term compatibility
- more control given to django users regarding compatibility choices

CONs:
- small additional delay at django startup ?

Am I missing something there ?

regards,
Pascal Chambon

Le mardi 10 janvier 2017 01:29:41 UTC+1, Tim Graham a écrit :
>
> Our new deprecation policy was designed to eliminate the need for this 
> type of compatibility library. If you want to support more Django versions 
> than what our guidelines recommend (which may involve supporting versions 
> that no longer receive security updates), I guess this library could be 
> useful, but I wouldn't give it an endorsement in the Django docs.
>
> Perhaps you could elaborate on "Most importantly, this way, django main 
> tests suites  would stop making asserts on the presence or absence of 
> deprecation warnings (which is a way of mixing unrelated aspects of the 
> framework)." I don't understand your complaint about the current way we're 
> testing deprecation warnings.
>
> On Saturday, January 7, 2017 at 3:17:06 PM UTC-5, Pkl wrote:
>>
>>
>> Hello,
>>
>> I've *at last* had some time to experiment with the idea I had thrown 
>> years again, of a system to workaround the recurring breakages introduced 
>> by new django releases, breakages which sometimes lead to unreconcilable 
>> requirements between django apps.
>>
>> After a sprint at PyconFR, with a colleague (R. Gomès), and some cleanups 
>> and improvements, here it is:
>>
>> https://github.com/pakal/django-compat-patcher  (also known as DCP)
>> https://pypi.python.org/pypi/django-compat-patcher
>>
>> The philosophy of the module is that, with extremly agile languages such 
>> as python, one doesn't have to choose between a fast-moving project, and a 
>> compatibility-friendly project.
>> So, in an approach reminding "aspect oriented programming", DCP separates 
>> the Django codebase, which may move forward and be left mostly free of 
>> compatibility shims, from retrocompatibility shims ; and changing the 
>> "level of compatibility" of a project is just the matter of tweaking some 
>> Django settings.
>> Since, as usual, "explicit is better than implicit", logging and code 
>> warnings are used to ensure that project users are informed about what 
>> compatibility fixers are applied, and how project dependencies are rated 
>> deprecation-wise.
>>
>> I've noticed there had been debates and evolutions for the past years, 
>> until the switch to a "lax semantic versioning" for Django. 
>> Surely it's an effort in the right direction, but I guess I'm not the 
>> only one worried by the "lax" adjective ; especially after the long history 
>> of breakages occurring for quite cosmetic reasons (eg. the removal of 
>> urlpatterns(), which broke most django apps available, whereas dotted-path 
>> URLs were rather harmless).
>> That's why I think DCP is still relevant, as it gives back some control 
>> over compatibility to end users of Django ; and it should remove part of 
>> the apprehension some may have known too, when installing a new Django 
>> version.
>>
>> DCP has been successfully used to upgrade wide projects from django 1.7 
>> to django 1.10, with no hassle. But more feedback would be nice, before it 
>> can be marked "production ready".
>> The project welcomes patches, especially new backward/forward 
>> compatibility fixers one might need.
>>
>>
>> *Apart from that *: I think many people could benefit from more 
>> instructions about how to handle (backwards and forwards) compatibility, so 
>> here are some ideas I had :
>>
>>
>> *1) Advertising compatibility systems for Django, in the official docs.*
>>
>> That is to say, packages like "django-compat" (which I only discovered 
>> lately), dedicated to library developers who need a wide compatibility.
>> And packages like "django-compat-patcher" for project maintainers who 
>> have compatibility issues and deadlines (it's not *always* the right moment 
>> to fork and patch a bunch of big dependencies).
>> All that would come in addition to the docs now mentioning "how to 
>> support 2 LTS versions at a time".
>> These measures might diminish the number of django app using handmade 
>> compatibility shims, or completely ignoring previous versions of django.
>>
>>
>> *2) Pushing a compatibility system like DCP into Django itself*
>>
>> What would be the gain ? It would pleasantly reduce the work needed for 
>> Django evolutions.
>>
>> At the moment, first compatibility shims must be introduced, and 
>> specifically tested in code ; then these compatibility shims must be 
>> removed, and their tests with them.
>>
>> With a separate compatibility system, only half the work would be needed 
>> : once the code has been modified, the old version is moved to a fixer, and 
>> its associated unit-test is moved to the compatibility system test suite. 
>> The activation/deactivation of this particular fixer is then only a 
>> matter of django settings, not of new code commits.
>> Most importantly, this way, django main tests suites  would stop making 
>> asserts on the presence or absence of deprecation warnings (which is a way 
>> of mixing unrelated aspects of the framework). Django tests suites could 
>> thus be leveraged by compatibility systems to ensure that the whole system 
>> is well sane and backwards/forward compatible, whatever the series of 
>> django shims applied.
>>
>>
>> *Any remarks about DCP concept itself, or about suggestions for doc/core 
>> inclusions ?*
>>
>> thanks,
>> regards,
>> Pascal
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c2c92c01-8059-4b26-9bf8-b5c01a761f3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to