From e548ba8980697376d944c90d5f9d40148211e9f1 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 20 Jan 2026 11:26:06 -0500 Subject: [PATCH] feat: migrate XBlock entry points to pyproject.toml Migrates 30 xblock.v1 entry points from setup.py. Removes XBLOCKS constant as it's no longer needed. Co-Authored-By: Claude Opus 4.5 --- pyproject.toml | 35 +++++++++++++++++++++++++++++++++++ setup.py | 36 ------------------------------------ 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e8e86e28c4..0b72676081 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,3 +13,38 @@ packages = ["cms", "common", "lms", "openedx", "xmodule"] [tool.setuptools.package-data] xmodule = ["js/module/*"] + +[project.entry-points."xblock.v1"] +about = "xmodule.html_block:AboutBlock" +book = "xmodule.template_block:TranslateCustomTagBlock" +annotatable = "xmodule.annotatable_block:AnnotatableBlock" +chapter = "xmodule.seq_block:SectionBlock" +conditional = "xmodule.conditional_block:ConditionalBlock" +course = "xmodule.course_block:CourseBlock" +course_info = "xmodule.html_block:CourseInfoBlock" +customtag = "xmodule.template_block:CustomTagBlock" +custom_tag_template = "xmodule.template_block:CustomTagTemplateBlock" +discuss = "xmodule.template_block:TranslateCustomTagBlock" +discussion = "xmodule.discussion_block:DiscussionXBlock" +error = "xmodule.error_block:ErrorBlock" +hidden = "xmodule.hidden_block:HiddenBlock" +html = "xmodule.html_block:HtmlBlock" +itembank = "xmodule.item_bank_block:ItemBankBlock" +image = "xmodule.template_block:TranslateCustomTagBlock" +library = "xmodule.library_root_xblock:LibraryRoot" +library_content = "xmodule.library_content_block:LegacyLibraryContentBlock" +lti = "xmodule.lti_block:LTIBlock" +poll_question = "xmodule.poll_block:PollBlock" +problem = "xmodule.capa_block:ProblemBlock" +randomize = "xmodule.randomize_block:RandomizeBlock" +sequential = "xmodule.seq_block:SequenceBlock" +slides = "xmodule.template_block:TranslateCustomTagBlock" +split_test = "xmodule.split_test_block:SplitTestBlock" +static_tab = "xmodule.html_block:StaticTabBlock" +unit = "xmodule.unit_block:UnitBlock" +vertical = "xmodule.vertical_block:VerticalBlock" +video = "xmodule.video_block:VideoBlock" +videoalpha = "xmodule.video_block:VideoBlock" +videodev = "xmodule.template_block:TranslateCustomTagBlock" +word_cloud = "xmodule.word_cloud_block:WordCloudBlock" +wrapper = "xmodule.wrapper_block:WrapperBlock" diff --git a/setup.py b/setup.py index 0eb6d77e1d..a067dbdc06 100644 --- a/setup.py +++ b/setup.py @@ -4,41 +4,6 @@ Setup script for the Open edX package. from setuptools import setup -XBLOCKS = [ - "about = xmodule.html_block:AboutBlock", - "book = xmodule.template_block:TranslateCustomTagBlock", - "annotatable = xmodule.annotatable_block:AnnotatableBlock", - "chapter = xmodule.seq_block:SectionBlock", - "conditional = xmodule.conditional_block:ConditionalBlock", - "course = xmodule.course_block:CourseBlock", - "course_info = xmodule.html_block:CourseInfoBlock", - "customtag = xmodule.template_block:CustomTagBlock", - "custom_tag_template = xmodule.template_block:CustomTagTemplateBlock", - "discuss = xmodule.template_block:TranslateCustomTagBlock", - "discussion = xmodule.discussion_block:DiscussionXBlock", - "error = xmodule.error_block:ErrorBlock", - "hidden = xmodule.hidden_block:HiddenBlock", - "html = xmodule.html_block:HtmlBlock", - "itembank = xmodule.item_bank_block:ItemBankBlock", - "image = xmodule.template_block:TranslateCustomTagBlock", - "library = xmodule.library_root_xblock:LibraryRoot", - "library_content = xmodule.library_content_block:LegacyLibraryContentBlock", - "lti = xmodule.lti_block:LTIBlock", - "poll_question = xmodule.poll_block:PollBlock", - "problem = xmodule.capa_block:ProblemBlock", - "randomize = xmodule.randomize_block:RandomizeBlock", - "sequential = xmodule.seq_block:SequenceBlock", - "slides = xmodule.template_block:TranslateCustomTagBlock", - "split_test = xmodule.split_test_block:SplitTestBlock", - "static_tab = xmodule.html_block:StaticTabBlock", - "unit = xmodule.unit_block:UnitBlock", - "vertical = xmodule.vertical_block:VerticalBlock", - "video = xmodule.video_block:VideoBlock", - "videoalpha = xmodule.video_block:VideoBlock", - "videodev = xmodule.template_block:TranslateCustomTagBlock", - "word_cloud = xmodule.word_cloud_block:WordCloudBlock", - "wrapper = xmodule.wrapper_block:WrapperBlock", -] XBLOCKS_ASIDES = [ 'tagging_aside = cms.lib.xblock.tagging:StructuredTagsAside', ] @@ -171,7 +136,6 @@ setup( 'enrollment_track = xmodule.partitions.enrollment_track_partition_generator:create_enrollment_track_partition', # lint-amnesty, pylint: disable=line-too-long 'team = openedx.core.lib.teams_config:create_team_set_partition', ], - 'xblock.v1': XBLOCKS, 'xblock_asides.v1': XBLOCKS_ASIDES, 'console_scripts': [ 'xmodule_assets = xmodule.static_content:main',