Delay import of xmodule packages until after sys.path fixup
This commit is contained in:
@@ -23,7 +23,6 @@ from xblock.exceptions import NoSuchHandlerError
|
||||
from xblock.fields import Scope
|
||||
from xblock.plugin import PluginMissingError
|
||||
from xblock.runtime import Mixologist
|
||||
from xmodule.x_module import prefer_xmodules
|
||||
|
||||
from lms.lib.xblock.runtime import unquote_slashes
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ os.environ['SERVICE_VARIANT'] = 'bok_choy'
|
||||
os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() #pylint: disable=E1120
|
||||
|
||||
from .aws import * # pylint: disable=W0401, W0614
|
||||
from xmodule.x_module import prefer_xmodules
|
||||
|
||||
|
||||
######################### Testing overrides ####################################
|
||||
|
||||
@@ -49,8 +47,5 @@ for log_name, log_level in LOG_OVERRIDES:
|
||||
# Use the auto_auth workflow for creating users and logging them in
|
||||
FEATURES['AUTOMATIC_AUTH_FOR_TESTING'] = True
|
||||
|
||||
# Enable XBlocks
|
||||
XBLOCK_SELECT_FUNCTION = prefer_xmodules
|
||||
|
||||
# Unfortunately, we need to use debug mode to serve staticfiles
|
||||
DEBUG = True
|
||||
|
||||
@@ -34,9 +34,6 @@ from path import path
|
||||
|
||||
from lms.lib.xblock.mixin import LmsBlockMixin
|
||||
from cms.lib.xblock.mixin import CmsBlockMixin
|
||||
from xmodule.modulestore.inheritance import InheritanceMixin
|
||||
from xmodule.modulestore import prefer_xmodules
|
||||
from xmodule.x_module import XModuleMixin
|
||||
from dealer.git import git
|
||||
|
||||
############################ FEATURE CONFIGURATION #############################
|
||||
@@ -220,6 +217,10 @@ X_FRAME_OPTIONS = 'ALLOW'
|
||||
|
||||
############# XBlock Configuration ##########
|
||||
|
||||
# Import after sys.path fixup
|
||||
from xmodule.modulestore.inheritance import InheritanceMixin
|
||||
from xmodule.x_module import XModuleMixin, prefer_xmodules
|
||||
|
||||
# This should be moved into an XBlock Runtime/Application object
|
||||
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
|
||||
XBLOCK_MIXINS = (LmsBlockMixin, CmsBlockMixin, InheritanceMixin, XModuleMixin)
|
||||
|
||||
@@ -157,11 +157,6 @@ INSTALLED_APPS += ('external_auth', )
|
||||
filterwarnings('ignore', message='No request passed to the backend, unable to rate-limit')
|
||||
|
||||
|
||||
################################# XBLOCK ######################################
|
||||
from xmodule.x_module import prefer_xmodules
|
||||
XBLOCK_SELECT_FUNCTION = prefer_xmodules
|
||||
|
||||
|
||||
################################# CELERY ######################################
|
||||
|
||||
CELERY_ALWAYS_EAGER = True
|
||||
|
||||
@@ -56,7 +56,6 @@ import copy
|
||||
from pytz import UTC
|
||||
|
||||
from xmodule.errortracker import null_error_tracker
|
||||
from xmodule.x_module import prefer_xmodules
|
||||
from xmodule.modulestore.locator import (
|
||||
BlockUsageLocator, DefinitionLocator, CourseLocator, VersionTree, LocalId, Locator
|
||||
)
|
||||
|
||||
@@ -4,8 +4,6 @@ Settings for bok choy tests
|
||||
|
||||
import os
|
||||
from path import path
|
||||
from xmodule.x_module import prefer_xmodules
|
||||
|
||||
|
||||
CONFIG_ROOT = path(__file__).abspath().dirname() #pylint: disable=E1120
|
||||
TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root"
|
||||
@@ -60,8 +58,5 @@ LOG_OVERRIDES = [
|
||||
for log_name, log_level in LOG_OVERRIDES:
|
||||
logging.getLogger(log_name).setLevel(log_level)
|
||||
|
||||
# Enable XBlocks
|
||||
XBLOCK_SELECT_FUNCTION = prefer_xmodules
|
||||
|
||||
# Unfortunately, we need to use debug mode to serve staticfiles
|
||||
DEBUG = True
|
||||
|
||||
@@ -34,9 +34,6 @@ from path import path
|
||||
from .discussionsettings import *
|
||||
|
||||
from lms.lib.xblock.mixin import LmsBlockMixin
|
||||
from xmodule.modulestore.inheritance import InheritanceMixin
|
||||
from xmodule.modulestore import prefer_xmodules
|
||||
from xmodule.x_module import XModuleMixin
|
||||
|
||||
################################### FEATURES ###################################
|
||||
# The display name of the platform to be used in templates/emails/etc.
|
||||
@@ -433,6 +430,10 @@ DOC_STORE_CONFIG = {
|
||||
|
||||
############# XBlock Configuration ##########
|
||||
|
||||
# Import after sys.path fixup
|
||||
from xmodule.modulestore.inheritance import InheritanceMixin
|
||||
from xmodule.x_module import XModuleMixin, prefer_xmodules
|
||||
|
||||
# This should be moved into an XBlock Runtime/Application object
|
||||
# once the responsibility of XBlock creation is moved out of modulestore - cpennington
|
||||
XBLOCK_MIXINS = (LmsBlockMixin, InheritanceMixin, XModuleMixin)
|
||||
|
||||
Reference in New Issue
Block a user