fix: recover handling of typing.Optional[X] (#90)
This fixes downstream bug https://github.com/bouweandela/snakemake-storage-plugin-rucio/issues/41 which prevented
type.Optional[int]settings from performing a type conversion.Turns out that was a regression from https://github.com/snakemake/snakemake-interface-common/pull/59 @jjjermiah
typing.Union[X] is not instance of type. The logic of the function is about checking the type of
value, so specifying a narrow annotation forces duplicating function logic around its calls.Summary by CodeRabbit
Bug Fixes
Improved error handling for type conversions in plugin settings with clearer, descriptive user-facing errors when conversion fails.
Refactor
Broadened plugin type handling to accept more complex type representations and enforce valid Union usage (disallowing non-Optional unions).
Tests
Added tests covering integer conversion and Optional[int] handling for plugin settings, plus example plugin/settings scaffolding.
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) aider@aider.chat Co-authored-by: Johannes Köster johannes.koester@uni-due.de
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
snakemake-interface-common
Common functions and classes for Snakemake and its plugins.