feat: auto detect string resources in resource definitions given by --default-resources and --set-resources in the string yields a syntax error when being interpreted as a python expression; this will obviate the need to quote such expressions in many cases; further, fix interpretation of quoted resources by removing quotes after intepretation#3532
feat: auto detect string resources in resource definitions given by --default-resources and --set-resources in the string yields a syntax error when being interpreted as a python expression; this will obviate the need to quote such expressions in many cases; further, fix interpretation of quoted resources by removing quotes after intepretation#3532johanneskoester merged 6 commits intomainfrom
Conversation
…-default-resources and --set-resources in the string yields a syntax error when trying to be interpreted as a python expression; this will obviate the need to quote such expressions in many cases
📝 WalkthroughWalkthroughThe changes update the exception handling logic in the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant ResourcesModule
Caller->>ResourcesModule: eval_resource_expression(value)
alt Expression evaluates successfully
ResourcesModule-->>Caller: return evaluated result
else NameError or SyntaxError occurs
ResourcesModule-->>Caller: return original value
end
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (34)
🪧 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 (
|
🤖 I have created a release *beep* *boop* --- ## [9.2.0](v9.1.11...v9.2.0) (2025-04-14) ### Features * auto detect string resources in resource definitions given by --default-resources and --set-resources in the string yields a syntax error when being interpreted as a python expression; this will obviate the need to quote such expressions in many cases; further, fix interpretation of quoted resources by removing quotes after intepretation ([#3532](#3532)) ([81f09bd](81f09bd)) ### Bug Fixes * restore accidentally changed behavior of --cores. If not specified, Snakemake now complains again, asking for --cores to be specified (of --jobs in case of remote exec). As before, if a default is desired, it can be easily set via a profile ([#3531](#3531)) ([11b2b30](11b2b30)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…-default-resources and --set-resources in the string yields a syntax error when being interpreted as a python expression; this will obviate the need to quote such expressions in many cases; further, fix interpretation of quoted resources by removing quotes after intepretation (snakemake#3532) ### Description <!--Add a description of your PR here--> ### QC <!-- Make sure that you can tick the boxes below. --> * [x] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [x] The documentation (`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). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved error handling when evaluating resource expressions to better handle invalid input. - Updated test commands to specify core usage for more consistent test execution. - **New Features** - Added tests for resource quoting via profile and CLI options. - Introduced a new test rule that verifies resource value handling. - **Improvements** - Enhanced validation for resource configuration formats with clearer error messages. - Refined resource value parsing to remove unnecessary quotes for consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
🤖 I have created a release *beep* *boop* --- ## [9.2.0](snakemake/snakemake@v9.1.11...v9.2.0) (2025-04-14) ### Features * auto detect string resources in resource definitions given by --default-resources and --set-resources in the string yields a syntax error when being interpreted as a python expression; this will obviate the need to quote such expressions in many cases; further, fix interpretation of quoted resources by removing quotes after intepretation ([snakemake#3532](snakemake#3532)) ([81f09bd](snakemake@81f09bd)) ### Bug Fixes * restore accidentally changed behavior of --cores. If not specified, Snakemake now complains again, asking for --cores to be specified (of --jobs in case of remote exec). As before, if a default is desired, it can be easily set via a profile ([snakemake#3531](snakemake#3531)) ([11b2b30](snakemake@11b2b30)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
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