Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Windows file separator issues (#1037)
* Change conda tests so they can run on Windows This changes the BWA commandline tool used in the tests to an other small small command line tool called 'melt'. It makes the test a bit slower since the 'melt' tool also depends on Python. But I couldn't find a small cross platform tool on bioconda which could be used for the tests. * Wrap urlparse in a version which also works on Windows It seems like snakemake uses urlparse to distinguish between URI's and paths. That 'undocumented' feature doesn't work with windows paths. So here we wrap urlparse in snakemake.utils and add some code which adds this 'feature' for windows paths. * Only use argvquote on Win when cmd.exe is the shell This changes utils.format function a bit by exposing the quote_func arguments of QuotedFormatter. * Add test for conda when using cmd.exe as shell * Fix various issues with conda support on Win * New black version * Ignore errors in cleanup when testing on CI server On windows we got : PermissionError: [WinError 5] Access is denied: 'C:\\...\\vcruntime140.dll * Use smart_open instead of urllib's urlparse * Fail gracefully when a scheme is not implemented by smart_open * Add tests which show file seperator problems on windows The test show how the input/output with mixed fileseperators cause problems. The test also show bug #46 where targets in subfolder can't be generated. * Fixes filesep issues on windows Input/output file are internally converted to forward slashes before used by snakemake. Target files from the command line are also converted internally. * Add functions to modify subclassed strings * Enable more tests Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>
- Loading branch information
1 parent
2998a0c
commit cd5c58d
Showing
9 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
shell.executable("bash") | ||
|
||
rule all: | ||
input: | ||
"some_dir/final", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
#shell.executable("bash") | ||
|
||
# This tests that snakemake handles input/output | ||
# defined with both forward and backwards slashes | ||
# on Windows. | ||
|
||
rule all: | ||
input: | ||
expand("subfolder\\test{i}.out2", i=range(3)) | ||
|
||
rule a: | ||
output: | ||
"subfolder\\test{i}.out" | ||
shell: | ||
'echo hello > {output}' | ||
|
||
|
||
rule b: | ||
input: | ||
"subfolder\\test{i}.out" | ||
output: | ||
"subfolder/test{i}.out2" | ||
shell: | ||
"echo world> {output}" |
1 change: 1 addition & 0 deletions
1
tests/test_filesep_windows/expected-results/subfolder/test2.out2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
world |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters