Merging a third party package into django core

The hidden power of Django is the number of third-party packages available for free and many of them are must have's to any project to fill in functionality not in core or to extra functionality that would not be appropriate to be in core. Additionally when it comes to feature requests for core, the response is typically one of getting consenus on the forum and producing a third-party package to gauge interest in the feature.

Today, I have some (hopefully) constructive thoughts & questions around the second half of that response. The main question goes something like this: How do we design a package that merging it would be (relatively) easy?

Two very popular packages come to my mind in regard to this question, Django Rest Framework and Django allauth. Both provide excellent code and functionality that add to or extend Django's core offering and both have functionality that many have likely suggested to exist in core (DRF definitely, allauth possibly) especially to consider the batteries-included approach of Django.

However neither would ever get merged in core as is. There is too much for a single ticket/PR to even contemplate, so obviously if we wanted to merge in one of these packages they would need to be broken down into phases. For example DRF could go broadly something like: Content Negotiation, Serializers, Views(sets) & routers (thanks Carlton!).

So what is DRF had been designed & built as a series of smaller packages that incrementally got merged in over time? Then a virtual package which brought them all together? I realised this is easy to say in hindsight although allauth has recently split it's social stuff into a separate virtual package.

I don't have any answers, just questions! How could we setup packages so they could easily be merged? Is it the size and scope of a package? Is is the quality of code or the python API design?

One final note on this. I am not remotely suggesting that this be applicable to all packages, but I would love to see a set of guidelines that help those in the position of a feature request.

What do you think?