Skip to content

Misleading line on rulescript type hinting in rule docs #4192

@jonasfreimuth

Description

@jonasfreimuth

Snakemake version

9.20.0

Describe the bug

Currently, the docs on writing python scripts run via the script directive still advise on using from snakemake.script import snakemake to let type hintig tools know what the type of the snakemake object used by the script is. This is however outdated since v9.17.0 (PR #4032), and has mislead me for quite a while. Yes, I see the large block expanding on type checking below now, but once the brain thinks it has what it was looking for, no further input is considered...

It is also possible to explicitly import the snakemake object in the script like ``from snakemake.script import snakemake`` to enable code completion, linting and type checking your python code in IDEs.

Logs

Minimal example

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions