fix: notebook execution for apptainer#3131
Conversation
WalkthroughThe changes introduce a new parameter, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant JupyterNotebook
participant CommandExecutor
User->>JupyterNotebook: execute_script(fname, edit)
JupyterNotebook->>CommandExecutor: _execute_cmd(fname, is_python_script=True)
CommandExecutor-->>JupyterNotebook: Execute script
JupyterNotebook-->>User: Return execution result
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)
🔇 Additional comments (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Also, it may be better to add some tests for notebook execution in apptainer, to prevent trivial bugs like this one here. |
johanneskoester
left a comment
There was a problem hiding this comment.
Good catch! To me the name also sounds correct for a notebook.
Indeed! I won't be able to do that now, but if you want to do it in this PR please feel free to do so. If not, it would be ok to merge this without or while adding a TODO. |
Thanks for the quick reply! I would recommend merging this first, as this bug makes |
|
🤖 I have created a release *beep* *boop* --- ## [8.21.0](v8.20.7...v8.21.0) (2024-10-12) ### Features * support for specifying conda envs as directories ([#3132](#3132)) ([c54c95d](c54c95d)) ### Bug Fixes * better error handling in evaluate function ([#3129](#3129)) ([04fb97f](04fb97f)) * notebook execution for apptainer ([#3131](#3131)) ([2e382c4](2e382c4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>



At
snakemake/snakemake/deployment/singularity.py
Lines 118 to 125 in afa7bad
snakemake searchpaths are only bound into apptainer when
is_python_scriptisTrue. Fornotebookdirective,is_python_scriptwill beFalseand snakemake searchpaths are not bound into apptainer, causingModuleNotFoundError: No module named 'snakemake'error in the preamble. This PR setsis_python_scripttoTruefornotebookdirective.Also, the name,
is_python_script, could then be somewhat confusing. Changing it to something likeis_scriptorhas_preamblemight be better.QC
docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).Summary by CodeRabbit
New Features
Bug Fixes