Skip to content

Commit 16cd54f

Browse files
fix: ship shared capa test fixtures in the wheel
MANIFEST.in already declares that the three shared capa fixtures -- ``response_xml_factory``, ``helpers`` and ``test_util`` -- must stay in the distribution because openedx-platform imports them from its own test suite: # --- TEST UTILITY INCLUSIONS --- # Re-include specific test files that are excluded above. # We do this because openedx-platform imports these specific test helpers. include xblocks_contrib/problem/capa/tests/test_util.py include xblocks_contrib/problem/capa/tests/helpers.py include xblocks_contrib/problem/capa/tests/response_xml_factory.py MANIFEST.in only governs the sdist though. Wheel contents come from ``[tool.setuptools.packages.find]``, whose blanket ``*tests*`` exclusion drops the whole ``xblocks_contrib.problem.capa.tests`` package, so the intent above has not applied to the wheel since 1.0.0. Consequence: any openedx-platform version installing xblocks-contrib >=1.0.0 fails to collect ~17 of its own test modules with ModuleNotFoundError: No module named 'xblocks_contrib.problem.capa.tests' which is why openedx-platform is pinned back to 0.17.0 and cannot pick up newer releases. Spell the exclusions out per package instead of using a blanket glob, so the capa fixtures stay discoverable. Verified by building the wheel: the capa tests package is present, no other test package is, and the uncompressed size grows 5.07MB -> 5.54MB.
1 parent 996977d commit 16cd54f

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

‎pyproject.toml‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,32 @@ include-package-data = true
127127

128128
[tool.setuptools.packages.find]
129129
include = ["xblocks_contrib*", "xblock_pdf*"]
130-
exclude = ["*tests*"]
130+
# Test packages are not shipped, with one deliberate exception:
131+
# ``xblocks_contrib.problem.capa.tests`` holds shared capa fixtures
132+
# (``response_xml_factory``, ``helpers``, ``test_util``) that openedx-platform
133+
# imports from ~17 of its own test modules. MANIFEST.in already declares that
134+
# intent, but it only governs the sdist -- wheel contents come from the package
135+
# discovery below, so this package must stay discoverable. The exclusions are
136+
# therefore listed per package rather than as a blanket ``*tests*``.
137+
exclude = [
138+
"xblock_pdf.tests*",
139+
"xblock_pdf.js_tests*",
140+
"xblocks_contrib.annotatable.tests*",
141+
"xblocks_contrib.discussion.tests*",
142+
"xblocks_contrib.html.tests*",
143+
"xblocks_contrib.lti.tests*",
144+
"xblocks_contrib.poll.tests*",
145+
"xblocks_contrib.problem.tests*",
146+
"xblocks_contrib.problem.capa.safe_exec.tests*",
147+
"xblocks_contrib.video.tests*",
148+
"xblocks_contrib.word_cloud.tests*",
149+
]
131150

132151
[tool.setuptools.exclude-package-data]
133152
"*" = ["tests*", "*.tests*", "spec*", "*.spec*"]
153+
# The capa fixtures ship as Python modules of the package above, which this
154+
# setting does not affect. Its problem-XML corpus is package data, and stays out.
155+
"xblocks_contrib.problem.capa.tests" = ["test_files*"]
134156

135157
[tool.edx_lint]
136158
uv_constraints = [

0 commit comments

Comments
 (0)