File: remove_six.patch

package info (click to toggle)
mirtop 0.4.30-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,828 kB
  • sloc: python: 6,649; sh: 47; makefile: 22
file content (71 lines) | stat: -rw-r--r-- 2,252 bytes parent folder | download
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--- a/mirtop/exporter/vcf.py
+++ b/mirtop/exporter/vcf.py
@@ -4,7 +4,6 @@
 import sys
 import os.path as op
 
-import six
 
 from mirtop.mirna.fasta import read_precursor
 from mirtop.mirna.mapper import read_gtf_to_precursor, read_gtf_to_mirna
@@ -133,14 +132,12 @@
     """
     #Check if the input files exist:
     try:
-        gff3_file = open(mirgff3, "r", encoding="utf-8") if six.PY3 else open(mirgff3, "r")
+        gff3_file = open(mirgff3, "r", encoding="utf-8")
     except IOError:
         print ("Can't read the file", end=mirgff3)
         sys.exit()
     with gff3_file:
         data = gff3_file.read()
-        if six.PY2:
-            data = data.decode("utf-8-sig").encode("utf-8")
 
     gff3_data = data.split("\n")
     vcf_file = open(vcffile, "w")
--- a/mirtop/libs/do.py
+++ b/mirtop/libs/do.py
@@ -5,7 +5,6 @@
 import subprocess
 import logging
 
-import six
 
 
 logger = logging.getLogger("run")
@@ -16,7 +15,7 @@
     """Run the provided command, logging details and checking for errors.
     """
     try:
-        logger.debug(" ".join(str(x) for x in cmd) if not isinstance(cmd, six.string_types) else cmd)
+        logger.debug(" ".join(str(x) for x in cmd) if not isinstance(cmd, str) else cmd)
         _do_run(cmd, checks, log_stdout)
     except:
         if log_error:
@@ -44,7 +43,7 @@
     Piped commands set pipefail and require use of bash to help with debugging
     intermediate errors.
     """
-    if isinstance(cmd, six.string_types):
+    if isinstance(cmd, str):
         # check for standard or anonymous named pipes
         if cmd.find(" | ") > 0 or cmd.find(">(") or cmd.find("<("):
             return "set -o pipefail; " + cmd, True, find_bash()
@@ -74,7 +73,7 @@
             for line in s.stdout:
                 debug_stdout.append(line)
             if exitcode is not None and exitcode != 0:
-                error_msg = " ".join(cmd) if not isinstance(cmd, six.string_types) else cmd
+                error_msg = " ".join(cmd) if not isinstance(cmd, str) else cmd
                 error_msg += "\n"
                 error_msg += "".join(debug_stdout)
                 s.communicate()
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,5 +3,4 @@
 pandas
 biopython
 pyyaml
-six
 pytest