Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temp: test XBlock==6, which adds type annotations #35236

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
34 changes: 17 additions & 17 deletions requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
32 changes: 16 additions & 16 deletions requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
32 changes: 16 additions & 16 deletions requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions xmodule/annotatable_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class AnnotatableBlock(
XModuleToXBlockMixin,
ResourceTemplates,
XModuleMixin,
XBlock,
):
"""
Annotatable XBlock.
Expand Down
1 change: 1 addition & 0 deletions xmodule/capa_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class ProblemBlock(
XModuleToXBlockMixin,
ResourceTemplates,
XModuleMixin,
XBlock,
):
"""
An XBlock representing a "problem".
Expand Down
1 change: 1 addition & 0 deletions xmodule/conditional_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ConditionalBlock(
ResourceTemplates,
XModuleMixin,
StudioEditableBlock,
XBlock,
):
"""
Blocks child blocks from showing unless certain conditions are met.
Expand Down
1 change: 1 addition & 0 deletions xmodule/error_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions xmodule/hidden_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class HiddenBlock(
XmlMixin,
XModuleToXBlockMixin,
XModuleMixin,
XBlock,
):
"""
XBlock class loaded by the runtime when another XBlock type has been disabled
Expand Down
8 changes: 4 additions & 4 deletions xmodule/html_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions xmodule/library_content_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class LibraryContentBlock(
ResourceTemplates,
XModuleMixin,
StudioEditableBlock,
XBlock,
):
"""
An XBlock whose children are chosen dynamically from a content library.
Expand Down
1 change: 1 addition & 0 deletions xmodule/lti_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion xmodule/modulestore/tests/test_xml_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
"""
Expand Down
1 change: 1 addition & 0 deletions xmodule/poll_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions xmodule/randomize_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,6 +28,7 @@ class RandomizeBlock(
XModuleToXBlockMixin,
ResourceTemplates,
XModuleMixin,
XBlock,
):
"""
Chooses a random child xblock. Chooses the same one every time for each student.
Expand Down
1 change: 1 addition & 0 deletions xmodule/seq_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ class SequenceBlock(
XModuleToXBlockMixin,
ResourceTemplates,
XModuleMixin,
XBlock,
):
"""
Layout module which lays out content in a temporal sequence
Expand Down
1 change: 1 addition & 0 deletions xmodule/split_test_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions xmodule/template_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class CustomTagTemplateBlock( # pylint: disable=abstract-method
XModuleToXBlockMixin,
ResourceTemplates,
XModuleMixin,
XBlock,
):
"""
A block which provides templates for CustomTagBlock. The template name
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions xmodule/tests/test_xml_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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.
"""
Expand Down
3 changes: 2 additions & 1 deletion xmodule/video_block/video_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
class VideoBlock(
VideoFields, VideoTranscriptsMixin, VideoStudioViewHandlers, VideoStudentViewHandlers,
EmptyDataRawMixin, XmlMixin, EditingMixin, XModuleToXBlockMixin,
ResourceTemplates, XModuleMixin, LicenseMixin):
ResourceTemplates, XModuleMixin, LicenseMixin,
XBlock):
"""
XML source example:
<video show_captions="true"
Expand Down
Loading
Loading