Repository navigation
Conversation
Each block's compiled JavaScript and CSS is webpack output under src/<block>/public/. That folder is gitignored, and setuptools packages whatever exists without complaint, so a package built without first running `npm ci && npm run build` installs fine but serves no JS or CSS. Only release.yml runs the npm build; python-semantic-release's build_command, `python -m build` and every other local route do not. xblocks-contrib 0.16.2 shipped to PyPI that way: its wheel is missing all seven bundles that 0.16.1 has. Swap the build backend for a thin in-tree wrapper around setuptools.build_meta that fails build_sdist and build_wheel when a block with an assets/ folder has an empty or missing public/. The sdist prunes assets/ and carries public/, so a wheel built from the sdist (and a pip install of it) needs no node. Editable installs are not checked, so `uv sync` and tox work in a checkout with no bundles, as CI's test jobs do. https://peps.python.org/pep-0517/#in-tree-build-backends Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feanil
force-pushed
the
feanil/require-built-assets
branch
from
December 4, 2026 15:41
f894ff6 to
59fc8c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The compiled JS and CSS for the discussion, problem and video blocks is webpack output under
src/<block>/public/. That folder is gitignored, and setuptools packages whatever is there without complaining, so a package built without runningnpm ci && npm run buildfirst installs fine but has none of the bundles. Onlyrelease.ymlruns the npm build today, so a localpython -m buildor a localsemantic-release versionproduces a broken package. This is how xblocks-contrib 0.16.2 ended up on PyPI without its bundles.This swaps the build backend for a small in-tree wrapper around
setuptools.build_metathat fails thebuild_sdistandbuild_wheelhooks when a block with anassets/folder has no files in itspublic/folder. The error names the blocks and says to run the npm build. It doesn't need asetup.py, the wrapper is wired up throughbackend-pathinpyproject.toml.A few things that stay the same:
uv syncand tox still work in a checkout with no bundles. The test jobs in CI never build the frontend and don't need to.assets/and carriespublic/, so building a wheel from the sdist, or a pip install of it, doesn't need node.release.ymlalready runs the npm build before python-semantic-release, so CI releases are unaffected.Testing
The last command should list the 7 bundles. The check itself has unit tests under
build_backend/tests, and tox now runs them along withsrc.Merge checklist:
Check off if complete or not applicable: