Commit 545aa22
Missing python build assets (#835)
### Changelog
Fixes a bug where the `widget.js` static asset was missing from Python
library builds, restoring Jupyter notebook integration.
### Docs
None
### Description
This PR addresses bug ERT-1463, where the `widget.js` static asset was
missing from Python builds, specifically when wheels were built from the
sdist artifact. This resulted in broken Jupyter notebook functionality
for the `foxglove-sdk` Python library.
The root cause was identified as:
1. An incorrect `tool.maturin.include` path in `pyproject.toml` that no
longer matched the actual location of the generated `widget.js` file,
causing it to be excluded from the sdist.
2. The `custom_build.py` script used `assert` statements, which could be
skipped in CI environments running Python with optimizations, allowing
builds to succeed even when the asset was not generated or found.
This PR implements the following changes to resolve the issue and
prevent future regressions:
* **Corrected `maturin` include path**: The `pyproject.toml` has been
updated to `python/foxglove/notebook/static/*` to correctly include
`widget.js` in the sdist.
* **Robust asset existence check**: The `assert` in `custom_build.py`
has been replaced with `raise FileNotFoundError` to ensure that the
build fails reliably if `widget.js` is not present, regardless of Python
optimization settings.
* **CI sdist validation**: A new step has been added to the `python.yml`
workflow to explicitly verify that the generated sdist artifact contains
the `widget.js` file, providing an early warning if the asset is missing
from the package.
These changes ensure that the Python library is correctly packaged with
all necessary static assets, restoring full functionality for Jupyter
notebook users, and adding a robust safeguard against similar issues in
the future.
<!-- In addition to unit tests, describe any manual testing you did to
validate this change. Agents should instead insert a TODO list of manual
testing steps for reviewers, if any are necessary. -->
CI will validate the sdist contents with the newly added check.
Reviewers can manually verify by building the sdist locally and
inspecting its contents.
<table><tr><th>Before</th><th>After</th></tr><tr><td>
<!-- Screenshot or visual demonstration of the old behavior -->
Build does not include static assets:
<img width="376" height="349" alt="Screenshot 2026-01-23 at 12 48 55"
src="https://github.com/user-attachments/assets/e575cfed-7cf0-4e2a-b6b5-87823c85f77d"
/>
</td><td>
<!-- Screenshot or visual demonstration of the new behavior -->
Build includes static assets:
<img width="368" height="377" alt="Screenshot 2026-01-23 at 12 51 09"
src="https://github.com/user-attachments/assets/1ab05699-1977-4893-b663-f1556d6da239"
/>
</td></tr></table>
Fixes: [ERT-1463](https://linear.app/foxglove/issue/ERT-1463)
---
<a
href="https://cursor.com/background-agent?bcId=bc-def95794-4a20-48eb-af7a-9e7be3f6dfc2"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-cursor-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in
Cursor"
src="https://cursor.com/open-in-cursor.svg"></picture></a> <a
href="https://cursor.com/agents?id=bc-def95794-4a20-48eb-af7a-9e7be3f6dfc2"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-web-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web"
src="https://cursor.com/open-in-web.svg"></picture></a>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>1 parent 3b6f12f commit 545aa22
3 files changed
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
336 | 356 | | |
337 | 357 | | |
338 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
0 commit comments