Repository navigation
Keep labextensions source tree out of wheels - #3459
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3459 +/- ##
==========================================
+ Coverage 84.86% 84.89% +0.03%
==========================================
Files 160 161 +1
Lines 19327 19379 +52
Branches 502 502
==========================================
+ Hits 16402 16452 +50
- Misses 2885 2887 +2
Partials 40 40
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
lresende
force-pushed
the
fix-wheel-labextensions
branch
from
November 15, 2026 01:09
b19439b to
019c174
Compare
The [tool.hatch.build] include of "labextensions/**/*" put the whole labextensions/ source tree into every wheel, in addition to the copy installed through the shared-data mappings: - elyra wheels shipped each built UI asset twice: once under share/jupyter/labextensions, which JupyterLab loads, and again under site-packages/labextensions (about 8.5 MB unused in 4.2.0). - elyra-server wheels, built before the UI exists, were no longer server-only: they installed the twelve labextensions/*/__init__.py stub modules into site-packages. - The individual extension wheels, rendered from the package template, carried the same duplicate copy and stubs, which clobber elyra-server's stubs when both are installed. Exclude the root-level labextensions/ directory from the wheel target in pyproject.toml and in the extension template. The pattern is anchored with a leading "/" because hatchling also applies wheel excludes to shared-data target paths, so an unanchored pattern would drop share/jupyter/labextensions as well. The sdist is unchanged: its UI assets come from the sdist target's artifacts, so builds from the sdist (such as conda-forge) keep working and pick up the fix. Add tests that build wheels from the real pyproject.toml and template and check the layout, and add hatchling to the test requirements. Signed-off-by: Luciano Resende <lresende@apple.com>
lresende
force-pushed
the
fix-wheel-labextensions
branch
from
November 15, 2026 15:34
019c174 to
552bffc
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.
What changes were proposed in this pull request?
[tool.hatch.build] include = ["elyra/*", "labextensions/**/*"]put the wholelabextensions/source tree into every wheel. That is on top of the copy that[tool.hatch.build.targets.wheel.shared-data]already installs intoshare/jupyter/labextensions:share/jupyter/labextensionssite-packages/labextensionselyra__init__.pyelyra-server__init__.py(the 3.x wheels shipped none)The stubs are cookiecutter
_jupyter_labextension_paths()modules, and nothing imports them. JupyterLab discovers the extensions throughshare/jupyter/labextensions/*/package.json. When an individual extension is installed next toelyra-server, conda reports these duplicated stubs as clobbered paths.This PR excludes the root-level
labextensions/directory from the wheel target, both inpyproject.tomland in the individual-extension template (etc/templates/pyproject.toml):/labextensions). hatchling also applies wheel excludes to shared-data target paths, so an unanchoredlabextensionswould dropshare/jupyter/labextensionsas well.elyra/testsis repeated in the new exclude list. A target-levelexcludereplaces the global one.artifacts, so anything that builds from the sdist (e.g. conda-forge) keeps working and picks up the fix.It also adds
elyra/tests/test_packaging.py, which builds wheels from the realpyproject.tomland the extension template and checks their layout, and addshatchlingtotest_requirements.txt.How was this pull request tested?
python -m pytest elyra/tests/test_packaging.py. 4 of the 5 cases fail on the current configuration, and all 5 pass with this change. The UI-through-shared-data case caught the unanchored-pattern pitfall described above.create-release.pyon this branch:build_server(),build_release()with a real UI build, andprepare_extensions_release(). Compared with the published 4.2.0 wheels:elyra: 131 UI files and nosite-packages/labextensions(was 131 UI files plus a 131-file duplicate plus 12 stubs).elyra-server: no labextension files at all, the same shape as 3.x.site-packages/labextensions.elyrasdist: an identical file list with and without the change (412 files, including all 131 built assets).elyra-serverin a clean conda env. In each casejupyter labextension listshowed exactly its bundled@elyraextensions asenabled OK, theelyraserver extension validated,pip checkwas clean, and uninstalling left nothing behind. I then installedelyra-serverwith all five extensions together and checked the UI in JupyterLab.Developer's Certificate of Origin 1.1