From 69b638deaad3e3fb374445ab5d118633c9467a0a Mon Sep 17 00:00:00 2001 From: farhan Date: Fri, 20 Oct 2023 16:07:12 +0500 Subject: [PATCH] refactor: migrate from xblock-utils package to xblock.utils --- build/lib/sql_grader/xblocks.py | 8 ++++++-- requirements/base.in | 1 - setup.py | 2 +- sql_grader/xblocks.py | 9 +++++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build/lib/sql_grader/xblocks.py b/build/lib/sql_grader/xblocks.py index b08d18e..d3f6208 100644 --- a/build/lib/sql_grader/xblocks.py +++ b/build/lib/sql_grader/xblocks.py @@ -2,8 +2,12 @@ A custom submission type to evaluate SQL queries """ from xblock.core import XBlock -from xblockutils.resources import ResourceLoader -from xblockutils.studio_editable import StudioEditableXBlockMixin +try: + from xblock.utils.resources import ResourceLoader + from xblock.utils.studio_editable import StudioEditableXBlockMixin +except ModuleNotFoundError: # For backward compatibility with releases older than Quince. + from xblockutils.resources import ResourceLoader + from xblockutils.studio_editable import StudioEditableXBlockMixin from .mixins.dates import EnforceDueDates from .mixins.fragment import XBlockFragmentBuilderMixin diff --git a/requirements/base.in b/requirements/base.in index c0c3f34..567cc15 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -3,6 +3,5 @@ Django XBlock -xblock-utils # TODO: Change this once codejail is published to pypi -e git+https://github.com/openedx/codejail.git@3.0.0#egg=codejail diff --git a/setup.py b/setup.py index 677fbf0..92931d9 100644 --- a/setup.py +++ b/setup.py @@ -124,7 +124,7 @@ def is_requirement(line): setup( name='xblock-sql-grader', - version='0.4.0', + version='0.5.0', description='SQL Grader XBlock', # TODO: write a better description. license='AGPLv3', long_description=README, diff --git a/sql_grader/xblocks.py b/sql_grader/xblocks.py index b08d18e..2814b18 100644 --- a/sql_grader/xblocks.py +++ b/sql_grader/xblocks.py @@ -2,8 +2,13 @@ A custom submission type to evaluate SQL queries """ from xblock.core import XBlock -from xblockutils.resources import ResourceLoader -from xblockutils.studio_editable import StudioEditableXBlockMixin +try: + from xblock.utils.resources import ResourceLoader + from xblock.utils.studio_editable import StudioEditableXBlockMixin +except ModuleNotFoundError: + # For backward compatibility with releases older than Quince. + from xblockutils.resources import ResourceLoader + from xblockutils.studio_editable import StudioEditableXBlockMixin from .mixins.dates import EnforceDueDates from .mixins.fragment import XBlockFragmentBuilderMixin