Skip to content

Add load_octaverc trait to skip sourcing ~/.octaverc on startup#290

Merged
blink1073 merged 2 commits into
Calysto:mainfrom
blink1073:no-load-octaverc
Mar 14, 2026
Merged

Add load_octaverc trait to skip sourcing ~/.octaverc on startup#290
blink1073 merged 2 commits into
Calysto:mainfrom
blink1073:no-load-octaverc

Conversation

@blink1073
Copy link
Copy Markdown
Contributor

@blink1073 blink1073 commented Mar 14, 2026

Summary

  • Adds a load_octaverc configurable Bool trait to OctaveKernel (default True) and a matching load_octaverc parameter to OctaveEngine
  • When set to False, the kernel skips source ~/.octaverc during startup — useful for reproducible/sandboxed environments (CI, shared JupyterHub) where the init file may modify the path, print output that confuses the kernel, or is unavailable
  • Fixes a pre-existing mypy error caused by the ASV env/ directory containing a duplicate benchmarks module, by adding env/ to mypy's exclude list
  • Adds unit tests verifying source ~/.octaverc is present by default and absent when load_octaverc=False

Test plan

  • All existing tests pass (just test)
  • Type check passes (just typing)
  • New tests cover default and disabled behaviour (TestStartup)
  • Verify c.OctaveKernel.load_octaverc = False in ~/.jupyter/octave_kernel_config.py prevents ~/.octaverc from being sourced

Adds a configurable Bool trait to OctaveKernel (and a matching parameter
to OctaveEngine) that controls whether ~/.octaverc is sourced during
startup. Defaults to True (existing behaviour). Setting it to False is
useful in reproducible/sandboxed environments where the init file may
alter the path, print pager output, or is unavailable.

Also excludes the ASV env/ directory from mypy to fix a pre-existing
duplicate-module error.
Verifies that source ~/.octaverc is included in the startup command by
default, and omitted when load_octaverc is set to False.
@blink1073 blink1073 merged commit 87c234d into Calysto:main Mar 14, 2026
26 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.54%. Comparing base (17b858c) to head (3fc28a0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #290      +/-   ##
==========================================
+ Coverage   91.48%   91.54%   +0.05%     
==========================================
  Files           6        6              
  Lines         423      426       +3     
==========================================
+ Hits          387      390       +3     
  Misses         36       36              
Flag Coverage Δ
linux-py3.10 90.14% <100.00%> (+0.06%) ⬆️
linux-py3.11 90.14% <100.00%> (+0.06%) ⬆️
linux-py3.12 90.14% <100.00%> (+0.06%) ⬆️
linux-py3.13 90.14% <100.00%> (+0.06%) ⬆️
linux-py3.14 90.14% <100.00%> (+0.06%) ⬆️
linux-py3.14t 90.14% <100.00%> (+0.06%) ⬆️
macos-latest 90.14% <100.00%> (+0.06%) ⬆️
ubuntu-flatpak 90.84% <100.00%> (+0.06%) ⬆️
ubuntu-snap 89.90% <100.00%> (+0.07%) ⬆️
windows-latest 90.37% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
octave_kernel/kernel.py 92.47% <100.00%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@blink1073 blink1073 mentioned this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant