Codemods and Other Upgrade Automation
Much of the work of major software upgrades can now be automated via “codemods” - software that modifies other software’s source code (source code modification). Here is a collection of such codemods that either have saved us time in previous upgrades or seem likely to do so in future ones. For more context on many of these, see Herding Ponies: Coordinating and Automating Django Upgrades Across 100+ Repositories .
Applying Codemods Across Multiple Repositories
Continuous Integration
repo-tools/edx_repo_tools/codemods/django3 at master · openedx/repo-tools - Examples for auto-updating GitHub Actions workflows, tox.ini, and .travis.yml
Django
GitHub - adamchainz/django-upgrade: Automatically upgrade your Django projects.
GitHub - browniebroke/django-codemod: A tool to automatically fix Django deprecations.
repo-tools/edx_repo_tools/codemods at master · openedx/repo-tools
New options may appear in Django Packages : Auto-Upgrade
Python
Codemod Frameworks - Python
Fixit 2: Meta’s next-generation auto-fixing linter (built on LibCST)
GitHub - facebookincubator/Bowler: Safe code refactoring for modern Python. - deprecated/inactive
GitHub - google/pasta: Library to refactor python code through AST manipulation. - inactive
GitHub - PyCQA/redbaron: Bottom-up approach to refactoring in python - inactive
Deprecation Warnings Classification - Python
https://github.com/edx/edx-platform/blob/master/openedx/core/process_warnings.py
GitHub - openedx/pytest-warnings-report: Create an aggregate report of the warnings seen during test runs. (incomplete refactoring of the edx-platform code above to make it usable in other repos)