Skip to content

Commit 59bebc2

Browse files
authored
Merge pull request #6 from SpM-lab/ci/julia-kernel-alias
Fix the book build in CI: one Julia kernel for all notebooks, exclude .venv
2 parents fbe4cec + f007877 commit 59bebc2

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎_config.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,19 @@ sphinx:
5050
config:
5151
bibtex_reference_style: author_year
5252
language: en
53+
# Setting exclude_patterns replaces Jupyter Book's defaults, so they are
54+
# repeated here; .venv keeps Sphinx out of the installed packages.
5355
exclude_patterns:
5456
- src_disabled
57+
- _build
58+
- .venv
59+
- Thumbs.db
60+
- .DS_Store
61+
- "**.ipynb_checkpoints"
62+
# The notebooks name "julia-x.y" kernels; run them all with the "julia"
63+
# kernel that register_julia_kernel.jl installs.
64+
nb_kernel_rgx_aliases:
65+
"julia-.*": julia
5566

5667
parse:
5768
myst_substitutions:

‎register_julia_kernel.jl‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ if abspath(PROGRAM_FILE) == @__FILE__
140140

141141
@printf "Registering kernel with project directory: %s\n" project_dir
142142

143-
# Register kernel with name "julia-x.y" to match the notebooks
144-
success = register_julia_kernel("julia-$(VERSION.major).$(VERSION.minor)", "julia", project_arg)
143+
# Register the kernel as "julia", without the version. The notebooks name
144+
# "julia-x.y" kernels of different versions; _config.yml maps all of them
145+
# to this one (nb_kernel_rgx_aliases), so the build works with any Julia.
146+
success = register_julia_kernel("julia", "julia", project_arg)
145147

146148
if success
147149
println("✓ Kernel registration completed successfully")

0 commit comments

Comments
 (0)