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: patch LocalSourceFile to work with containerize #1211

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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: 1 addition & 1 deletion snakemake/deployment/containerize.py
Expand Up @@ -59,7 +59,7 @@ def containerize(workflow):
"\n".join(map("# {}".format, env.content.decode().strip().split("\n")))
)
get_env_cmds.append("RUN mkdir -p {}".format(prefix))
if env.file.startswith("https://"):
if env.file.get_path_or_uri().startswith("https://"):
# get_env_cmds.append("RUN curl -sSL {} > {}".format(env.file, env_target_path))
get_env_cmds.append("ADD {} {}".format(env.file, env_target_path))
else:
Expand Down
3 changes: 3 additions & 0 deletions snakemake/sourcecache.py
Expand Up @@ -87,6 +87,9 @@ class LocalSourceFile(SourceFile):
def __init__(self, path):
self.path = path

def __fspath__(self):
return self.path

def get_path_or_uri(self):
return self.path

Expand Down
10 changes: 10 additions & 0 deletions tests/test_github_issue1210/Snakefile
@@ -0,0 +1,10 @@
rule all:
input: "python-version.txt"

rule py_emit_version:
output: "python-version.txt"
conda: "envs/py39.yaml"
shell:
"""
python -VV > {output}
"""
6 changes: 6 additions & 0 deletions tests/test_github_issue1210/envs/py39.yaml
@@ -0,0 +1,6 @@
name: py39
channels:
- conda-forge
- nodefaults
dependencies:
- python=3.9
Empty file.
6 changes: 6 additions & 0 deletions tests/tests.py
Expand Up @@ -1320,3 +1320,9 @@ def test_github_issue1158():
dpath("test_github_issue1158"),
cluster="./qsub.py",
)

def test_github_issue1210():
run(
dpath("test_github_issue1210"),
containerize=True
)