tutorial figures (notebook + docs) + PyPI README images + release 0.2.0 - #4
Merged
Merged
Conversation
…ages The #3 smooth-all-once merge (9d6ac8c) rebuilt tutorial.ipynb from build_tutorial.py but committed it *unexecuted* -- stripping all outputs. The published docs ship the notebook pre-executed (nb_execution_mode=off), so settylab.github.io/spatial-smooth/tutorial.html rendered zero figures and zero cell outputs. Re-execute the tutorial on the full 36k-cell section and commit it with outputs: 7 figures, the truncation UserWarning preserved on stderr, no error outputs, no host-path leaks. The docs now embed all 7 figures. Also: - build_tutorial.py: the 10x CloudFront CDN rejects the default Python-urllib User-Agent with HTTP 403, so the download cell failed for everyone. Present a browser User-Agent so the notebook is runnable. - test_tutorial_artifact.py: the host-path leak test scanned the raw notebook JSON including base64 image data, where "/fh/" or "/home/" appears by chance in a large enough figure -- a spurious failure on an honest notebook. Scan only the readable surfaces the scrubber cleans (source, stream, text/plain|html|markdown, traceback), not media. - README.md: the long-description feeds the PyPI project page, which resolves image src against nothing, so the two relative figure paths 404'd. Point them (and the Tutorial/LICENSE links) at absolute URLs (raw.githubusercontent.com / github.com, ref main) so PyPI renders them.
Since v0.1.0 the package gained three user-facing features -- `blend` composition mode (#1), the smoothing reuse cache (#2), and smooth-all-once `all_genes=True` (#3) -- so a MINOR bump to 0.2.0 is the correct SemVer step. - pyproject.toml + src/spatial_smooth/__init__.py: version 0.1.0 -> 0.2.0 - docs/source/installation.rst: the illustrative check_dependencies() output shows v0.2.0 (it prints v{__version__}) - CHANGELOG.md: new; 0.2.0 (the three features + the tutorial-now-executed and PyPI-image fixes) and a 0.1.0 baseline entry conf.py already tracks __version__, so the docs title/version follow automatically. twine check passes on the 0.2.0 sdist+wheel; the full test suite is green.
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 & why
The tutorial should actually contain its outputs and figures; the red v0.1.0 PyPI deployment and the broken images on the PyPI project page should be fixed; and — since
blend(#1), the reuse cache (#2) and smooth-all-once (#3) landed after v0.1.0 — the package should be released as 0.2.0, correctly this time.A. Tutorial ships executed, with figures (notebook and docs)
Diagnosis. The
#3smooth-all-once merge (9d6ac8c) rebuilttutorial.ipynbfrombuild_tutorial.pybut committed it unexecuted — every output stripped (0 figures;682501ehad 5). The docs ship the notebook pre-executed (nb_execution_mode = "off"), so the live page rendered zero figures and outputs (0<img>, 0 cell-output containers). Themystnb.unknown_mime_typesuppression was a red herring —image/pngis standard and renders fine; the sole gap was the missing committed outputs.Fix. Re-executed on the full 36k-cell section (canonical
notebooks/run_tutorial.sh: build →nbconvert --execute→ scrub). The committed notebook now carries 7image/pngfigures, 0 error outputs, the level-three truncationUserWarningpreserved on stderr, and 0 host-path/UUID leaks (scrub exit 0). Local docs build embeds all 7 figures (<img src="_images/…png">).tests/test_tutorial_artifact.pypasses 7/7.Two supporting bug fixes surfaced during re-execution:
build_tutorial.py— the 10x CloudFront CDN rejects the defaultPython-urllibUser-Agent with HTTP 403, so the dataset download cell failed for everyone. Present a browser User-Agent.tests/test_tutorial_artifact.py— the host-path leak test scanned the raw notebook JSON including base64 image data, where/fh/appears by chance in a big enough figure — a spurious failure. Now scans only the readable surfaces the scrubber cleans (source, stream,text/plain|html|markdown, traceback), never encoded media. Same real intent, no base64 flakiness.D. Release 0.2.0 (this PR bumps the version; the operator publishes)
blend(#1), the smoothing reuse cache (#2) and smooth-all-onceall_genes=True(#3) are new user-facing features since v0.1.0 → a MINOR bump is the correct SemVer step. Bumpedpyproject.toml+src/spatial_smooth/__init__.pyto 0.2.0 (conf.pytracks__version__, so docs follow); updated the illustrativecheck_dependencies()output ininstallation.rst; added aCHANGELOG.md.twine checkpasses on the 0.2.0 sdist+wheel; full test suite green.C. Broken images on the PyPI project page
The PyPI long-description is the README (
pyproject.tomlreadme); PyPI resolves imagesrcagainst nothing, so the two relative figure paths 404 on the project page (and thenotebooks/tutorial.ipynb/LICENSElinks 404 off-site). Rewrote all four to absolute URLs (raw.githubusercontent.com/.../main/…;github.com/.../blob/main/…). Rendered long-description<img>srcs are absolute and HTTP 200;twine checkpasses; GitHub still renders everything.B. Why v0.1.0's deployment was red (root cause; fixed by the release procedure, not code)
Run
29120105023failed atpypa/gh-action-pypi-publish, verbatim:The OIDC token is valid; PyPI simply has no Trusted Publisher registered for these claims.
release.ymlis correct (id-token: write, environmentpypi,skip-existing: true,@release/v1) — the claims match a TP registration exactly — so no workflow code change. The fix is the one-time TP registration in the release procedure below.The release procedure — do 0.2.0 correctly this time (operator-owned)
Ordered steps so v0.2.0 publishes green with working images. Steps (a)/(c) need a PyPI project owner and
actions:write, which the bot lacks — all operator-owned:spatial-smooth→ Publishing → add a GitHub Actions publisher: ownersettylab, repositoryspatial-smooth, workflow filenamerelease.yml, environmentpypi.main.v0.2.0and publish the GitHub release (Releases → Draft a new release → tagv0.2.0onmain→ Publish). Publishing firesrelease.yml; the OIDC claims now match the TP → it builds and publishes to PyPI. (workflow_dispatchalso works, but therelease: publishedtrigger is the intended path.)pypideployment is GREEN;pypi.org/project/spatial-smooth/shows 0.2.0; and the project-page images now render — because 0.2.0's long-description carries the absolute URLs. (The v0.1.0 page stays broken; that's expected — PyPI freezes it per version.)Do not cut/publish the release from this PR — it is operator +
actions:write-gated.Verification (in this branch)
image/png, 0 errors, truncation warning on stderr, 0 readable leaks (scrub exit 0)spatial-smooth 0.2.0pyproject.toml+__version__=0.2.0;ss.__version__ == "0.2.0"pytestfull suite → green;twine check dist/*→ PASSED on the 0.2.0 sdist+wheel<img>srcs absolute + HTTP 200Notes
main. Please review — do not merge on my behalf (public flagship repo). Nothing published._static/*.pngREADME assets are unchanged (they already resolve atmain).