diff --git a/.ci/jenkins/main-tools-py3/run_tests.sh b/.ci/jenkins/main-tools-py3/run_tests.sh
new file mode 100644
index 00000000000..442b15cdf2d
--- /dev/null
+++ b/.ci/jenkins/main-tools-py3/run_tests.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+./run_tests.sh --dockerize --python3 --db postgres --clean_pyc -main "$@"
diff --git a/.ci/jenkins/main-tools/run_tests.sh b/.ci/jenkins/main-tools/run_tests.sh
new file mode 100644
index 00000000000..8b9edccddec
--- /dev/null
+++ b/.ci/jenkins/main-tools/run_tests.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+./run_tests.sh --dockerize --db postgres --external_tmp --clean_pyc -main "$@"
diff --git a/lib/galaxy/datatypes/util/gff_util.py b/lib/galaxy/datatypes/util/gff_util.py
index e81296a8cf7..421a5886c75 100644
--- a/lib/galaxy/datatypes/util/gff_util.py
+++ b/lib/galaxy/datatypes/util/gff_util.py
@@ -188,7 +188,7 @@ class GFFReaderWrapper(NiceReaderWrapper):
if not self.seed_interval:
while not self.seed_interval:
try:
- self.seed_interval = GenomicIntervalReader.next(self)
+ self.seed_interval = super(GenomicIntervalReader, self).__next__()
except ParseError as e:
handle_parse_error(e)
# TODO: When no longer supporting python 2.4 use finally:
@@ -215,7 +215,7 @@ class GFFReaderWrapper(NiceReaderWrapper):
feature_intervals.append(self.seed_interval)
while True:
try:
- interval = GenomicIntervalReader.next(self)
+ interval = super(GenomicIntervalReader, self).__next__()
raw_size += len(self.current_line)
except StopIteration as e:
# No more intervals to read, but last feature needs to be
diff --git a/lib/galaxy/tools/util/maf_utilities.py b/lib/galaxy/tools/util/maf_utilities.py
index d3abbd9529d..b2c25abb38d 100644
--- a/lib/galaxy/tools/util/maf_utilities.py
+++ b/lib/galaxy/tools/util/maf_utilities.py
@@ -5,6 +5,7 @@ Provides wrappers and utilities for working with MAF files and alignments.
# Dan Blankenberg
from __future__ import print_function
+import functools
import logging
import os
import resource
@@ -655,7 +656,7 @@ def sort_block_components_by_block(block1, block2):
# orders the components in block1 by the index of the component in block2
# block1 must be a subset of block2
# occurs in-place
- return block1.components.sort(cmp=lambda x, y: block2.components.index(x) - block2.components.index(y))
+ return block1.components.sort(key=functools.cmp_to_key(lambda x, y: block2.components.index(x) - block2.components.index(y)))
def get_species_in_maf(maf_filename):
diff --git a/lib/galaxy/util/ucsc.py b/lib/galaxy/util/ucsc.py
index 1542542b95d..295fa4608ad 100644
--- a/lib/galaxy/util/ucsc.py
+++ b/lib/galaxy/util/ucsc.py
@@ -18,19 +18,22 @@ class UCSCOutWrapper(object):
def __iter__(self):
return self
- def next(self):
+ def __next__(self):
if self.lookahead is None:
- line = self.other.next()
+ line = next(self.other)
else:
line = self.lookahead
self.lookahead = None
if line.startswith("----------"):
- next_line = self.other.next()
+ next_line = next(self.other)
if next_line.startswith("Reached output limit"):
raise UCSCLimitException(next_line.strip())
else:
self.lookahead = next_line
return line
+ def next(self):
+ return self.__next__()
+
def readline(self):
return self.next()
diff --git a/test/functional/known_broken_tools.txt b/test/functional/known_broken_tools.txt
index 506709a36fb..a7914ac942e 100644
--- a/test/functional/known_broken_tools.txt
+++ b/test/functional/known_broken_tools.txt
@@ -1,11 +1,15 @@
# Deprecated, IUC provides same tool, kept for backwards compat?
Extract genomic DNA 1
-# Relies on data table, but data table not available
+# Relies on data table or loc file, but data table not available
Interval2Maf1
Interval2Maf_pairwise1
maf_stats1
Interval_Maf_Merged_Fasta2
+GeneBed_Maf_Fasta2
# No dependency available
hgv_lps
# Some weird parameter issue
maf_by_block_number1
+# Requires hg17.len to be present
+bed_to_bigBed
+wig_to_bigWig
diff --git a/tools/filters/bed_to_bigbed.xml b/tools/filters/bed_to_bigbed.xml
index fd8d0017c19..d09064e9b44 100644
--- a/tools/filters/bed_to_bigbed.xml
+++ b/tools/filters/bed_to_bigbed.xml
@@ -39,12 +39,12 @@
-
+
-
+
diff --git a/tools/filters/join.py b/tools/filters/join.py
index 75fd2af482a..e2094bc9b63 100644
--- a/tools/filters/join.py
+++ b/tools/filters/join.py
@@ -79,7 +79,7 @@ class SortedOffsets(OffsetList):
def __init__(self, indexed_filename, column, split=None):
OffsetList.__init__(self, os.stat(indexed_filename).st_size)
self.indexed_filename = indexed_filename
- self.indexed_file = open(indexed_filename, 'rb')
+ self.indexed_file = open(indexed_filename, 'r')
self.column = column
self.split = split
self.last_identifier = None
@@ -149,7 +149,7 @@ class SortedOffsets(OffsetList):
class OffsetIndex:
def __init__(self, filename, column, split=None, index_depth=3):
self.filename = filename
- self.file = open(filename, 'rb')
+ self.file = open(filename, 'r')
self.column = column
self.split = split
self._offsets = {}
@@ -243,7 +243,7 @@ class BufferedIndex:
def __init__(self, filename, column, split=None, buffer=1000000, index_depth=3):
self.index = OffsetIndex(filename, column, split, index_depth)
self.buffered_offsets = {}
- f = open(filename, 'rb')
+ f = open(filename, 'r')
offset = f.tell()
identified_offset_count = 1
while True:
@@ -296,9 +296,9 @@ def join_files(filename1, column1, filename2, column2, out_filename, split=None,
if fill_options is None:
fill_options = Bunch(fill_unjoined_only=True, file1_columns=None, file2_columns=None)
keep_headers_done = False
- out = open(out_filename, 'w+b')
+ out = open(out_filename, 'w')
index = BufferedIndex(filename2, column2, split, buffer, index_depth)
- for line1 in open(filename1, 'rb'):
+ for line1 in open(filename1, 'r'):
if keep_headers and not keep_headers_done:
header1 = line1
with open(filename2, 'r') as file2:
diff --git a/tools/filters/joinWrapper.py b/tools/filters/joinWrapper.py
index ad6ecb075bd..b308d46e968 100644
--- a/tools/filters/joinWrapper.py
+++ b/tools/filters/joinWrapper.py
@@ -53,7 +53,7 @@ def main():
if ret == 0:
cl = subprocess.Popen(["join", "--version"], stdout=subprocess.PIPE)
(stdout, _) = cl.communicate()
- version_line = stdout.split("\n")[0]
+ version_line = stdout.decode('utf-8').split("\n")[0]
(version, _) = version_line.split()[-1].split(".")
if int(version) >= 7:
flags = "--nocheck-order"
diff --git a/tools/filters/secure_hash_message_digest.py b/tools/filters/secure_hash_message_digest.py
index 16efe6bac88..f3b6ba7a2a1 100644
--- a/tools/filters/secure_hash_message_digest.py
+++ b/tools/filters/secure_hash_message_digest.py
@@ -29,19 +29,18 @@ def __main__():
assert options.input, "You must provide an input filename."
assert options.output, "You must provide an output filename."
- input = open(options.input)
- while True:
- chunk = input.read(CHUNK_SIZE)
- if chunk:
- for algorithm in algorithms.values():
- algorithm.update(chunk)
- else:
- break
+ with open(options.input, 'rb') as fh:
+ while True:
+ chunk = fh.read(CHUNK_SIZE)
+ if chunk:
+ for algorithm in algorithms.values():
+ algorithm.update(chunk)
+ else:
+ break
- output = open(options.output, 'wb')
- output.write('#%s\n' % ('\t'.join(algorithms.keys())))
- output.write('%s\n' % ('\t'.join(x.hexdigest() for x in algorithms.values())))
- output.close()
+ with open(options.output, 'w') as output:
+ output.write('#%s\n' % ('\t'.join(algorithms.keys())))
+ output.write('%s\n' % ('\t'.join(x.hexdigest() for x in algorithms.values())))
if __name__ == "__main__":
diff --git a/tools/filters/sff_extractor.xml b/tools/filters/sff_extractor.xml
index 2beb7548b21..d26b6e5ca2e 100644
--- a/tools/filters/sff_extractor.xml
+++ b/tools/filters/sff_extractor.xml
@@ -1,9 +1,12 @@