snakemake / snakemake/snakemake-interface-common
Tolerate errors in loading unused plugins
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 7
- Avg merge
- 31m
- Merged PRs (30d)
- 1
Description
In general I don't think that errors in loading plugins should prevent Snakemake from executing if that plugin is not used.
I think a good alternative would be to catch general exceptions in plugin code during registration (such as when importing the plugin module), log a warning instead, and store the information that loading the plugin failed. Then if the plugin is actually used Snakemake could fail with an informative error message (possibly printing the original stack trace).
Note that this would probably require special error handling around CLI option parsing - if plugin-specific options are specified, e.g. snakemake --logger mylogger --logger-mylogger-option foo, and an error occurred in loading the mylogger plugin, its settings won't be registered and the --logger-mylogger-option option won't be recognized. This will raise an exception before --logger mylogger is even processed. It should be easy to catch the error, figure out the registry and plugin name, and display the plugin load error if it exists.
I'd be happy to contribute a PR for this.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing plugin registration and CLI option parsing, especially how plugin-specific options such as --logger-mylogger-option are registered and processed. Define how failed unused plugins are recorded and warned about, then verify that selecting a failed plugin produces an informative error while unrelated execution continues.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100