Add load_octaverc trait to skip sourcing ~/.octaverc on startup#290
Merged
Conversation
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Closed
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.
Summary
load_octavercconfigurableBooltrait toOctaveKernel(defaultTrue) and a matchingload_octavercparameter toOctaveEngineFalse, the kernel skipssource ~/.octavercduring 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 unavailableenv/directory containing a duplicatebenchmarksmodule, by addingenv/to mypy'sexcludelistsource ~/.octavercis present by default and absent whenload_octaverc=FalseTest plan
just test)just typing)TestStartup)c.OctaveKernel.load_octaverc = Falsein~/.jupyter/octave_kernel_config.pyprevents~/.octavercfrom being sourced