Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow script directive to take pathlib Path #1869

Merged
merged 1 commit into from Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions snakemake/script.py
Expand Up @@ -1498,6 +1498,8 @@ def script(
"""
Load a script from the given basedir + path and execute it.
"""
if isinstance(path, Path):
path = str(path)

path, source, language, is_local = get_source(
path, SourceCache(runtime_sourcecache_path), basedir, wildcards, params
Expand Down
4 changes: 3 additions & 1 deletion tests/test_script/Snakefile
@@ -1,3 +1,5 @@
from pathlib import Path


configfile: "config.yaml"

Expand Down Expand Up @@ -28,7 +30,7 @@ rule:
output:
"test.in"
script:
"scripts/test.py"
Path("scripts/test.py")

rule:
output:
Expand Down