docs: fix code snippets that fail when run#46
Merged
Conversation
Corrects several book and slide examples that error or misbehave when
actually executed:
- stable ABI: use CMake list form so python_add_library sees USE_SABI
- rescale metadata exercise: use real pip via uv run --with pip
- template plugin: str.format needs {project[version]} without quotes
- overrides: rename conditional wheel.cmake to cmake-wheel
- sdist checker: uvx check-sdist, not check-dist
- approx: widen literal so 1/3 comparison passes
- setup single-file: run simple.py to match the created filename
- lazy imports slide: restore parser.add_argument for args.foo
- Fedora spec: %pyproject_buildrequires -x test so pytest is available
- editable install pitfall: Path(__file__).parent, FileNotFoundError
Assisted-by: ClaudeCode:claude-opus-4-8
henryiii
added a commit
that referenced
this pull request
Jul 13, 2026
The example spec was a hollow stub with only a preamble and an empty %files section, while the chapter and slides walk through a full spec. Flesh it out to match the walked-through spec, including the %pyproject_buildrequires -x test fix from PR #46 so pytest is present in the buildroot for %check. Assisted-by: ClaudeCode:claude-opus-4-8
henryiii
added a commit
that referenced
this pull request
Jul 13, 2026
Now that #46 is merged, the chapter can include the example spec directly instead of carrying an inline copy, so the two cannot drift again. The Marp deck keeps its inline copy (no include mechanism). Assisted-by: ClaudeCode:claude-opus-4-8
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.
🤖 AI text below 🤖
Fixes several book and slide code snippets that error or misbehave when actually run. Found by a multi-agent review pass over the workshop content.
content/scikit-build/02_stable_abi.md,slides/4_02_stable_abi.md): use the CMake list formset(USE_SABI USE_SABI ${...})sopython_add_libraryactually receives theUSE_SABIkeyword.content/basic-packaging/03_package.md,slides/1_03_package.md):uv pip show -vdoesn't emitSummary:/Entry-points:(-vis uv's log level); switch to real pip viauv run --with pip pip show -v rescale.content/scikit-build/03_dynamic_metadata.md,slides/4_03_dynamic_metadata.md):str.formatneeds{project[version]}without quotes, elseKeyError.content/scikit-build/05_overrides.md): the override conditional iscmake-wheel, notwheel.cmake.content/compiled/01_compiled.md): the tool isuvx check-sdist, notcheck-dist.slides/1_04_sp_guide.md): widen the literal toapprox(0.3333333333333)so1/3passes the default tolerance (matches the chapter).content/basic-packaging/01_setup.md): runsimple.pyto match the filename that was created.slides/6_02_lazy_imports.md): restore theparser.add_argument("--foo", ...)line soargs.fooworks.content/other-tools/04_distros.md,slides/5_04_distros.md):%pyproject_buildrequires -x testso pytest is installed before%check.content/scikit-build/04_editable_installs.md,slides/4_04_editable_installs.md):Path(__file__).parent / "my_lib.so"(raisingFileNotFoundError) actually demonstrates the pitfall; the old form raisedNotADirectoryErrorin any install.