Replies: 4 comments
-
Hey, yes from what I gathered, the approach are quite different. If I understood correctly, DCP uses Django-Codemod uses Maybe @jayvdb has some ideas, I haven't thought about it much either. |
Beta Was this translation helpful? Give feedback.
-
Ideas documented at pakal/django-compat-patcher#12 Mostly about building a common dataset of Django deprecations/removals, ideally in a format that both libraries can separately implement fixers for. The renames are the obvious candidate for this- fairly simple. libCST may be a useful tool for automatically generating metadata for diffs between Django versions, but renames of interest occur at the module level and typically only need an AST. I couldnt find any mature existing solution, but I suspect that one might be found by using a tool like https://github.com/timothycrosley/pdocs on each version of Django, keep its internal representation before it emits docs, and doing a diff between the internal representations for each version of Django. |
Beta Was this translation helpful? Give feedback.
-
Another idea is to use django-codemod to detect which fixes are needed (and create a patch to send upstream), and use that information to configure DCP to only apply the needed fixes. If django-codemod and DCP have a similar naming convention for their fixes, it becomes trivial to use them in that two-pronged approach of using the released version while pushing to get a new fixed released version. To facilitate that, it would help if django-codemod had support for detection of problems that a fixer hasnt yet been built for. Then it is easier to port all of the DCP fixers to codemod detectors, and then writing the codemod fixers can come later (and some will be quite difficult). |
Beta Was this translation helpful? Give feedback.
-
Two other projects I ran into |
Beta Was this translation helpful? Give feedback.
-
Hello sirs,
as @jayvdb mentioned in #23, Django-Compat-Patcher has some code snippets which might interest you.
The two projects have similar goals, but with different tactics.
If I understand correctly, django-codemod works by statically rewritting the code of django projects/libs to conform to newer Django API ; whereas DCP works at runtime, by forcing the Django framework itself to acknowledge olders ways of doing.
So django-codemod "solves" the technical debt of a specific library, while DCP keeps it, but ensures that third-party django libs included in the project will work fine too, without forking them first.
I haven't thought much about it, but maybe there is some code/trick sharing to do between both projects?
Beta Was this translation helpful? Give feedback.
All reactions