[med-svn] [Git][med-team/simka][master] 2 commits: Modify 2to3 patch to fix writing str / byte complaint

Shayan Doust gitlab at salsa.debian.org
Thu Sep 12 18:37:57 BST 2019



Shayan Doust pushed to branch master at Debian Med / simka


Commits:
3bd0ff7d by Shayan Doust at 2019-09-12T05:17:16Z
Modify 2to3 patch to fix writing str / byte complaint

- - - - -
110103a8 by Shayan Doust at 2019-09-12T05:18:08Z
Fix test paths
Tests referred to binaries within the working project directory and not the system

- - - - -


3 changed files:

- debian/patches/2to3.patch
- + debian/patches/fix_test_path.patch
- debian/patches/series


Changes:

=====================================
debian/patches/2to3.patch
=====================================
@@ -1,7 +1,7 @@
 Index: simka/simkaMin/simkaMin.py
 ===================================================================
---- simka.orig/simkaMin/simkaMin.py	2019-09-12 04:15:09.951278183 +0100
-+++ simka/simkaMin/simkaMin.py	2019-09-12 04:15:39.035180723 +0100
+--- simka.orig/simkaMin/simkaMin.py	2019-09-12 06:14:44.083241551 +0100
++++ simka/simkaMin/simkaMin.py	2019-09-12 06:14:44.075241578 +0100
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
@@ -25,8 +25,8 @@ Index: simka/simkaMin/simkaMin.py
 +print(("Result dir: " + args.out))
 Index: simka/simkaMin/simkaMin_update.py
 ===================================================================
---- simka.orig/simkaMin/simkaMin_update.py	2019-09-12 04:15:09.951278183 +0100
-+++ simka/simkaMin/simkaMin_update.py	2019-09-12 04:15:49.975144063 +0100
+--- simka.orig/simkaMin/simkaMin_update.py	2019-09-12 06:14:44.083241551 +0100
++++ simka/simkaMin/simkaMin_update.py	2019-09-12 06:14:44.079241565 +0100
 @@ -1,4 +1,4 @@
 -#!/usr/bin/env python
 +#!/usr/bin/python3
@@ -48,3 +48,16 @@ Index: simka/simkaMin/simkaMin_update.py
  print("\n\n")
 -print("Result dir: " + existingDir)
 +print(("Result dir: " + existingDir))
+Index: simka/tests/simple_test.py
+===================================================================
+--- simka.orig/tests/simple_test.py	2019-09-12 06:14:44.039241699 +0100
++++ simka/tests/simple_test.py	2019-09-12 06:15:23.251110325 +0100
+@@ -18,7 +18,7 @@
+ 	for filename_gz in result_filenames:
+ 		#filename_gz = result_dir + "/" + filename
+ 		with gzip.open(filename_gz, 'rb') as f:
+-			outFile = open(filename_gz[:-3], "w")
++			outFile = open(filename_gz[:-3], "wb")
+ 			outFile.write(f.read())
+ 			outFile.close()
+ 			os.remove(filename_gz)


=====================================
debian/patches/fix_test_path.patch
=====================================
@@ -0,0 +1,121 @@
+Index: simka/tests/simkaMin/test_simkaMin.py
+===================================================================
+--- simka.orig/tests/simkaMin/test_simkaMin.py	2019-09-11 23:39:55.656682381 +0100
++++ simka/tests/simkaMin/test_simkaMin.py	2019-09-12 06:10:03.252182437 +0100
+@@ -48,7 +48,7 @@
+             for nb_reads in NB_READS:
+                 for nb_kmers in NB_KMERS:
+                     for nb_cores in NB_CORES:
+-                        command, outputDir = create_command("../../simkaMin/simkaMin.py", "truth_simkaMin", k, filter, nb_reads, nb_kmers, nb_cores, " ../../example/simka_input.txt ")
++                        command, outputDir = create_command("simkaMin", "truth_simkaMin", k, filter, nb_reads, nb_kmers, nb_cores, " ../../example/simka_input.txt ")
+                         print (command)
+                         ret = os.system(command)
+                         if ret != 0: exit(1)
+@@ -146,7 +146,7 @@
+             for nb_reads in NB_READS:
+                 for nb_kmers in NB_KMERS:
+                     for nb_cores in NB_CORES:
+-                        command, outputDir = create_command("../../simkaMin/simkaMin.py", dir, k, filter, nb_reads, nb_kmers, nb_cores, " ../../example/simka_input.txt ")
++                        command, outputDir = create_command("simkaMin", dir, k, filter, nb_reads, nb_kmers, nb_cores, " ../../example/simka_input.txt ")
+                         print (command)
+                         ret = os.system(command + suffix)
+                         if ret != 0: exit(1)
+@@ -179,14 +179,14 @@
+         f.close()
+ 
+         sketch_filename = os.path.join(out_dir, "sketch.bin")
+-        command = "../../build/bin/simkaMinCore sketch -in " + filename_temp + " -out " + sketch_filename + " -nb-kmers 100 -kmer-size 21 -nb-cores 4"
++        command = "simkaMinCore sketch -in " + filename_temp + " -out " + sketch_filename + " -nb-kmers 100 -kmer-size 21 -nb-cores 4"
+         print(command)
+         ret = os.system(command + suffix)
+         if ret != 0: exit(1)
+ 
+ 
+         if os.path.exists(merged_sketch_filename):
+-            command = "../../build/bin/simkaMinCore append -in1 " + merged_sketch_filename + " -in2 " + sketch_filename
++            command = "simkaMinCore append -in1 " + merged_sketch_filename + " -in2 " + sketch_filename
+             print(command)
+             ret = os.system(command + suffix)
+             if ret != 0: exit(1)
+@@ -196,12 +196,12 @@
+ 
+         os.remove(filename_temp)
+ 
+-    command = "../../build/bin/simkaMinCore distance -in1 " +  merged_sketch_filename + " -in2 " + merged_sketch_filename + " -out " + dir + " -nb-cores 4 "
++    command = "simkaMinCore distance -in1 " +  merged_sketch_filename + " -in2 " + merged_sketch_filename + " -out " + dir + " -nb-cores 4 "
+     print(command)
+     ret = os.system(command + suffix)
+     if ret != 0: exit(1)
+ 
+-    command = "../../build/bin/simkaMinCore export -in " + dir + " -in1 " +  merged_sketch_filename + " -in2 " + merged_sketch_filename + " -out " + dir
++    command = "simkaMinCore export -in " + dir + " -in1 " +  merged_sketch_filename + " -in2 " + merged_sketch_filename + " -out " + dir
+     print(command)
+     ret = os.system(command + suffix)
+     if ret != 0: exit(1)
+@@ -237,12 +237,12 @@
+         f.close()
+ 
+         if init:
+-            command, outputDir = create_command_update("../../simkaMin/simkaMin_update.py", out_dir, 21, "", 0, 100, 4, filename_temp)
++            command, outputDir = create_command_update("simkaMin_update", out_dir, 21, "", 0, 100, 4, filename_temp)
+             print(command)
+             ret = os.system(command + suffix)
+             if ret != 0: exit(1)
+         else:
+-            command, outputDir = create_command("../../simkaMin/simkaMin.py", out_dir, 21, "", 0, 100, 4, filename_temp)
++            command, outputDir = create_command("simkaMin", out_dir, 21, "", 0, 100, 4, filename_temp)
+             print(command)
+             ret = os.system(command + suffix)
+             if ret != 0: exit(1)
+Index: simka/tests/simple_test.py
+===================================================================
+--- simka.orig/tests/simple_test.py	2019-09-11 23:39:55.668682342 +0100
++++ simka/tests/simple_test.py	2019-09-12 06:14:31.939282238 +0100
+@@ -91,7 +91,7 @@
+ #test k=31 t=0
+ clear()
+ print("TESTING k=31 t=0")
+-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k31_t0 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 31 -abundance-min 0 -verbose 0"
++command = "/usr/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k31_t0 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 31 -abundance-min 0 -verbose 0"
+ print(command)
+ os.system(command + suffix)
+ test_dists("results_k31_t0")
+@@ -99,7 +99,7 @@
+ #test k=21 t=0
+ clear()
+ print("TESTING k=21 t=0")
+-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k21_t0 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -verbose 0"
++command = "/usr/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k21_t0 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -verbose 0"
+ print(command)
+ os.system(command + suffix)
+ test_dists("results_k21_t0")
+@@ -107,7 +107,7 @@
+ #test k=31 t=2
+ clear()
+ print("TESTING k=31 t=2")
+-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k31_t2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 31 -abundance-min 2 -verbose 0"
++command = "/usr/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k31_t2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 31 -abundance-min 2 -verbose 0"
+ print(command)
+ os.system(command + suffix)
+ test_dists("results_k31_t2")
+@@ -115,7 +115,7 @@
+ #test k=21 t=2
+ clear()
+ print("TESTING k=21 t=2")
+-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k21_t2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 2 -verbose 0"
++command = "/usr/bin/simka -in ../example/simka_input.txt -out ./__results__/results_k21_t2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 2 -verbose 0"
+ print(command)
+ os.system(command + suffix)
+ test_dists("results_k21_t2")
+@@ -123,9 +123,9 @@
+ #test resources 1
+ clear()
+ print("TESTING parallelization")
+-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_resources1 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -nb-cores 20 -max-memory 4000  -verbose 0"
++command = "/usr/bin/simka -in ../example/simka_input.txt -out ./__results__/results_resources1 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -nb-cores 20 -max-memory 4000  -verbose 0"
+ os.system(command + suffix)
+-command = "../build/bin/simka -in ../example/simka_input.txt -out ./__results__/results_resources2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -nb-cores 2 -max-memory 2000  -verbose 0"
++command = "/usr/bin/simka -in ../example/simka_input.txt -out ./__results__/results_resources2 -out-tmp ./temp_output -simple-dist -complex-dist -kmer-size 21 -abundance-min 0 -nb-cores 2 -max-memory 2000  -verbose 0"
+ os.system(command + suffix)
+ test_parallelization()
+ 


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
+fix_test_path.patch
 2to3.patch
 use_debian_packaged_libraries.patch



View it on GitLab: https://salsa.debian.org/med-team/simka/compare/54405f07fed643180d6d169755d68ebcf2d0868b...110103a80b7587f42fa69c4cf3a921a912150851

-- 
View it on GitLab: https://salsa.debian.org/med-team/simka/compare/54405f07fed643180d6d169755d68ebcf2d0868b...110103a80b7587f42fa69c4cf3a921a912150851
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190912/07703d65/attachment-0001.html>


More information about the debian-med-commit mailing list