From 69b638deaad3e3fb374445ab5d118633c9467a0a Mon Sep 17 00:00:00 2001 From: farhan Date: Fri, 20 Oct 2023 16:07:12 +0500 Subject: [PATCH 1/2] 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 From 2823132730171b3eccf568a6293896667f6d631f Mon Sep 17 00:00:00 2001 From: farhan Date: Mon, 30 Oct 2023 18:41:07 +0500 Subject: [PATCH 2/2] chore: Updating python requirements --- requirements/base.txt | 47 +++------------------------ requirements/ci.txt | 2 +- requirements/common_constraints.txt | 5 --- requirements/pip.txt | 2 +- requirements/pip_tools.txt | 2 +- requirements/quality.txt | 49 +---------------------------- requirements/tox.txt | 2 +- 7 files changed, 10 insertions(+), 99 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 191d319..20a0c86 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -10,80 +10,43 @@ appdirs==1.4.4 # via fs asgiref==3.7.2 # via django -boto3==1.28.69 - # via fs-s3fs -botocore==1.31.69 - # via - # boto3 - # s3transfer django==3.2.22 # via # -c requirements/common_constraints.txt # -r requirements/base.in - # openedx-django-pyfs fs==2.4.16 - # via - # fs-s3fs - # openedx-django-pyfs - # xblock -fs-s3fs==1.1.1 - # via openedx-django-pyfs -jmespath==1.0.1 - # via - # boto3 - # botocore -lazy==1.6 # via xblock lxml==4.9.3 # via xblock mako==1.2.4 - # via - # xblock - # xblock-utils + # via xblock markupsafe==2.1.3 # via # mako # xblock -openedx-django-pyfs==3.4.0 - # via xblock python-dateutil==2.8.2 - # via - # botocore - # xblock + # via xblock pytz==2023.3.post1 # via # django # xblock pyyaml==6.0.1 # via xblock -s3transfer==0.7.0 - # via boto3 simplejson==3.19.2 - # via - # xblock - # xblock-utils + # via xblock six==1.16.0 # via # fs - # fs-s3fs # python-dateutil sqlparse==0.4.4 # via django typing-extensions==4.8.0 # via asgiref -urllib3==1.26.18 - # via botocore web-fragments==2.1.0 - # via - # xblock - # xblock-utils + # via xblock webob==1.8.7 # via xblock -xblock[django]==1.8.1 - # via - # -r requirements/base.in - # xblock-utils -xblock-utils==4.0.0 +xblock==1.8.1 # via -r requirements/base.in # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/ci.txt b/requirements/ci.txt index b0d542e..4a0bc87 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -8,7 +8,7 @@ distlib==0.3.7 # via # -r requirements/tox.txt # virtualenv -filelock==3.12.4 +filelock==3.13.0 # via # -r requirements/tox.txt # tox diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index 7e39123..afe6aa8 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -25,8 +25,3 @@ django-simple-history==3.0.0 # tox>4.0.0 isn't yet compatible with many tox plugins, causing CI failures in almost all repos. # Details can be found in this discussion: https://github.com/tox-dev/tox/discussions/1810 tox<4.0.0 - -# edx-sphinx-theme is not compatible with latest Sphinx==6.0.0 version -# Pinning Sphinx version unless the compatibility issue gets resolved -# For details, see issue https://github.com/openedx/edx-sphinx-theme/issues/197 -sphinx<6.0.0 diff --git a/requirements/pip.txt b/requirements/pip.txt index 0c788d6..9014f2c 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -4,7 +4,7 @@ # # make upgrade # -wheel==0.41.2 +wheel==0.41.3 # via -r requirements/pip.in # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/pip_tools.txt b/requirements/pip_tools.txt index fed3370..449e80a 100644 --- a/requirements/pip_tools.txt +++ b/requirements/pip_tools.txt @@ -21,7 +21,7 @@ tomli==2.0.1 # build # pip-tools # pyproject-hooks -wheel==0.41.2 +wheel==0.41.3 # via pip-tools zipp==3.17.0 # via importlib-metadata diff --git a/requirements/quality.txt b/requirements/quality.txt index 019b596..d1ed0e8 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -16,15 +16,6 @@ asgiref==3.7.2 # django astroid==3.0.1 # via pylint -boto3==1.28.69 - # via - # -r requirements/base.txt - # fs-s3fs -botocore==1.31.69 - # via - # -r requirements/base.txt - # boto3 - # s3transfer coverage==7.3.2 # via -r requirements/test.txt dill==0.3.7 @@ -33,30 +24,14 @@ django==3.2.22 # via # -c requirements/common_constraints.txt # -r requirements/base.txt - # openedx-django-pyfs edx-opaque-keys==2.5.1 # via -r requirements/test.txt fs==2.4.16 # via # -r requirements/base.txt - # fs-s3fs - # openedx-django-pyfs # xblock -fs-s3fs==1.1.1 - # via - # -r requirements/base.txt - # openedx-django-pyfs isort==5.12.0 # via pylint -jmespath==1.0.1 - # via - # -r requirements/base.txt - # boto3 - # botocore -lazy==1.6 - # via - # -r requirements/base.txt - # xblock lxml==4.9.3 # via # -r requirements/base.txt @@ -65,7 +40,6 @@ mako==1.2.4 # via # -r requirements/base.txt # xblock - # xblock-utils markupsafe==2.1.3 # via # -r requirements/base.txt @@ -73,10 +47,6 @@ markupsafe==2.1.3 # xblock mccabe==0.7.0 # via pylint -openedx-django-pyfs==3.4.0 - # via - # -r requirements/base.txt - # xblock pbr==5.11.1 # via # -r requirements/test.txt @@ -94,7 +64,6 @@ pymongo==3.13.0 python-dateutil==2.8.2 # via # -r requirements/base.txt - # botocore # xblock pytz==2023.3.post1 # via @@ -105,20 +74,14 @@ pyyaml==6.0.1 # via # -r requirements/base.txt # xblock -s3transfer==0.7.0 - # via - # -r requirements/base.txt - # boto3 simplejson==3.19.2 # via # -r requirements/base.txt # xblock - # xblock-utils six==1.16.0 # via # -r requirements/base.txt # fs - # fs-s3fs # python-dateutil sqlparse==0.4.4 # via @@ -140,25 +103,15 @@ typing-extensions==4.8.0 # astroid # edx-opaque-keys # pylint -urllib3==1.26.18 - # via - # -r requirements/base.txt - # botocore web-fragments==2.1.0 # via # -r requirements/base.txt # xblock - # xblock-utils webob==1.8.7 # via # -r requirements/base.txt # xblock -xblock[django]==1.8.1 - # via - # -r requirements/base.txt - # xblock - # xblock-utils -xblock-utils==4.0.0 +xblock==1.8.1 # via -r requirements/base.txt # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/tox.txt b/requirements/tox.txt index d9a3fb1..3b45a16 100644 --- a/requirements/tox.txt +++ b/requirements/tox.txt @@ -6,7 +6,7 @@ # distlib==0.3.7 # via virtualenv -filelock==3.12.4 +filelock==3.13.0 # via # tox # virtualenv