File: 0002_use_debian_packaged_python-joblib.patch

package info (click to toggle)
spades 4.0.0%2Breally3.15.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 97,372 kB
  • sloc: cpp: 850,755; ansic: 156,813; python: 23,134; perl: 4,547; sh: 2,349; makefile: 1,273; java: 890; pascal: 875; xml: 19
file content (34 lines) | stat: -rw-r--r-- 1,450 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Author: Andreas Tille <tille@debian.org>
Last-Changed: Tue, 03 Mar 2015 20:55:53 +0100
Forwarded: not-needed
Description: We are using Debian packaged python-joblib
 Debian has its own way to distinguish Python versions and there is no point
 in doing this inside the code.
 .
 The patch is non-intrusive since it conserves the original code and uses
 Debian pyyaml only if the original method fails.

--- a/assembler/src/spades_pipeline/scripts/compress_all.py
+++ b/assembler/src/spades_pipeline/scripts/compress_all.py
@@ -28,12 +28,15 @@ def remove_not_corrected_reads(output_di
 def compress_dataset_files(input_file, ext_python_modules_home, max_threads, log, not_used_yaml_file, output_dir,
                            gzip_output):
     addsitedir(ext_python_modules_home)
-    if sys.version.startswith("2."):
-        import pyyaml2 as pyyaml
-        from joblib2 import Parallel, delayed
-    elif sys.version.startswith("3."):
-        import pyyaml3 as pyyaml
-        from joblib3 import Parallel, delayed
+    try:
+        if sys.version.startswith("2."):
+            import pyyaml2 as pyyaml
+            from joblib2 import Parallel, delayed
+        elif sys.version.startswith("3."):
+            import pyyaml3 as pyyaml
+            from joblib3 import Parallel, delayed
+    except:
+        from joblib import Parallel, delayed
 
     dataset_data = pyyaml.load(open(input_file))
     remove_not_corrected_reads(output_dir)