diff --git a/common/djangoapps/third_party_auth/migrations/0009_auto_20170415_1144.py b/common/djangoapps/third_party_auth/migrations/0009_auto_20170415_1144.py index fa969ae5fb..7b06f2dfd7 100644 --- a/common/djangoapps/third_party_auth/migrations/0009_auto_20170415_1144.py +++ b/common/djangoapps/third_party_auth/migrations/0009_auto_20170415_1144.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals from django.db import migrations, models diff --git a/common/djangoapps/third_party_auth/migrations/0012_auto_20170626_1135.py b/common/djangoapps/third_party_auth/migrations/0012_auto_20170626_1135.py index 66ddd11e71..ac34eac9f5 100644 --- a/common/djangoapps/third_party_auth/migrations/0012_auto_20170626_1135.py +++ b/common/djangoapps/third_party_auth/migrations/0012_auto_20170626_1135.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals from django.db import migrations, models diff --git a/common/djangoapps/third_party_auth/migrations/0014_auto_20171222_1233.py b/common/djangoapps/third_party_auth/migrations/0014_auto_20171222_1233.py index f06a72d104..e5c144f25b 100644 --- a/common/djangoapps/third_party_auth/migrations/0014_auto_20171222_1233.py +++ b/common/djangoapps/third_party_auth/migrations/0014_auto_20171222_1233.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals from django.db import migrations, models diff --git a/common/djangoapps/third_party_auth/migrations/0017_remove_icon_class_image_secondary_fields.py b/common/djangoapps/third_party_auth/migrations/0017_remove_icon_class_image_secondary_fields.py index 1580a9e9fa..ab698f6be8 100644 --- a/common/djangoapps/third_party_auth/migrations/0017_remove_icon_class_image_secondary_fields.py +++ b/common/djangoapps/third_party_auth/migrations/0017_remove_icon_class_image_secondary_fields.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2018-01-30 17:38 -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals from django.db import migrations diff --git a/common/djangoapps/third_party_auth/migrations/0019_consolidate_slug.py b/common/djangoapps/third_party_auth/migrations/0019_consolidate_slug.py index a61a67bf37..658854dec8 100644 --- a/common/djangoapps/third_party_auth/migrations/0019_consolidate_slug.py +++ b/common/djangoapps/third_party_auth/migrations/0019_consolidate_slug.py @@ -2,7 +2,7 @@ """ Custom migration script to add slug field to all ProviderConfig models. """ -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals from django.db import migrations, models from django.utils.text import slugify diff --git a/pavelib/__init__.py b/pavelib/__init__.py index ee695d5593..a6b26be9ca 100644 --- a/pavelib/__init__.py +++ b/pavelib/__init__.py @@ -1,6 +1,6 @@ """ paver commands """ -from . import ( - assets, servers, docs, prereqs, quality, tests, js_test, i18n, bok_choy, database -) +from __future__ import absolute_import + +from . import assets, bok_choy, database, docs, i18n, js_test, prereqs, quality, servers, tests diff --git a/pavelib/database.py b/pavelib/database.py index 2064a199fa..bfee5cb2d3 100644 --- a/pavelib/database.py +++ b/pavelib/database.py @@ -1,14 +1,19 @@ """ Tasks for controlling the databases used in tests """ -from __future__ import print_function +from __future__ import absolute_import, print_function from paver.easy import cmdopts, needs, task from pavelib.utils.db_utils import ( - remove_files_from_folder, reset_test_db, compute_fingerprint_and_write_to_disk, - fingerprint_bokchoy_db_files, does_fingerprint_on_disk_match, is_fingerprint_in_bucket, - refresh_bokchoy_db_cache_from_s3, upload_db_cache_to_s3 + compute_fingerprint_and_write_to_disk, + does_fingerprint_on_disk_match, + fingerprint_bokchoy_db_files, + is_fingerprint_in_bucket, + refresh_bokchoy_db_cache_from_s3, + remove_files_from_folder, + reset_test_db, + upload_db_cache_to_s3 ) from pavelib.utils.timer import timed diff --git a/pavelib/docs.py b/pavelib/docs.py index a7a55af382..f009b2d59a 100644 --- a/pavelib/docs.py +++ b/pavelib/docs.py @@ -2,7 +2,7 @@ Open edX Documentation Builder Ties into Sphinx to generate files at the specified location(s) """ -from __future__ import print_function +from __future__ import absolute_import, print_function import sys @@ -22,7 +22,7 @@ def valid_doc_types(): """ Return a comma-separated string of valid doc types. """ - return ", ".join(DOC_PATHS.keys()) + return ", ".join(list(DOC_PATHS.keys())) def doc_path(options, allow_default=True): diff --git a/pavelib/i18n.py b/pavelib/i18n.py index 951d65735e..4f22f705e0 100644 --- a/pavelib/i18n.py +++ b/pavelib/i18n.py @@ -1,7 +1,7 @@ """ Internationalization tasks """ -from __future__ import print_function +from __future__ import absolute_import, print_function import re import subprocess @@ -9,6 +9,7 @@ import sys from path import Path as path from paver.easy import cmdopts, needs, sh, task +from six.moves import input from .utils.cmd import django_cmd from .utils.envs import Env @@ -220,7 +221,7 @@ def i18n_robot_pull(): print("\n\nValidating translations with `i18n_tool validate`...") sh("i18n_tool validate") - con = raw_input("Continue with committing these translations (y/n)? ") + con = input("Continue with committing these translations (y/n)? ") if con.lower() == 'y': sh('git add conf/locale') diff --git a/pavelib/quality.py b/pavelib/quality.py index cff66b57ca..148a2f3c5c 100644 --- a/pavelib/quality.py +++ b/pavelib/quality.py @@ -4,7 +4,8 @@ """ Check code quality using pycodestyle, pylint, and diff_quality. """ -from __future__ import print_function +from __future__ import absolute_import, print_function + import io import json import os @@ -535,7 +536,7 @@ def run_xsslint(options): error_message = "" # Test total violations against threshold. - if 'total' in violation_thresholds.keys(): + if 'total' in list(violation_thresholds.keys()): if violation_thresholds['total'] < xsslint_counts['total']: error_message = u"Too many violations total ({count}).\nThe limit is {violations_limit}.".format( count=xsslint_counts['total'], violations_limit=violation_thresholds['total']