Skip to content

Commit

Permalink
Merge pull request #417 from farhan/farhan/remove-xblockutils
Browse files Browse the repository at this point in the history
Migrate from xblock-utils package to xblock.utils
  • Loading branch information
Feanil Patel authored Nov 6, 2023
2 parents c5d9a5f + 402a2a8 commit 4b13d3e
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 110 deletions.
2 changes: 1 addition & 1 deletion lti_consumer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .apps import LTIConsumerApp
from .lti_xblock import LtiConsumerXBlock

__version__ = '9.7.0'
__version__ = '9.8.0'
7 changes: 5 additions & 2 deletions lti_consumer/lti_1p1/contrib/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"""

# See comment in docstring for explanation of the usage of ResourceLoader
from xblockutils.resources import ResourceLoader
try:
from xblock.utils.resources import ResourceLoader
except ModuleNotFoundError: # For backward compatibility with releases older than Quince.
from xblockutils.resources import ResourceLoader

from lti_consumer.track import track_event

Expand Down Expand Up @@ -44,7 +47,7 @@ def lti_embed(
generate any response to encapsulate this content. The caller of this method
must render the HTML on their own.
Note: This method uses xblockutils.resources.ResourceLoader to load the HTML
Note: This method uses xblock.utils.resources.ResourceLoader to load the HTML
template used. The rationale for this is that ResourceLoader is agnostic
to XBlock code and functionality. It is recommended that this remain in use
until LTI1.3 support is merged, or a better means of loading the template is
Expand Down
8 changes: 6 additions & 2 deletions lti_consumer/lti_xblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@
from xblock.core import List, Scope, String, XBlock
from xblock.fields import Boolean, Float, Integer
from xblock.validation import ValidationMessage
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 .data import Lti1p3LaunchData
from .exceptions import LtiError
Expand Down
5 changes: 4 additions & 1 deletion lti_consumer/outcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
from urllib.parse import unquote

from lxml import etree
from xblockutils.resources import ResourceLoader
try:
from xblock.utils.resources import ResourceLoader
except ModuleNotFoundError: # For backward compatibility with releases older than Quince.
from xblockutils.resources import ResourceLoader

from .exceptions import LtiError
from .lti_1p1.oauth import verify_oauth_body_signature
Expand Down
1 change: 0 additions & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ oauthlib
mako
lazy
XBlock
xblock-utils
pycryptodomex
pyjwkest
edx-opaque-keys[django]
Expand Down
33 changes: 10 additions & 23 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ attrs==23.1.0
# via -r requirements/base.in
bleach==6.1.0
# via -r requirements/base.in
boto3==1.28.74
boto3==1.28.78
# via fs-s3fs
botocore==1.31.74
botocore==1.31.78
# via
# boto3
# s3transfer
certifi==2023.7.22
# via requests
cffi==1.16.0
# via pynacl
charset-normalizer==3.3.1
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via edx-django-utils
django==3.2.22
django==3.2.23
# via
# -c requirements/common_constraints.txt
# -r requirements/base.in
Expand Down Expand Up @@ -57,7 +57,7 @@ djangorestframework==3.14.0
# via django-config-models
edx-ccx-keys==1.2.1
# via -r requirements/base.in
edx-django-utils==5.7.0
edx-django-utils==5.8.0
# via django-config-models
edx-opaque-keys[django]==2.5.1
# via
Expand All @@ -81,9 +81,7 @@ jmespath==1.0.1
jsonfield==3.1.0
# via -r requirements/base.in
lazy==1.6
# via
# -r requirements/base.in
# xblock
# via -r requirements/base.in
lxml==4.9.3
# via
# -r requirements/base.in
Expand All @@ -92,7 +90,6 @@ mako==1.2.4
# via
# -r requirements/base.in
# xblock
# xblock-utils
markupsafe==2.1.3
# via
# mako
Expand All @@ -102,9 +99,7 @@ newrelic==9.1.1
oauthlib==3.2.2
# via -r requirements/base.in
openedx-django-pyfs==3.4.0
# via
# -r requirements/base.in
# xblock
# via -r requirements/base.in
openedx-filters==1.6.0
# via -r requirements/base.in
pbr==5.11.1
Expand Down Expand Up @@ -139,9 +134,7 @@ requests==2.31.0
s3transfer==0.7.0
# via boto3
simplejson==3.19.2
# via
# xblock
# xblock-utils
# via xblock
six==1.16.0
# via
# bleach
Expand All @@ -166,18 +159,12 @@ urllib3==1.26.18
# botocore
# requests
web-fragments==2.1.0
# via
# xblock
# xblock-utils
# via xblock
webencodings==0.5.1
# via bleach
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:
Expand Down
29 changes: 9 additions & 20 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ binaryornot==0.4.4
# cookiecutter
bleach==6.1.0
# via -r requirements/test.txt
boto3==1.28.74
boto3==1.28.78
# via
# -r requirements/test.txt
# fs-s3fs
botocore==1.31.74
botocore==1.31.78
# via
# -r requirements/test.txt
# boto3
Expand All @@ -51,7 +51,7 @@ chardet==5.2.0
# via
# -r requirements/test.txt
# binaryornot
charset-normalizer==3.3.1
charset-normalizer==3.3.2
# via
# -r requirements/test.txt
# requests
Expand Down Expand Up @@ -95,7 +95,7 @@ distlib==0.3.7
# via
# -r requirements/tox.txt
# virtualenv
django==3.2.22
django==3.2.23
# via
# -c requirements/common_constraints.txt
# -r requirements/test.txt
Expand Down Expand Up @@ -143,7 +143,7 @@ docutils==0.20.1
# readme-renderer
edx-ccx-keys==1.2.1
# via -r requirements/test.txt
edx-django-utils==5.7.0
edx-django-utils==5.8.0
# via
# -r requirements/test.txt
# django-config-models
Expand Down Expand Up @@ -217,9 +217,7 @@ keyring==24.2.0
# -r requirements/test.txt
# twine
lazy==1.6
# via
# -r requirements/test.txt
# xblock
# via -r requirements/test.txt
lxml==4.9.3
# via
# -r requirements/test.txt
Expand All @@ -229,7 +227,6 @@ mako==1.2.4
# via
# -r requirements/test.txt
# xblock
# xblock-utils
markdown-it-py==3.0.0
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -265,9 +262,7 @@ nh3==0.2.14
oauthlib==3.2.2
# via -r requirements/test.txt
openedx-django-pyfs==3.4.0
# via
# -r requirements/test.txt
# xblock
# via -r requirements/test.txt
openedx-filters==1.6.0
# via -r requirements/test.txt
packaging==23.2
Expand Down Expand Up @@ -411,7 +406,6 @@ simplejson==3.19.2
# -r requirements/test.txt
# xblock
# xblock-sdk
# xblock-utils
six==1.16.0
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -444,7 +438,7 @@ tomli==2.0.1
# -r requirements/tox.txt
# pylint
# tox
tomlkit==0.12.1
tomlkit==0.12.2
# via
# -r requirements/test.txt
# pylint
Expand Down Expand Up @@ -482,7 +476,6 @@ web-fragments==2.1.0
# -r requirements/test.txt
# xblock
# xblock-sdk
# xblock-utils
webencodings==0.5.1
# via
# -r requirements/test.txt
Expand All @@ -492,16 +485,12 @@ webob==1.8.7
# -r requirements/test.txt
# xblock
# xblock-sdk
xblock[django]==1.8.1
xblock==1.8.1
# via
# -r requirements/test.txt
# xblock
# xblock-sdk
# xblock-utils
xblock-sdk==0.7.0
# via -r requirements/test.txt
xblock-utils==4.0.0
# via -r requirements/test.txt
zipp==3.17.0
# via
# -r requirements/test.txt
Expand Down
28 changes: 8 additions & 20 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ attrs==23.1.0
# via -r requirements/base.txt
bleach==6.1.0
# via -r requirements/base.txt
boto3==1.28.74
boto3==1.28.78
# via
# -r requirements/base.txt
# fs-s3fs
botocore==1.31.74
botocore==1.31.78
# via
# -r requirements/base.txt
# boto3
Expand All @@ -33,15 +33,15 @@ cffi==1.16.0
# via
# -r requirements/base.txt
# pynacl
charset-normalizer==3.3.1
charset-normalizer==3.3.2
# via
# -r requirements/base.txt
# requests
click==8.1.7
# via
# -r requirements/base.txt
# edx-django-utils
django==3.2.22
django==3.2.23
# via
# -r requirements/base.txt
# django-appconf
Expand Down Expand Up @@ -80,7 +80,7 @@ djangorestframework==3.14.0
# django-config-models
edx-ccx-keys==1.2.1
# via -r requirements/base.txt
edx-django-utils==5.7.0
edx-django-utils==5.8.0
# via
# -r requirements/base.txt
# django-config-models
Expand Down Expand Up @@ -117,9 +117,7 @@ jmespath==1.0.1
jsonfield==3.1.0
# via -r requirements/base.txt
lazy==1.6
# via
# -r requirements/base.txt
# xblock
# via -r requirements/base.txt
lxml==4.9.3
# via
# -r requirements/base.txt
Expand All @@ -129,7 +127,6 @@ mako==1.2.4
# via
# -r requirements/base.txt
# xblock
# xblock-utils
markupsafe==2.1.3
# via
# -r requirements/base.txt
Expand All @@ -142,9 +139,7 @@ newrelic==9.1.1
oauthlib==3.2.2
# via -r requirements/base.txt
openedx-django-pyfs==3.4.0
# via
# -r requirements/base.txt
# xblock
# via -r requirements/base.txt
openedx-filters==1.6.0
# via -r requirements/base.txt
path==16.7.1
Expand Down Expand Up @@ -205,7 +200,6 @@ simplejson==3.19.2
# via
# -r requirements/base.txt
# xblock
# xblock-utils
six==1.16.0
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -238,7 +232,6 @@ web-fragments==2.1.0
# via
# -r requirements/base.txt
# xblock
# xblock-utils
webencodings==0.5.1
# via
# -r requirements/base.txt
Expand All @@ -247,12 +240,7 @@ 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:
Expand Down
2 changes: 1 addition & 1 deletion requirements/django.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
django==3.2.22
django==3.2.23
Loading

0 comments on commit 4b13d3e

Please sign in to comment.