diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 6a15216943f6..379b24b6768a 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -6,6 +6,22 @@ # -e git+https://github.com/anupdhabarde/edx-proctoring-proctortrack.git@31c6c9923a51c903ae83760ecbbac191363aa2a2#egg=edx_proctoring_proctortrack # via -r requirements/edx/github.in +-e git+https://github.com/kdmccormick/XBlock.git@kdmccormick/types2#egg=XBlock[django] + # via + # -r requirements/edx/kernel.in + # acid-xblock + # crowdsourcehinter-xblock + # done-xblock + # edx-completion + # edx-sga + # edx-when + # lti-consumer-xblock + # ora2 + # staff-graded-xblock + # xblock + # xblock-drag-and-drop-v2 + # xblock-google-drive + # xblock-utils acid-xblock==0.3.1 # via -r requirements/edx/kernel.in aiohappyeyeballs==2.3.4 @@ -1256,22 +1272,6 @@ webob==1.8.7 # xblock wrapt==1.16.0 # via -r requirements/edx/paver.txt -xblock[django]==4.0.1 - # via - # -c requirements/edx/../constraints.txt - # -r requirements/edx/kernel.in - # acid-xblock - # crowdsourcehinter-xblock - # done-xblock - # edx-completion - # edx-sga - # edx-when - # lti-consumer-xblock - # ora2 - # staff-graded-xblock - # xblock-drag-and-drop-v2 - # xblock-google-drive - # xblock-utils xblock-drag-and-drop-v2==4.0.3 # via -r requirements/edx/bundled.in xblock-google-drive==0.7.0 diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 8155169e33d3..681b2cc1835b 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -8,6 +8,23 @@ # via # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt +-e git+https://github.com/kdmccormick/XBlock.git@kdmccormick/types2#egg=XBlock[django] + # via + # -r requirements/edx/doc.txt + # -r requirements/edx/testing.txt + # acid-xblock + # crowdsourcehinter-xblock + # done-xblock + # edx-completion + # edx-sga + # edx-when + # lti-consumer-xblock + # ora2 + # staff-graded-xblock + # xblock + # xblock-drag-and-drop-v2 + # xblock-google-drive + # xblock-utils accessible-pygments==0.0.5 # via # -r requirements/edx/doc.txt @@ -2230,23 +2247,6 @@ wrapt==1.16.0 # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt # astroid -xblock[django]==4.0.1 - # via - # -c requirements/edx/../constraints.txt - # -r requirements/edx/doc.txt - # -r requirements/edx/testing.txt - # acid-xblock - # crowdsourcehinter-xblock - # done-xblock - # edx-completion - # edx-sga - # edx-when - # lti-consumer-xblock - # ora2 - # staff-graded-xblock - # xblock-drag-and-drop-v2 - # xblock-google-drive - # xblock-utils xblock-drag-and-drop-v2==4.0.3 # via # -r requirements/edx/doc.txt diff --git a/requirements/edx/doc.txt b/requirements/edx/doc.txt index bb81b7b71ac3..9759e8ad9505 100644 --- a/requirements/edx/doc.txt +++ b/requirements/edx/doc.txt @@ -6,6 +6,22 @@ # -e git+https://github.com/anupdhabarde/edx-proctoring-proctortrack.git@31c6c9923a51c903ae83760ecbbac191363aa2a2#egg=edx_proctoring_proctortrack # via -r requirements/edx/base.txt +-e git+https://github.com/kdmccormick/XBlock.git@kdmccormick/types2#egg=XBlock[django] + # via + # -r requirements/edx/base.txt + # acid-xblock + # crowdsourcehinter-xblock + # done-xblock + # edx-completion + # edx-sga + # edx-when + # lti-consumer-xblock + # ora2 + # staff-graded-xblock + # xblock + # xblock-drag-and-drop-v2 + # xblock-google-drive + # xblock-utils accessible-pygments==0.0.5 # via pydata-sphinx-theme acid-xblock==0.3.1 @@ -1547,22 +1563,6 @@ webob==1.8.7 # xblock wrapt==1.16.0 # via -r requirements/edx/base.txt -xblock[django]==4.0.1 - # via - # -c requirements/edx/../constraints.txt - # -r requirements/edx/base.txt - # acid-xblock - # crowdsourcehinter-xblock - # done-xblock - # edx-completion - # edx-sga - # edx-when - # lti-consumer-xblock - # ora2 - # staff-graded-xblock - # xblock-drag-and-drop-v2 - # xblock-google-drive - # xblock-utils xblock-drag-and-drop-v2==4.0.3 # via -r requirements/edx/base.txt xblock-google-drive==0.7.0 diff --git a/requirements/edx/kernel.in b/requirements/edx/kernel.in index a5b510742ac7..a4fe1e5dd8a1 100644 --- a/requirements/edx/kernel.in +++ b/requirements/edx/kernel.in @@ -158,5 +158,5 @@ unicodecsv # Easier support for CSV files with unicode user-util # Functionality for retiring users (GDPR compliance) webob web-fragments # Provides the ability to render fragments of web pages -XBlock[django] # Courseware component architecture +-e git+https://github.com/kdmccormick/XBlock.git@kdmccormick/types2#egg=XBlock[django] xss-utils # https://github.com/openedx/edx-platform/pull/20633 Fix XSS via Translations diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 18c988dfb622..932581162678 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -6,6 +6,22 @@ # -e git+https://github.com/anupdhabarde/edx-proctoring-proctortrack.git@31c6c9923a51c903ae83760ecbbac191363aa2a2#egg=edx_proctoring_proctortrack # via -r requirements/edx/base.txt +-e git+https://github.com/kdmccormick/XBlock.git@kdmccormick/types2#egg=XBlock[django] + # via + # -r requirements/edx/base.txt + # acid-xblock + # crowdsourcehinter-xblock + # done-xblock + # edx-completion + # edx-sga + # edx-when + # lti-consumer-xblock + # ora2 + # staff-graded-xblock + # xblock + # xblock-drag-and-drop-v2 + # xblock-google-drive + # xblock-utils acid-xblock==0.3.1 # via -r requirements/edx/base.txt aiohappyeyeballs==2.3.4 @@ -1644,22 +1660,6 @@ wrapt==1.16.0 # via # -r requirements/edx/base.txt # astroid -xblock[django]==4.0.1 - # via - # -c requirements/edx/../constraints.txt - # -r requirements/edx/base.txt - # acid-xblock - # crowdsourcehinter-xblock - # done-xblock - # edx-completion - # edx-sga - # edx-when - # lti-consumer-xblock - # ora2 - # staff-graded-xblock - # xblock-drag-and-drop-v2 - # xblock-google-drive - # xblock-utils xblock-drag-and-drop-v2==4.0.3 # via -r requirements/edx/base.txt xblock-google-drive==0.7.0 diff --git a/xmodule/annotatable_block.py b/xmodule/annotatable_block.py index e41e2b17a52f..2394d43418b5 100644 --- a/xmodule/annotatable_block.py +++ b/xmodule/annotatable_block.py @@ -35,6 +35,7 @@ class AnnotatableBlock( XModuleToXBlockMixin, ResourceTemplates, XModuleMixin, + XBlock, ): """ Annotatable XBlock. diff --git a/xmodule/capa_block.py b/xmodule/capa_block.py index 54ca0cbc312f..d18cf1256b94 100644 --- a/xmodule/capa_block.py +++ b/xmodule/capa_block.py @@ -142,6 +142,7 @@ class ProblemBlock( XModuleToXBlockMixin, ResourceTemplates, XModuleMixin, + XBlock, ): """ An XBlock representing a "problem". diff --git a/xmodule/conditional_block.py b/xmodule/conditional_block.py index 78a5b8c1c1c9..d7fe688b22c6 100644 --- a/xmodule/conditional_block.py +++ b/xmodule/conditional_block.py @@ -45,6 +45,7 @@ class ConditionalBlock( ResourceTemplates, XModuleMixin, StudioEditableBlock, + XBlock, ): """ Blocks child blocks from showing unless certain conditions are met. diff --git a/xmodule/error_block.py b/xmodule/error_block.py index a3620be87688..355181b14b7b 100644 --- a/xmodule/error_block.py +++ b/xmodule/error_block.py @@ -48,6 +48,7 @@ class ErrorBlock( XModuleToXBlockMixin, ResourceTemplates, XModuleMixin, + XBlock, ): # pylint: disable=abstract-method """ Block that gets shown to staff when there has been an error while diff --git a/xmodule/hidden_block.py b/xmodule/hidden_block.py index 0d5c288d75c3..8f786d78d497 100644 --- a/xmodule/hidden_block.py +++ b/xmodule/hidden_block.py @@ -18,6 +18,7 @@ class HiddenBlock( XmlMixin, XModuleToXBlockMixin, XModuleMixin, + XBlock, ): """ XBlock class loaded by the runtime when another XBlock type has been disabled diff --git a/xmodule/html_block.py b/xmodule/html_block.py index 2db198360107..46fa7b980d7c 100644 --- a/xmodule/html_block.py +++ b/xmodule/html_block.py @@ -353,7 +353,7 @@ def index_dictionary(self): @edxnotes -class HtmlBlock(HtmlBlockMixin): # lint-amnesty, pylint: disable=abstract-method +class HtmlBlock(HtmlBlockMixin, XBlock): # lint-amnesty, pylint: disable=abstract-method """ This is the actual HTML XBlock. Nothing extra is required; this is just a wrapper to include edxnotes support. @@ -374,7 +374,7 @@ class AboutFields: # lint-amnesty, pylint: disable=missing-class-docstring @XBlock.tag("detached") -class AboutBlock(AboutFields, HtmlBlockMixin): # lint-amnesty, pylint: disable=abstract-method +class AboutBlock(AboutFields, HtmlBlockMixin, XBlock): # lint-amnesty, pylint: disable=abstract-method """ These pieces of course content are treated as HtmlBlocks but we need to overload where the templates are located in order to be able to create new ones @@ -409,7 +409,7 @@ class StaticTabFields: @XBlock.tag("detached") -class StaticTabBlock(StaticTabFields, HtmlBlockMixin): # lint-amnesty, pylint: disable=abstract-method +class StaticTabBlock(StaticTabFields, HtmlBlockMixin, XBlock): # lint-amnesty, pylint: disable=abstract-method """ These pieces of course content are treated as HtmlBlocks but we need to overload where the templates are located in order to be able to create new ones @@ -435,7 +435,7 @@ class CourseInfoFields: @XBlock.tag("detached") @XBlock.needs('replace_urls') -class CourseInfoBlock(CourseInfoFields, HtmlBlockMixin): # lint-amnesty, pylint: disable=abstract-method +class CourseInfoBlock(CourseInfoFields, HtmlBlockMixin, XBlock): # lint-amnesty, pylint: disable=abstract-method """ These pieces of course content are treated as HtmlBlock but we need to overload where the templates are located in order to be able to create new ones diff --git a/xmodule/library_content_block.py b/xmodule/library_content_block.py index 09a5d1dee13e..cf3dac77d488 100644 --- a/xmodule/library_content_block.py +++ b/xmodule/library_content_block.py @@ -85,6 +85,7 @@ class LibraryContentBlock( ResourceTemplates, XModuleMixin, StudioEditableBlock, + XBlock, ): """ An XBlock whose children are chosen dynamically from a content library. diff --git a/xmodule/lti_block.py b/xmodule/lti_block.py index 55f940b381c2..23e8a4f68260 100644 --- a/xmodule/lti_block.py +++ b/xmodule/lti_block.py @@ -284,6 +284,7 @@ class LTIBlock( XModuleToXBlockMixin, ResourceTemplates, XModuleMixin, + XBlock, ): # pylint: disable=abstract-method """ THIS MODULE IS DEPRECATED IN FAVOR OF https://github.com/openedx/xblock-lti-consumer diff --git a/xmodule/modulestore/tests/test_xml_importer.py b/xmodule/modulestore/tests/test_xml_importer.py index 9568686d98fa..d69321f0a5a6 100644 --- a/xmodule/modulestore/tests/test_xml_importer.py +++ b/xmodule/modulestore/tests/test_xml_importer.py @@ -12,6 +12,7 @@ from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator from path import Path as path +from xblock.core import XBlock from xblock.fields import List, Scope, ScopeIds, String from xblock.runtime import DictKeyValueStore, KvsFieldData, Runtime @@ -107,7 +108,7 @@ def render_to_template_mock(*args): pass -class StubXBlock(XModuleMixin, InheritanceMixin): +class StubXBlock(XModuleMixin, InheritanceMixin, XBlock): """ Stub XBlock used for testing. """ diff --git a/xmodule/poll_block.py b/xmodule/poll_block.py index f09889f506e6..eea665d4d52c 100644 --- a/xmodule/poll_block.py +++ b/xmodule/poll_block.py @@ -42,6 +42,7 @@ class PollBlock( XModuleToXBlockMixin, ResourceTemplates, XModuleMixin, + XBlock, ): # pylint: disable=abstract-method """Poll Block""" # Name of poll to use in links to this poll diff --git a/xmodule/randomize_block.py b/xmodule/randomize_block.py index b8a1432ff311..b3e5ba682a18 100644 --- a/xmodule/randomize_block.py +++ b/xmodule/randomize_block.py @@ -6,6 +6,7 @@ from django.utils.functional import cached_property from lxml import etree from web_fragments.fragment import Fragment +from xblock.core import XBlock from xblock.fields import Integer, Scope from xmodule.mako_block import MakoTemplateBlockBase from xmodule.seq_block import SequenceMixin @@ -27,6 +28,7 @@ class RandomizeBlock( XModuleToXBlockMixin, ResourceTemplates, XModuleMixin, + XBlock, ): """ Chooses a random child xblock. Chooses the same one every time for each student. diff --git a/xmodule/seq_block.py b/xmodule/seq_block.py index 6d1a8c59adeb..f616b891a8ee 100644 --- a/xmodule/seq_block.py +++ b/xmodule/seq_block.py @@ -254,6 +254,7 @@ class SequenceBlock( XModuleToXBlockMixin, ResourceTemplates, XModuleMixin, + XBlock, ): """ Layout module which lays out content in a temporal sequence diff --git a/xmodule/split_test_block.py b/xmodule/split_test_block.py index 05ca3a5db454..dcc8ac927336 100644 --- a/xmodule/split_test_block.py +++ b/xmodule/split_test_block.py @@ -134,6 +134,7 @@ class SplitTestBlock( # lint-amnesty, pylint: disable=abstract-method ResourceTemplates, XModuleMixin, StudioEditableBlock, + XBlock, ): """ Show the user the appropriate child. Uses the ExperimentState diff --git a/xmodule/template_block.py b/xmodule/template_block.py index e6e69742cfbf..6fbb9e526598 100644 --- a/xmodule/template_block.py +++ b/xmodule/template_block.py @@ -28,6 +28,7 @@ class CustomTagTemplateBlock( # pylint: disable=abstract-method XModuleToXBlockMixin, ResourceTemplates, XModuleMixin, + XBlock, ): """ A block which provides templates for CustomTagBlock. The template name @@ -122,6 +123,7 @@ def export_to_file(self): class TranslateCustomTagBlock( # pylint: disable=abstract-method XModuleToXBlockMixin, XModuleMixin, + XBlock, ): """ Converts olx of the form `<$custom_tag attr="" attr=""/>` to CustomTagBlock diff --git a/xmodule/tests/test_xml_block.py b/xmodule/tests/test_xml_block.py index 7f33aad0f998..f7716ded2591 100644 --- a/xmodule/tests/test_xml_block.py +++ b/xmodule/tests/test_xml_block.py @@ -7,6 +7,7 @@ import dateutil.parser from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator +from xblock.core import XBlock from xblock.field_data import DictFieldData from xblock.fields import Any, Boolean, Dict, Float, Integer, List, Scope, String from xblock.runtime import DictKeyValueStore, KvsFieldData @@ -65,7 +66,7 @@ class InheritingFieldDataTest(unittest.TestCase): Tests of InheritingFieldData. """ - class TestableInheritingXBlock(XmlMixin): # lint-amnesty, pylint: disable=abstract-method + class TestableInheritingXBlock(XmlMixin, XBlock): # lint-amnesty, pylint: disable=abstract-method """ An XBlock we can use in these tests. """ @@ -227,7 +228,7 @@ def test_defaults_not_inherited_across_lib(self): class EditableMetadataFieldsTest(unittest.TestCase): - class TestableXmlXBlock(XmlMixin, XModuleMixin): # lint-amnesty, pylint: disable=abstract-method + class TestableXmlXBlock(XmlMixin, XModuleMixin, XBlock): # lint-amnesty, pylint: disable=abstract-method """ This is subclassing `XModuleMixin` to use metadata fields in the unmixed class. """ diff --git a/xmodule/video_block/video_block.py b/xmodule/video_block/video_block.py index b4fddb63fa7a..890803025683 100644 --- a/xmodule/video_block/video_block.py +++ b/xmodule/video_block/video_block.py @@ -122,7 +122,8 @@ class VideoBlock( VideoFields, VideoTranscriptsMixin, VideoStudioViewHandlers, VideoStudentViewHandlers, EmptyDataRawMixin, XmlMixin, EditingMixin, XModuleToXBlockMixin, - ResourceTemplates, XModuleMixin, LicenseMixin): + ResourceTemplates, XModuleMixin, LicenseMixin, + XBlock): """ XML source example: