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 <noreply@anthropic.com>
This commit is contained in:
Feanil Patel
2026-01-20 11:26:06 -05:00
parent 642fa02710
commit e548ba8980
2 changed files with 35 additions and 36 deletions

View File

@@ -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"

View File

@@ -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',