From 42a461353bc2dd07f60daf33a42e6d45ec7c86a8 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 21 Dec 2016 12:56:17 -0500 Subject: [PATCH 1/5] Fix linting of 16.07 broken with security patches. --- tools/filters/gff/gff_filter_by_attribute.py | 4 +++- tools/filters/gff/gff_filter_by_feature_count.py | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/filters/gff/gff_filter_by_attribute.py b/tools/filters/gff/gff_filter_by_attribute.py index cd6600cf916..3d4319bc152 100644 --- a/tools/filters/gff/gff_filter_by_attribute.py +++ b/tools/filters/gff/gff_filter_by_attribute.py @@ -6,8 +6,9 @@ from __future__ import division import sys -from json import loads + from ast import Module, parse, walk +from json import loads AST_NODE_TYPE_WHITELIST = [ 'Expr', 'Load', 'Str', 'Num', 'BoolOp', 'Compare', 'And', 'Eq', 'NotEq', @@ -152,6 +153,7 @@ def check_expression( text ): return True + # # Helper functions. # diff --git a/tools/filters/gff/gff_filter_by_feature_count.py b/tools/filters/gff/gff_filter_by_feature_count.py index 778527972bc..d0e65caa9f5 100644 --- a/tools/filters/gff/gff_filter_by_feature_count.py +++ b/tools/filters/gff/gff_filter_by_feature_count.py @@ -5,12 +5,15 @@ Filter a gff file using a criterion based on feature counts for a transcript. Usage: %prog input_name output_name feature_name condition """ +from __future__ import print_function + import sys +from ast import Module, parse, walk + from bx.intervals.io import GenomicInterval from galaxy.datatypes.util.gff_util import GFFReaderWrapper -from ast import Module, parse, walk AST_NODE_TYPE_WHITELIST = [ 'Expr', 'Load', 'Str', 'Num', 'BoolOp', 'Compare', 'And', 'Eq', 'NotEq', @@ -137,7 +140,7 @@ def __main__(): except: number = None if empty != "" or not number: - print >> sys.stderr, "Invalid condition: %s, cannot filter." % condition + print("Invalid condition: %s, cannot filter." % condition, file=sys.stderr) return break @@ -173,7 +176,7 @@ def __main__(): ( kept_features, i, float(kept_features) / i * 100.0, feature_name + condition ) if skipped_lines > 0: info_msg += "Skipped %d blank/comment/invalid lines starting with line #%d." % ( skipped_lines, first_skipped_line ) - print info_msg + print(info_msg) if __name__ == "__main__": __main__() From 69fe5ae83ae53cb84a2d0bdd9ea53389b8af5a3a Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 21 Dec 2016 12:56:56 -0500 Subject: [PATCH 2/5] Fix 16.07 linting of imports broken with release of flake8-import-order 0.11. This is pinned to 0.11 in release_16.10 and unpinned in dev, when merging forward keep these "forward" branches the same (i.e. do not revert to flake8-import-order 0.10). --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 561d0637f5d..c4822638555 100644 --- a/tox.ini +++ b/tox.ini @@ -41,7 +41,7 @@ whitelist_externals = bash skip_install = True deps = flake8 - flake8-import-order>=0.9 + flake8-import-order==0.9 [testenv:py27-lint-imports-include-list] commands = bash .ci/flake8_wrapper_imports.sh @@ -49,7 +49,7 @@ whitelist_externals = bash skip_install = True deps = flake8==3.0.4 - flake8-import-order>=0.9 + flake8-import-order==0.9 [testenv:qunit] commands = bash run_tests.sh -q From 3d155f0be0c91dbfe891394261c08922f75f3f17 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 16 Nov 2016 12:24:28 -0500 Subject: [PATCH 3/5] Fix history list selector --- config/plugins/tours/core.history.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/config/plugins/tours/core.history.yaml b/config/plugins/tours/core.history.yaml index cb4bf349bb0..5e0e28f59f6 100644 --- a/config/plugins/tours/core.history.yaml +++ b/config/plugins/tours/core.history.yaml @@ -54,42 +54,42 @@ steps: - "div.title-bar.clear:eq(0)" - title: "Metadata" - element: "#current-history-panel > div.list-items > div:nth-child(1) > div.details > div.summary > div.datatype > label" + element: "#current-history-panel > ul.list-items > div:nth-child(1) > div.details > div.summary > div.datatype > label" intro: "Galaxy has assigned a datatype to your dataset during upload, which you can see here." position: "left" - - element: "#current-history-panel > div.list-items > div:nth-child(1) > div.details > div.actions.clear > div.left > a.download-btn.icon-btn" + - element: "#current-history-panel > ul.list-items > div:nth-child(1) > div.details > div.actions.clear > div.left > a.download-btn.icon-btn" title: "Download your dataset" intro: "You can download every dataset by using the floppy disc symbol." position: "left" - - element: "#current-history-panel > div.list-items > div:nth-child(1) > div.details > div.actions.clear > div.left > a.icon-btn.params-btn" + - element: "#current-history-panel > ul.list-items > div:nth-child(1) > div.details > div.actions.clear > div.left > a.icon-btn.params-btn" title: "Even more information" intro: "Get an overview of all metadata associated with your dataset by using the Information symbol." position: "left" preclick: - - "#current-history-panel > div.list-items > div:nth-child(1) > div.details > div.actions.clear > div.left > a.icon-btn.params-btn" + - "#current-history-panel > ul.list-items > div:nth-child(1) > div.details > div.actions.clear > div.left > a.icon-btn.params-btn" - - element: "#current-history-panel > div.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.display-btn" + - element: "#current-history-panel > ul.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.display-btn" title: "Inspect your data" intro: "The eye symbol can be used to look at your data." position: "left" preclick: - - "#current-history-panel > div.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.display-btn" + - "#current-history-panel > ul.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.display-btn" - - element: "#current-history-panel > div.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.edit-btn" + - element: "#current-history-panel > ul.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.edit-btn" title: "Edit metadata" intro: "With the pencil button you can edit metadata attributes of your dataset, like the associated filetype or the dataset name." position: "left" preclick: - - "#current-history-panel > div.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.edit-btn" + - "#current-history-panel > ul.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.edit-btn" - - element: "#current-history-panel > div.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.delete-btn" + - element: "#current-history-panel > ul.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.delete-btn" title: "Remove datasets" intro: "You can remove a dataset from the history with the cross symbol." position: "left" postclick: - - "#current-history-panel > div.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.delete-btn" + - "#current-history-panel > ul.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.delete-btn" - element: "#current-history-panel > div.controls > div.subtitle > a" title: "Include all deleted datasets" @@ -98,14 +98,14 @@ steps: postclick: - "#current-history-panel > div.controls > div.subtitle > a" - - element: "#current-history-panel > div.list-items > div:nth-child(1) > div.warnings > div > a" + - element: "#current-history-panel > ul.list-items > div:nth-child(1) > div.warnings > div > a" title: "Undeleting a dataset" intro: | Galaxy datasets are only marked as deleled and can be recovered by clicking this link. Please note that datasets marked as deleted can be purged by your administrator at any time. position: "bottom" postclick: - - "#current-history-panel > div.list-items > div:nth-child(1) > div.warnings > div > a" + - "#current-history-panel > ul.list-items > div:nth-child(1) > div.warnings > div > a" - element: "#current-history-panel > div.controls > div.subtitle > a" title: "Hiding all deleted datasets" From b57a961f250968d6d62eff142b4ee6e046085fda Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 21 Dec 2016 21:48:23 -0500 Subject: [PATCH 4/5] Merge changes fixing tour from dev commit 10720fa4f9e26b3feec1a90468f4ecc726a99c05 Cannot do a full cherry-pick because the test modified did not exist in 16.10. --- config/plugins/tours/core.history.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/plugins/tours/core.history.yaml b/config/plugins/tours/core.history.yaml index 5e0e28f59f6..3a0e84059f6 100644 --- a/config/plugins/tours/core.history.yaml +++ b/config/plugins/tours/core.history.yaml @@ -91,12 +91,12 @@ steps: postclick: - "#current-history-panel > ul.list-items > div:nth-child(1) > div.primary-actions > a.icon-btn.delete-btn" - - element: "#current-history-panel > div.controls > div.subtitle > a" + - element: "#current-history-panel > .controls > .subtitle .toggle-deleted-link" title: "Include all deleted datasets" intro: "By default your history will hide all deleted datasets from you. You can visualize them by toggling this button." position: "bottom" postclick: - - "#current-history-panel > div.controls > div.subtitle > a" + - "#current-history-panel > .controls > .subtitle .toggle-deleted-link" - element: "#current-history-panel > ul.list-items > div:nth-child(1) > div.warnings > div > a" title: "Undeleting a dataset" @@ -107,12 +107,12 @@ steps: postclick: - "#current-history-panel > ul.list-items > div:nth-child(1) > div.warnings > div > a" - - element: "#current-history-panel > div.controls > div.subtitle > a" + - element: "#current-history-panel > div.controls > .subtitle .toggle-deleted-link" title: "Hiding all deleted datasets" intro: "Hiding datasets that were previously deleted works in the same way." position: "bottom" preclick: - - "#current-history-panel > div.controls > div.subtitle > a" + - "#current-history-panel > div.controls > .subtitle .toggle-deleted-link" - element: "#current-history-panel > div.controls > div.title > div" title: "Change your History name" From c3687114d6f2f14df49af9a3fee6dbebe08aa7e5 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 5 Jan 2017 09:07:16 -0500 Subject: [PATCH 5/5] Set metadata on HDAs from dynamically discovered collections. With test case that previously failed. Fixes #3267. --- lib/galaxy/tools/parameters/output_collect.py | 3 +++ test/api/test_tools.py | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tools/parameters/output_collect.py b/lib/galaxy/tools/parameters/output_collect.py index 1fb52296c77..60875c0fae6 100644 --- a/lib/galaxy/tools/parameters/output_collect.py +++ b/lib/galaxy/tools/parameters/output_collect.py @@ -205,6 +205,9 @@ class JobContext( object ): else: primary_data.init_meta() + primary_data.set_meta() + primary_data.set_peek() + return primary_data diff --git a/test/api/test_tools.py b/test/api/test_tools.py index 82e310b06a9..672e6ff9960 100644 --- a/test/api/test_tools.py +++ b/test/api/test_tools.py @@ -465,10 +465,14 @@ class ToolsTestCase( api.ApiTestCase ): output_collection = get_collection_response.json() self._assert_has_keys( output_collection, "id", "name", "elements", "populated" ) assert output_collection[ "populated" ] - assert len( output_collection[ "elements" ] ) == 2 self.assertEquals( output_collection[ "name" ], "Table split on first column" ) - # TODO: verify element identifiers + assert len( output_collection[ "elements" ] ) == 2 + output_element_0 = output_collection["elements"][0] + assert output_element_0["element_index"] == 0 + assert output_element_0["element_identifier"] == "samp1" + output_element_hda_0 = output_element_0["object"] + assert output_element_hda_0["metadata_column_types"] is not None @skip_without_tool( "cat1" ) def test_run_cat1_with_two_inputs( self ):