Run python-modernize on lms/djangoapps/courseware/migrations and lms/djangoapps/courseware/views

Description

Run python-modernize on the Python files in * lms/djangoapps/courseware/migrations* and lms/djangoapps/courseware/views in the edx-platform repository, to make them more compatible with Python 3.x without breaking Python 2.7 support:

  • Comment on this ticket to indicate that you are about to start working on it.

  • Launch a development shell in a Docker container via either "make shell" or devstack's "make lms-shell". Alternatively, you can create a new virtualenv or conda environment and install modernize and isort into it (this is a better choice on Windows).

  • python-modernize -w lms/djangoapps/courseware/migrations lms/djangoapps/courseware/views

  • isort -rc lms/djangoapps/courseware/migrations lms/djangoapps/courseware/views

  • Make sure the changes look reasonable and submit them as a pull request; mention this ticket in the description and include INCR-<Ticket Number> in the name.

  • Ask for tests to be triggered if they don't start automatically.

  • Diagnose any test failures caused by the changes, and either fix them or ask for help.

  • If you run into unexpected errors, see this document for common problems: https://openedx.atlassian.net/wiki/spaces/AC/pages/977666218/Using+python-modernize+effectively

Status

Assignee

Unassigned

Reporter

Stuart Young

Labels

None

Priority

Unset
Configure