Skip to content

f-strings no longer accepted in shell commands #2586

@tsnorri

Description

@tsnorri

Snakemake version
8.0.1, also tested the main branch. Snakemake 7.32.4 does not have the bug.

Describe the bug
Passing an f-string to the shell command results in an error message similar to the following one:

SyntaxError in file /Users/tsnorri/snakemake-bug-test/Snakefile, line 7:
unterminated f-string literal (detected at line 7) (Snakefile, line 7)

Minimal example

rule all:
	shell:	f"echo 'test'"

Snakemake 8.0.1 accepts the input if the f-string is changed to a plain one.

Additional context
The second example on the page Snakefiles and Rules in Snakemake’s documentation demonstrates the use of an f-string with the shell command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions