From 381be6bed6a81eeccf885763bdc8aee5e8155899 Mon Sep 17 00:00:00 2001 From: sairina Date: Wed, 10 Nov 2021 15:42:16 -0800 Subject: [PATCH 1/2] Update pre-commit lang version to python3.6, updates import order for some files --- .pre-commit-config.yaml | 2 +- kolibri/core/content/management/commands/importcontent.py | 2 +- kolibri/core/tasks/compat.py | 1 - kolibri/core/tasks/worker.py | 1 - kolibri/utils/debian_check.py | 3 +-- packages/kolibri-tools/lib/i18n/utils.py | 3 +-- 6 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8d8a5326053..34b769d4b75 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: rev: v1.3.3 hooks: - id: reorder-python-imports - language_version: python2.7 + language_version: python3.6 - repo: local hooks: - id: lint-frontend diff --git a/kolibri/core/content/management/commands/importcontent.py b/kolibri/core/content/management/commands/importcontent.py index b57209bd2fb..4420256c15b 100644 --- a/kolibri/core/content/management/commands/importcontent.py +++ b/kolibri/core/content/management/commands/importcontent.py @@ -1,7 +1,7 @@ +import concurrent.futures import logging import os -import concurrent.futures import requests from django.core.management.base import CommandError from le_utils.constants import content_kinds diff --git a/kolibri/core/tasks/compat.py b/kolibri/core/tasks/compat.py index 47fa0f5dce9..23c652dfdbb 100644 --- a/kolibri/core/tasks/compat.py +++ b/kolibri/core/tasks/compat.py @@ -1,6 +1,5 @@ import multiprocessing import threading - from concurrent import futures from kolibri.utils.conf import OPTIONS diff --git a/kolibri/core/tasks/worker.py b/kolibri/core/tasks/worker.py index 2d78cf2a4c1..d2f848abdeb 100644 --- a/kolibri/core/tasks/worker.py +++ b/kolibri/core/tasks/worker.py @@ -1,6 +1,5 @@ import logging import traceback - from concurrent.futures import CancelledError from kolibri.core.tasks.compat import PoolExecutor diff --git a/kolibri/utils/debian_check.py b/kolibri/utils/debian_check.py index 5ae58a4ef67..e3622b8fb76 100644 --- a/kolibri/utils/debian_check.py +++ b/kolibri/utils/debian_check.py @@ -1,9 +1,8 @@ import getpass import os import sys -from shutil import rmtree - from builtins import input +from shutil import rmtree from .conf import KOLIBRI_HOME from .server import installation_type diff --git a/packages/kolibri-tools/lib/i18n/utils.py b/packages/kolibri-tools/lib/i18n/utils.py index 801f65f6844..07e6f8a5b0f 100644 --- a/packages/kolibri-tools/lib/i18n/utils.py +++ b/packages/kolibri-tools/lib/i18n/utils.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import configparser import functools import io import json @@ -6,8 +7,6 @@ import os import sys -import configparser - logging.basicConfig(format="%(levelname)s: %(message)s", level=logging.INFO) logging.StreamHandler(sys.stdout) From add3dc4f5fce6a5d9cf83a3fab2bca422fa1f121 Mon Sep 17 00:00:00 2001 From: sairina Date: Thu, 11 Nov 2021 15:47:37 -0800 Subject: [PATCH 2/2] Change language version to python3 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 34b769d4b75..ca716644c7c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: rev: v1.3.3 hooks: - id: reorder-python-imports - language_version: python3.6 + language_version: python3 - repo: local hooks: - id: lint-frontend