diff --git a/.ci/validate_test_tools.sh b/.ci/validate_test_tools.sh
index 9b43e7a6c46..258799dc95d 100755
--- a/.ci/validate_test_tools.sh
+++ b/.ci/validate_test_tools.sh
@@ -1,11 +1,11 @@
#!/bin/sh
-cd `dirname $0`/..
+cd "$(dirname "$0")"/..
xsd_path="lib/galaxy/tools/xsd/galaxy.xsd"
# Lint the XSD
xmllint --noout "$xsd_path"
test_tools_path='test/functional/tools'
-tool_files_list=$(ls "$test_tools_path"/*xml | grep -v '_conf.xml$')
+tool_files_list=$(ls "$test_tools_path"/*.xml | grep -v '_conf.xml$')
sh scripts/validate_tools.sh $tool_files_list
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 01b3105991a..32dfbce7036 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -25,7 +25,7 @@ variables:
jobs:
get_code:
docker:
- - image: circleci/python:2.7.15
+ - image: circleci/python:3.5
<<: *set_workdir
steps:
# Replace standard code checkout with shallow clone to speed things up.
@@ -83,7 +83,7 @@ jobs:
- ~/repo
py27_lint:
docker:
- - image: circleci/python:2.7.15
+ - image: circleci/python:2.7
<<: *set_workdir
steps:
- *restore_repo_cache
@@ -91,7 +91,7 @@ jobs:
- run: tox -e py27-lint
py27_unit:
docker:
- - image: circleci/python:2.7.15
+ - image: circleci/python:2.7
<<: *set_workdir
steps:
- *restore_repo_cache
@@ -99,7 +99,7 @@ jobs:
- run: tox -e py27-unit
py27_docstring:
docker:
- - image: circleci/python:2.7.15
+ - image: circleci/python:2.7
<<: *set_workdir
steps:
- *restore_repo_cache
@@ -107,7 +107,7 @@ jobs:
- run: tox -e py27-lint_docstring_include_list
py27_first_startup:
docker:
- - image: circleci/python:2.7.15
+ - image: circleci/python:2.7
<<: *set_workdir
steps:
- *restore_repo_cache
@@ -139,14 +139,14 @@ jobs:
<<: *set_workdir
steps:
- *restore_repo_cache
- - *install_tox
- run: sudo apt-get update
# For uwsgi
- run: sudo apt-get install -y libpython3.5-dev
+ - *install_tox
- run: tox -e py35-first_startup
validate_test_tools:
docker:
- - image: circleci/python:2.7.15
+ - image: circleci/python:3.5
<<: *set_workdir
steps:
- *restore_repo_cache
@@ -154,9 +154,17 @@ jobs:
- run: sudo apt-get install -y libxml2-utils
- *install_tox
- run: tox -e validate_test_tools
+ test_galaxy_packages:
+ docker:
+ - image: circleci/python:3.5
+ <<: *set_workdir
+ steps:
+ - *restore_repo_cache
+ - *install_tox
+ - run: tox -e test_galaxy_packages
check_py3_compatibility:
docker:
- - image: circleci/python:2.7.15
+ - image: circleci/python:3.5
<<: *set_workdir
steps:
- *restore_repo_cache
@@ -202,6 +210,8 @@ workflows:
<<: *requires_get_code
- py35_first_startup:
<<: *requires_get_code
+ - test_galaxy_packages:
+ <<: *requires_get_code
- validate_test_tools:
<<: *requires_get_code
- check_py3_compatibility:
diff --git a/client/galaxy/scripts/bundleEntries.js b/client/galaxy/scripts/bundleEntries.js
index c666d664310..0390749fb83 100644
--- a/client/galaxy/scripts/bundleEntries.js
+++ b/client/galaxy/scripts/bundleEntries.js
@@ -79,6 +79,7 @@ export function multiHistory(options) {
export { default as panels } from "layout/panel";
export { show_in_overlay, hide_modal, show_message, show_modal, Modal } from "layout/modal";
export { make_popupmenu, make_popup_menus } from "ui/popupmenu";
+export { render_embedded_items } from "mvc/embedded-objects";
export { default as async_save_text } from "utils/async-save-text";
// Previously "chart"
diff --git a/client/galaxy/scripts/components/PageEditor/PageEditor.vue b/client/galaxy/scripts/components/PageEditor/PageEditor.vue
new file mode 100644
index 00000000000..f589b15e23a
--- /dev/null
+++ b/client/galaxy/scripts/components/PageEditor/PageEditor.vue
@@ -0,0 +1,38 @@
+
+
+
+
${
- WYMeditor.TOOLS
- } |
${
- // + WYMeditor.HTML
- WYMeditor.IFRAME
- }${WYMeditor.STATUS} |
,
+ tag='pre', attrs=[('class', 'screen')]
+ """
+
+ # If ignoring content, just increment tag count and ignore.
+ if self.ignore_content:
+ self.num_open_tags_for_ignore += 1
+ return
+
+ # Not ignoring tag; look for embedded content.
+ embedded_item = False
+ for attribute in attrs:
+ if (attribute[0] == "class") and ("embedded-item" in attribute[1].split(" ")):
+ embedded_item = True
+ break
+ # For embedded content, set ignore flag to ignore current content and add new content for embedded item.
+ if embedded_item:
+ # Set processing attributes to ignore content.
+ self.ignore_content = True
+ self.num_open_tags_for_ignore = 1
+
+ # Insert content for embedded element.
+ for attribute in attrs:
+ name = attribute[0]
+ if name == "id":
+ # ID has form '-'
+ item_class, item_id = attribute[1].split("-")
+ embed_html = self.render_embed_html_fn(self.trans, item_class, item_id)
+ self.pieces.append(embed_html)
+ return
+
+ # Default behavior: not ignoring and no embedded content.
+ uattrs = []
+ strattrs = ''
+ if attrs:
+ for key, value in attrs:
+ value = value.replace('>', '>').replace('<', '<').replace('"', '"')
+ value = self.bare_ampersand.sub("&", value)
+ uattrs.append((key, value))
+ strattrs = ''.join(' %s="%s"' % (k, v) for k, v in uattrs)
+ if tag in self.elements_no_end_tag:
+ self.pieces.append('<%s%s />' % (tag, strattrs))
+ else:
+ self.pieces.append('<%s%s>' % (tag, strattrs))
+
+ def handle_endtag(self, tag):
+ """
+ Called for each end tag
+
+ E.g. for , tag will be 'pre'
+ """
+ # If ignoring content, see if current tag is the end of content to ignore.
+ if self.ignore_content:
+ self.num_open_tags_for_ignore -= 1
+ if self.num_open_tags_for_ignore == 0:
+ # Done ignoring content.
+ self.ignore_content = False
+ return
+
+ # Default behavior: reconstruct the original end tag.
+ if tag not in self.elements_no_end_tag:
+ self.pieces.append("%s>" % tag)
+
+ def handle_charref(self, ref):
+ # called for each character reference, e.g. for ' ', ref will be '160'
+ # Reconstruct the original character reference.
+ ref = ref.lower()
+ if ref.startswith('x'):
+ value = int(ref[1:], 16)
+ else:
+ value = int(ref)
+
+ if value in _cp1252:
+ self.pieces.append('%s;' % hex(ord(_cp1252[value]))[1:])
+ else:
+ self.pieces.append('%s;' % ref)
+
+ def handle_entityref(self, ref):
+ # called for each entity reference, e.g. for '©', ref will be 'copy'
+ # Reconstruct the original entity reference.
+ if ref in name2codepoint or ref == 'apos':
+ self.pieces.append('&%s;' % ref)
+ else:
+ self.pieces.append('&%s' % ref)
+
+ def handle_data(self, text):
+ """
+ Called for each block of plain text
+
+ Called outside of any tag and not containing any character or entity
+ references. Store the original text verbatim.
+ """
+ if self.ignore_content:
+ return
+ self.pieces.append(text)
+
+ def handle_comment(self, text):
+ # called for each HTML comment, e.g.
+ # Reconstruct the original comment.
+ self.pieces.append('' % text)
+
+ def handle_decl(self, text):
+ # called for the DOCTYPE, if present, e.g.
+ #
+ # Reconstruct original DOCTYPE
+ self.pieces.append('' % text)
+
+ def handle_pi(self, text):
+ # called for each processing instruction, e.g.
+ # Reconstruct original processing instruction.
+ self.pieces.append('%s>' % text)
+
+ def output(self):
+ '''Return processed HTML as a single string'''
+ return ''.join(self.pieces)
+
+
+PAGE_MAXRAW = 10**15
+
+
+def get_page_identifiers(item_id, app):
+ # Assume if item id is integer and less than 10**15, it's unencoded.
+ try:
+ decoded_id = int(item_id)
+ if decoded_id >= PAGE_MAXRAW:
+ raise ValueError("Identifier larger than maximum expected raw int, must be already encoded.")
+ encoded_id = app.security.encode_id(item_id)
+ except ValueError:
+ # It's an encoded id.
+ encoded_id = item_id
+ decoded_id = base.decode_id(app, item_id)
+ return (encoded_id, decoded_id)
+
+
+# Utilities for encoding/decoding HTML content.
+PLACEHOLDER_TEMPLATE = ''''''
+
+# This is a mapping of the id portion of page contents to the cssclass/shortname.
+PAGE_CLASS_MAPPING = {
+ 'History': 'History',
+ 'HistoryDatasetAssociation': 'Dataset',
+ 'StoredWorkflow': 'Workflow',
+ 'Visualization': 'Visualization'
+}
+
+
+def placeholderRenderForEdit(trans, item_class, item_id):
+ return placeholderRenderForSave(trans, item_class, item_id, encode=True)
+
+
+def placeholderRenderForSave(trans, item_class, item_id, encode=False):
+ encoded_item_id, decoded_item_id = get_page_identifiers(item_id, trans.app)
+ item_name = ''
+ if item_class == 'History':
+ history = trans.sa_session.query(trans.model.History).get(decoded_item_id)
+ history = base.security_check(trans, history, False, True)
+ item_name = history.name
+ elif item_class == 'HistoryDatasetAssociation':
+ hda = trans.sa_session.query(trans.model.HistoryDatasetAssociation).get(decoded_item_id)
+ hda_manager = HDAManager(trans.app)
+ hda = hda_manager.get_accessible(decoded_item_id, trans.user)
+ item_name = hda.name
+ elif item_class == 'StoredWorkflow':
+ wf = trans.sa_session.query(trans.model.StoredWorkflow).get(decoded_item_id)
+ wf = base.security_check(trans, wf, False, True)
+ item_name = wf.name
+ elif item_class == 'Visualization':
+ visualization = trans.sa_session.query(trans.model.Visualization).get(decoded_item_id)
+ visualization = base.security_check(trans, visualization, False, True)
+ item_name = visualization.title
+ class_shorthand = PAGE_CLASS_MAPPING[item_class]
+ if encode:
+ item_id = encoded_item_id
+ else:
+ item_id = decoded_item_id
+ return PLACEHOLDER_TEMPLATE.format(
+ item_class=item_class,
+ class_shorthand=class_shorthand,
+ class_shorthand_lower=class_shorthand.lower(),
+ item_id=item_id,
+ item_name=item_name
+ )
diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py
index f37dda4fd8a..a65dad0caa3 100644
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -289,11 +289,13 @@ class JobLike(object):
def set_streams(self, tool_stdout, tool_stderr, job_stdout=None, job_stderr=None, job_messages=None):
def shrink_and_unicodify(what, stream):
- stream = galaxy.util.unicodify(stream) or u''
- if (len(stream) > galaxy.util.DATABASE_MAX_STRING_SIZE):
- stream = galaxy.util.shrink_string_by_size(tool_stdout, galaxy.util.DATABASE_MAX_STRING_SIZE, join_by="\n..\n", left_larger=True, beginning_on_size_error=True)
- log.info("%s for %s %d is greater than %s, only a portion will be logged to database", what, type(self), self.id, galaxy.util.DATABASE_MAX_STRING_SIZE_PRETTY)
- return stream
+ if len(stream) > galaxy.util.DATABASE_MAX_STRING_SIZE:
+ log.info("%s for %s %d is greater than %s, only a portion will be logged to database",
+ what,
+ type(self),
+ self.id,
+ galaxy.util.DATABASE_MAX_STRING_SIZE_PRETTY)
+ return galaxy.util.shrink_and_unicodify(stream)
self.tool_stdout = shrink_and_unicodify('tool_stdout', tool_stdout)
self.tool_stderr = shrink_and_unicodify('tool_stderr', tool_stderr)
@@ -1678,13 +1680,10 @@ class History(HasTags, Dictifiable, UsesAnnotations, HasName, RepresentById):
set_genome = genome_build not in [None, '?']
for i, dataset in enumerate(datasets):
dataset.hid = base_hid + i
- # Don't let SA manage this.
- delattr(dataset, "history")
+ dataset.history = self
dataset.history_id = cached_id(self)
if set_genome:
self.genome_build = genome_build
- for dataset in datasets:
- dataset.history_id = cached_id(self)
return datasets
def add_dataset_collection(self, history_dataset_collection, set_hid=True):
@@ -2444,6 +2443,14 @@ class DatasetInstance(object):
self.parent_id = parent_id
self.validation_errors = validation_errors
+ @property
+ def peek(self):
+ return self._peek
+
+ @peek.setter
+ def peek(self, peek):
+ self._peek = unicodify(peek, strip_null=True)
+
def update(self):
self.update_time = galaxy.model.orm.now.now()
diff --git a/lib/galaxy/model/item_attrs.py b/lib/galaxy/model/item_attrs.py
index bf32ed87a5a..d054c8bbc42 100644
--- a/lib/galaxy/model/item_attrs.py
+++ b/lib/galaxy/model/item_attrs.py
@@ -74,13 +74,10 @@ class UsesItemRatings(object):
item_rating_assoc_class = '%sRatingAssociation' % item.__class__.__name__
return getattr(webapp_model, item_rating_assoc_class, None)
- def _get_item_id_filter_str(self, item, item_rating_assoc_class, webapp_model=None):
+ def _get_item_id_filter_str(self, item, item_rating_assoc_class):
# Get foreign key in item-rating association table that references item table.
- if webapp_model is None:
- webapp_model = galaxy.model
item_fk = get_foreign_key(item_rating_assoc_class, item)
- # TODO: can we provide a better filter than a raw string?
- return "%s=%i" % (item_fk.parent.name, item.id)
+ return item_fk.parent == item.id
class UsesAnnotations(object):
@@ -122,7 +119,6 @@ def get_item_annotation_obj(db_session, user, item):
# Get annotation association object.
annotation_assoc = db_session.query(annotation_assoc_class).filter_by(user=user)
- # TODO: use filtering like that in _get_item_id_filter_str()
if item.__class__ == galaxy.model.History:
annotation_assoc = annotation_assoc.filter_by(history=item)
elif item.__class__ == galaxy.model.HistoryDatasetAssociation:
diff --git a/lib/galaxy/model/mapping.py b/lib/galaxy/model/mapping.py
index 98657d46b49..90caf7f413f 100644
--- a/lib/galaxy/model/mapping.py
+++ b/lib/galaxy/model/mapping.py
@@ -222,7 +222,7 @@ model.HistoryDatasetAssociation.table = Table(
Column("name", TrimmedString(255)),
Column("info", TrimmedString(255)),
Column("blurb", TrimmedString(255)),
- Column("peek", TEXT),
+ Column("peek", TEXT, key="_peek"),
Column("tool_version", TEXT),
Column("extension", TrimmedString(64)),
Column("metadata", MetadataType(), key="_metadata"),
@@ -506,7 +506,7 @@ model.LibraryDatasetDatasetAssociation.table = Table(
Column("name", TrimmedString(255), index=True),
Column("info", TrimmedString(255)),
Column("blurb", TrimmedString(255)),
- Column("peek", TEXT),
+ Column("peek", TEXT, key="_peek"),
Column("tool_version", TEXT),
Column("extension", TrimmedString(64)),
Column("metadata", MetadataType(), key="_metadata"),
@@ -2763,7 +2763,7 @@ def db_next_hid(self, n=1):
trans = session.begin()
try:
if "postgres" not in session.bind.dialect.name:
- next_hid = select([table.c.hid_counter], table.c.id == model.cached_id(self), for_update=True).scalar()
+ next_hid = select([table.c.hid_counter], table.c.id == model.cached_id(self)).with_for_update().scalar()
table.update(table.c.id == self.id).execute(hid_counter=(next_hid + n))
else:
stmt = table.update().where(table.c.id == model.cached_id(self)).values(hid_counter=(table.c.hid_counter + n)).returning(table.c.hid_counter)
diff --git a/lib/galaxy/util/none_like.py b/lib/galaxy/model/none_like.py
similarity index 78%
rename from lib/galaxy/util/none_like.py
rename to lib/galaxy/model/none_like.py
index ff7c5de0475..293ecc5860c 100644
--- a/lib/galaxy/util/none_like.py
+++ b/lib/galaxy/model/none_like.py
@@ -2,7 +2,6 @@
Objects with No values
"""
-from galaxy.datatypes.registry import Registry
from galaxy.model.metadata import MetadataCollection
@@ -27,10 +26,7 @@ class NoneDataset(RecursiveNone):
def __init__(self, datatypes_registry=None, ext='data', dbkey='?'):
self.ext = self.extension = ext
self.dbkey = dbkey
- if datatypes_registry is None:
- # Default Value Required for unit tests
- datatypes_registry = Registry()
- datatypes_registry.load_datatypes()
+ assert datatypes_registry is not None
self.datatype = datatypes_registry.get_datatype_by_extension(ext)
self._metadata = None
self.metadata = MetadataCollection(self)
diff --git a/lib/galaxy/tool_util/deps/__init__.py b/lib/galaxy/tool_util/deps/__init__.py
index 1aab7f2e545..397a9a12faf 100644
--- a/lib/galaxy/tool_util/deps/__init__.py
+++ b/lib/galaxy/tool_util/deps/__init__.py
@@ -24,8 +24,6 @@ from .resolvers import (
ContainerDependency,
NullDependency,
)
-from .resolvers.conda import CondaDependencyResolver
-from .resolvers.galaxy_packages import GalaxyPackageDependencyResolver
from .resolvers.tool_shed_packages import ToolShedPackageDependencyResolver
log = logging.getLogger(__name__)
@@ -34,13 +32,26 @@ CONFIG_VAL_NOT_FOUND = object()
def build_dependency_manager(config):
- if getattr(config, "use_tool_dependencies", False):
+ config_dict = {
+ "use_tool_dependencies": getattr(config, "use_tool_dependencies", False),
+ "default_base_path": getattr(config, "tool_dependency_dir", None),
+ "conf_file": getattr(config, "dependency_resolvers_config_file", None),
+ "cache": getattr(config, "use_cached_dependency_manager", False),
+ "app_config": config,
+ "dependency_resolvers": getattr(config, "dependency_resolvers", None),
+ }
+ return build_dependency_manager_from_dict(config_dict)
+
+
+def build_dependency_manager_from_dict(config_dict):
+ if config_dict.get("use_tool_dependencies", False):
dependency_manager_kwds = {
- 'default_base_path': config.tool_dependency_dir,
- 'conf_file': config.dependency_resolvers_config_file,
- 'app_config': config,
+ 'default_base_path': config_dict.get("default_base_path"),
+ 'conf_file': config_dict.get("conf_file"),
+ 'app_config': config_dict.get("app_config"),
+ "dependency_resolver_dicts": config_dict.get("dependency_resolvers"),
}
- if getattr(config, "use_cached_dependency_manager", False):
+ if config_dict.get("cache"):
dependency_manager = CachedDependencyManager(**dependency_manager_kwds)
else:
dependency_manager = DependencyManager(**dependency_manager_kwds)
@@ -61,8 +72,9 @@ class DependencyManager(object):
and should each contain a file 'env.sh' which can be sourced to make the
dependency available in the current shell environment.
"""
+ cached = False
- def __init__(self, default_base_path, conf_file=None, app_config={}):
+ def __init__(self, default_base_path, conf_file=None, app_config={}, dependency_resolver_dicts=None):
"""
Create a new dependency manager looking for packages under the paths listed
in `base_paths`. The default base path is app.config.tool_dependency_dir.
@@ -74,7 +86,13 @@ class DependencyManager(object):
self.__app_config = app_config
self.default_base_path = os.path.abspath(default_base_path)
self.resolver_classes = self.__resolvers_dict()
- self.dependency_resolvers = self.__build_dependency_resolvers(conf_file)
+
+ plugin_source = None
+ if dependency_resolver_dicts is not None:
+ plugin_source = ('dict', dependency_resolver_dicts)
+ else:
+ plugin_source = self.__build_dependency_resolvers_plugin_source(conf_file)
+ self.dependency_resolvers = self.__parse_resolver_conf_plugins(plugin_source)
self._enabled_container_types = []
self._destination_for_container_type = {}
@@ -232,38 +250,50 @@ class DependencyManager(object):
else:
return NullDependency(name=name, version=version)
- def __build_dependency_resolvers(self, conf_file):
+ def __build_dependency_resolvers_plugin_source(self, conf_file):
if not conf_file:
- return self.__default_dependency_resolvers()
+ return self.__default_dependency_resolvers_source()
if not os.path.exists(conf_file):
log.debug("Unable to find config file '%s'", conf_file)
- return self.__default_dependency_resolvers()
+ return self.__default_dependency_resolvers_source()
plugin_source = plugin_config.plugin_source_from_path(conf_file)
- return self.__parse_resolver_conf_xml(plugin_source)
+ return plugin_source
- def __default_dependency_resolvers(self):
- return [
- ToolShedPackageDependencyResolver(self),
- GalaxyPackageDependencyResolver(self),
- CondaDependencyResolver(self),
- GalaxyPackageDependencyResolver(self, versionless=True),
- CondaDependencyResolver(self, versionless=True),
- ]
+ def __default_dependency_resolvers_source(self):
+ return ('dict', [
+ {"type": "tool_shed_packages"},
+ {"type": "galaxy_packages"},
+ {"type": "conda"},
+ {"type": "galaxy_packages", "versionless": True},
+ {"type": "conda", "versionless": True},
+ ])
- def __parse_resolver_conf_xml(self, plugin_source):
+ def __parse_resolver_conf_plugins(self, plugin_source):
"""
"""
extra_kwds = dict(dependency_manager=self)
- return plugin_config.load_plugins(self.resolver_classes, plugin_source, extra_kwds)
+ # Use either 'type' from YAML definition or 'resolver_type' from to_dict definition.
+ return plugin_config.load_plugins(self.resolver_classes, plugin_source, extra_kwds, plugin_type_keys=['type', 'resolver_type'])
def __resolvers_dict(self):
import galaxy.tool_util.deps.resolvers
return plugin_config.plugins_dict(galaxy.tool_util.deps.resolvers, 'resolver_type')
+ def to_dict(self):
+ return {
+ "cache": self.cached,
+ "use_tool_dependencies": True,
+ "default_base_path": self.default_base_path,
+ "dependency_resolvers": [m.to_dict() for m in self.dependency_resolvers],
+ "tool_dependency_cache_dir": getattr(self, "tool_dependency_cache_dir", None),
+ }
+
class CachedDependencyManager(DependencyManager):
- def __init__(self, default_base_path, conf_file=None, app_config={}, tool_dependency_cache_dir=None):
- super(CachedDependencyManager, self).__init__(default_base_path=default_base_path, conf_file=conf_file, app_config=app_config)
+ cached = True
+
+ def __init__(self, default_base_path, **kwd):
+ super(CachedDependencyManager, self).__init__(default_base_path=default_base_path, **kwd)
self.tool_dependency_cache_dir = self.get_app_option("tool_dependency_cache_dir")
def build_cache(self, requirements, **kwds):
@@ -338,3 +368,6 @@ class NullDependencyManager(DependencyManager):
def find_dep(self, name, version=None, type='package', **kwds):
return NullDependency(version=version, name=name)
+
+ def to_dict(self):
+ return {"use_tool_dependencies": False}
diff --git a/lib/galaxy/tool_util/deps/containers.py b/lib/galaxy/tool_util/deps/containers.py
index d99a2e1c0aa..55a994ec78c 100644
--- a/lib/galaxy/tool_util/deps/containers.py
+++ b/lib/galaxy/tool_util/deps/containers.py
@@ -148,7 +148,7 @@ class ContainerFinder(object):
key = "%s_image" % container_type
if key in destination_info:
return destination_info.get(key)
- elif "%s_image_default" in destination_info:
+ elif "%s_image_default" % container_type in destination_info:
return self.__build_container_id_from_parts(container_type, destination_info, mode="default")
return None
@@ -159,7 +159,7 @@ class ContainerFinder(object):
# TODO: Right now this assumes all containers available when a
# container type is - there should be more thought put into this.
- # Checking which are availalbe - settings policies for what can be
+ # Checking which are available - settings policies for what can be
# auto-fetched, etc....
return CONTAINER_CLASSES[container_type](container_id, self.app_info, tool_info, destination_info, job_info, container_description)
diff --git a/lib/galaxy/tool_util/deps/resolvers/conda.py b/lib/galaxy/tool_util/deps/resolvers/conda.py
index 28468ffb8ee..e7f4d3a25f0 100644
--- a/lib/galaxy/tool_util/deps/resolvers/conda.py
+++ b/lib/galaxy/tool_util/deps/resolvers/conda.py
@@ -65,7 +65,7 @@ log = logging.getLogger(__name__)
class CondaDependencyResolver(DependencyResolver, MultipleDependencyResolver, ListableDependencyResolver, InstallableDependencyResolver, SpecificationPatternDependencyResolver, MappableDependencyResolver):
- dict_collection_visible_keys = DependencyResolver.dict_collection_visible_keys + ['conda_prefix', 'versionless', 'ensure_channels', 'auto_install']
+ dict_collection_visible_keys = DependencyResolver.dict_collection_visible_keys + ['conda_prefix', 'versionless', 'ensure_channels', 'auto_install', 'auto_init']
resolver_type = "conda"
config_options = {
'prefix': None,
diff --git a/lib/galaxy/tool_util/deps/resolvers/modules.py b/lib/galaxy/tool_util/deps/resolvers/modules.py
index fc7e17b62da..37ac3d70b8b 100644
--- a/lib/galaxy/tool_util/deps/resolvers/modules.py
+++ b/lib/galaxy/tool_util/deps/resolvers/modules.py
@@ -41,7 +41,7 @@ UNKNOWN_FIND_BY_MESSAGE = "ModuleDependencyResolver does not know how to find mo
class ModuleDependencyResolver(DependencyResolver, MappableDependencyResolver):
- dict_collection_visible_keys = DependencyResolver.dict_collection_visible_keys + ['base_path', 'modulepath']
+ dict_collection_visible_keys = DependencyResolver.dict_collection_visible_keys + ['base_path', 'modulepath', 'modulecmd', 'prefetch', 'default_indicator', 'find_by']
resolver_type = "modules"
def __init__(self, dependency_manager, **kwds):
@@ -50,6 +50,7 @@ class ModuleDependencyResolver(DependencyResolver, MappableDependencyResolver):
self._setup_mapping(dependency_manager, **kwds)
self.versionless = _string_as_bool(kwds.get('versionless', 'false'))
find_by = kwds.get('find_by', 'avail')
+ self.find_by = find_by
prefetch = _string_as_bool(kwds.get('prefetch', DEFAULT_MODULE_PREFETCH))
self.modulecmd = kwds.get('modulecmd', DEFAULT_MODULECMD_PATH)
self.modulepath = kwds.get('modulepath', self.__default_modulespath())
diff --git a/lib/galaxy/tools/xsd/LICENSE b/lib/galaxy/tool_util/xsd/LICENSE
similarity index 100%
rename from lib/galaxy/tools/xsd/LICENSE
rename to lib/galaxy/tool_util/xsd/LICENSE
diff --git a/lib/galaxy/tools/xsd/README.md b/lib/galaxy/tool_util/xsd/README.md
similarity index 100%
rename from lib/galaxy/tools/xsd/README.md
rename to lib/galaxy/tool_util/xsd/README.md
diff --git a/lib/galaxy/tools/xsd/galaxy.jxb b/lib/galaxy/tool_util/xsd/galaxy.jxb
similarity index 100%
rename from lib/galaxy/tools/xsd/galaxy.jxb
rename to lib/galaxy/tool_util/xsd/galaxy.jxb
diff --git a/lib/galaxy/tools/xsd/galaxy.xsd b/lib/galaxy/tool_util/xsd/galaxy.xsd
similarity index 100%
rename from lib/galaxy/tools/xsd/galaxy.xsd
rename to lib/galaxy/tool_util/xsd/galaxy.xsd
diff --git a/lib/galaxy/tools/actions/__init__.py b/lib/galaxy/tools/actions/__init__.py
index 3125f399355..def2be977ee 100644
--- a/lib/galaxy/tools/actions/__init__.py
+++ b/lib/galaxy/tools/actions/__init__.py
@@ -10,12 +10,12 @@ from galaxy import model
from galaxy.jobs.actions.post import ActionBox
from galaxy.model import LibraryDatasetDatasetAssociation, WorkflowRequestInputParameter
from galaxy.model.dataset_collections.builder import CollectionBuilder
+from galaxy.model.none_like import NoneDataset
from galaxy.objectstore import ObjectStorePopulator
from galaxy.tools.parameters import update_dataset_ids
from galaxy.tools.parameters.basic import DataCollectionToolParameter, DataToolParameter, RuntimeValue
from galaxy.tools.parameters.wrapped import WrappedParameters
from galaxy.util import ExecutionTimer
-from galaxy.util.none_like import NoneDataset
from galaxy.util.odict import odict
from galaxy.util.template import fill_template
from galaxy.web import url_for
@@ -518,9 +518,8 @@ class DefaultToolAction(object):
add_datasets_timer = ExecutionTimer()
# Add all the top-level (non-child) datasets to the history unless otherwise specified
datasets_to_persist = []
- for name in out_data.keys():
+ for name, data in out_data.items():
if name not in child_dataset_names and name not in incoming: # don't add children; or already existing datasets, i.e. async created
- data = out_data[name]
datasets_to_persist.append(data)
# Set HID and add to history.
# This is brand new and certainly empty so don't worry about quota.
diff --git a/lib/galaxy/tools/evaluation.py b/lib/galaxy/tools/evaluation.py
index e90216968a0..f861cfce2ed 100644
--- a/lib/galaxy/tools/evaluation.py
+++ b/lib/galaxy/tools/evaluation.py
@@ -8,6 +8,7 @@ from six import string_types
from galaxy import model
from galaxy.jobs.datasets import dataset_path_rewrites
+from galaxy.model.none_like import NoneDataset
from galaxy.tools import global_tool_errors
from galaxy.tools.parameters import (
visit_input_values,
@@ -38,7 +39,6 @@ from galaxy.util import (
unicodify,
)
from galaxy.util.bunch import Bunch
-from galaxy.util.none_like import NoneDataset
from galaxy.util.object_wrapper import wrap_with_safe_string
from galaxy.util.template import fill_template
from galaxy.work.context import WorkRequestContext
diff --git a/lib/galaxy/tools/linters/citations.py b/lib/galaxy/tools/linters/citations.py
index 95c03d078ab..23d8b63cdcb 100644
--- a/lib/galaxy/tools/linters/citations.py
+++ b/lib/galaxy/tools/linters/citations.py
@@ -21,12 +21,15 @@ def lint_citations(tool_xml, lint_ctx):
for citation in citations[0]:
if citation.tag != "citation":
lint_ctx.warn("Unknown tag discovered in citations block [%s], will be ignored." % citation.tag)
- if "type" in citation.attrib:
- citation_type = citation.attrib.get("type")
- if citation_type not in ["doi", "bibtex"]:
- lint_ctx.warn("Unknown citation type discovered [%s], will be ignored.", citation_type)
- else:
- valid_citations += 1
+ continue
+ citation_type = citation.attrib.get("type")
+ if citation_type not in ('bibtex', 'doi'):
+ lint_ctx.warn("Unknown citation type discovered [%s], will be ignored.", citation_type)
+ continue
+ if citation.text is None or not citation.text.strip():
+ lint_ctx.error('Empty %s citation.' % citation_type)
+ continue
+ valid_citations += 1
if valid_citations > 0:
lint_ctx.valid("Found %d likely valid citations.", valid_citations)
diff --git a/lib/galaxy/tools/linters/cwl.py b/lib/galaxy/tools/linters/cwl.py
new file mode 100644
index 00000000000..58390b5ddd4
--- /dev/null
+++ b/lib/galaxy/tools/linters/cwl.py
@@ -0,0 +1,48 @@
+"""Linter for CWL tools."""
+
+lint_tool_types = ["cwl"]
+
+from galaxy.tool_util.cwl.schema import schema_loader
+
+
+def lint_cwl_validation(tool_source, lint_ctx):
+ """Determine in CWL tool validates against spec."""
+ raw_reference = schema_loader.raw_process_reference(tool_source._source_path)
+ validation_exception = None
+ try:
+ schema_loader.process_definition(raw_reference)
+ except Exception as e:
+ validation_exception = e
+ if validation_exception:
+ lint_ctx.error("Failed to valdiate CWL artifact [%s]", validation_exception)
+ else:
+ lint_ctx.info("CWL appears to be valid.")
+
+
+def lint_new_draft(tool_source, lint_ctx):
+ """Determine in CWL tool is valid, modern draft."""
+ raw_reference = schema_loader.raw_process_reference(tool_source._source_path)
+ cwl_version = raw_reference.process_object.get("cwlVersion", None)
+ if cwl_version is None:
+ lint_ctx.error("CWL file does not contain a 'cwlVersion'")
+ if cwl_version not in ["v1.0"]:
+ lint_ctx.warn("CWL version [%s] is unknown, we recommend the v1.0 the stable release." % cwl_version)
+ else:
+ lint_ctx.info("Modern CWL version [%s]", cwl_version)
+
+
+def lint_docker_image(tool_source, lint_ctx):
+ _, containers = tool_source.parse_requirements_and_containers()
+ if len(containers) == 0:
+ lint_ctx.warn("Tool does not specify a DockerPull source.")
+ else:
+ identifier = containers[0].identifier
+ lint_ctx.info("Tool will run in Docker image [%s]." % identifier)
+
+
+def lint_description(tool_source, lint_ctx):
+ help = tool_source.parse_help()
+ if not help:
+ lint_ctx.warn("Description of tool is empty or absent.")
+ elif "TODO" in help:
+ lint_ctx.warn("Help contains TODO text.")
diff --git a/lib/galaxy/tools/test.py b/lib/galaxy/tools/test.py
index a4acd0f5ee2..e8c74b6e725 100644
--- a/lib/galaxy/tools/test.py
+++ b/lib/galaxy/tools/test.py
@@ -21,7 +21,7 @@ log = logging.getLogger(__name__)
@nottest
def parse_tests(tool, tests_source):
"""
- Build ToolTestBuilder objects for each ",
- tag='pre', attrs=[('class', 'screen')]
- """
-
- # If ignoring content, just increment tag count and ignore.
- if self.ignore_content:
- self.num_open_tags_for_ignore += 1
- return
-
- # Not ignoring tag; look for embedded content.
- embedded_item = False
- for attribute in attrs:
- if (attribute[0] == "class") and ("embedded-item" in attribute[1].split(" ")):
- embedded_item = True
- break
- # For embedded content, set ignore flag to ignore current content and add new content for embedded item.
- if embedded_item:
- # Set processing attributes to ignore content.
- self.ignore_content = True
- self.num_open_tags_for_ignore = 1
-
- # Insert content for embedded element.
- for attribute in attrs:
- name = attribute[0]
- if name == "id":
- # ID has form '-'
- item_class, item_id = attribute[1].split("-")
- embed_html = self.render_embed_html_fn(self.trans, item_class, item_id)
- self.pieces.append(embed_html)
- return
-
- # Default behavior: not ignoring and no embedded content.
- uattrs = []
- strattrs = ''
- if attrs:
- for key, value in attrs:
- value = value.replace('>', '>').replace('<', '<').replace('"', '"')
- value = self.bare_ampersand.sub("&", value)
- uattrs.append((key, value))
- strattrs = ''.join(' %s="%s"' % (k, v) for k, v in uattrs)
- if tag in self.elements_no_end_tag:
- self.pieces.append('<%s%s />' % (tag, strattrs))
- else:
- self.pieces.append('<%s%s>' % (tag, strattrs))
-
- def handle_endtag(self, tag):
- """
- Called for each end tag
-
- E.g. for , tag will be 'pre'
- """
- # If ignoring content, see if current tag is the end of content to ignore.
- if self.ignore_content:
- self.num_open_tags_for_ignore -= 1
- if self.num_open_tags_for_ignore == 0:
- # Done ignoring content.
- self.ignore_content = False
- return
-
- # Default behavior: reconstruct the original end tag.
- if tag not in self.elements_no_end_tag:
- self.pieces.append("%s>" % tag)
-
- def handle_charref(self, ref):
- # called for each character reference, e.g. for ' ', ref will be '160'
- # Reconstruct the original character reference.
- ref = ref.lower()
- if ref.startswith('x'):
- value = int(ref[1:], 16)
- else:
- value = int(ref)
-
- if value in _cp1252:
- self.pieces.append('%s;' % hex(ord(_cp1252[value]))[1:])
- else:
- self.pieces.append('%s;' % ref)
-
- def handle_entityref(self, ref):
- # called for each entity reference, e.g. for '©', ref will be 'copy'
- # Reconstruct the original entity reference.
- if ref in name2codepoint or ref == 'apos':
- self.pieces.append('&%s;' % ref)
- else:
- self.pieces.append('&%s' % ref)
-
- def handle_data(self, text):
- """
- Called for each block of plain text
-
- Called outside of any tag and not containing any character or entity
- references. Store the original text verbatim.
- """
- if self.ignore_content:
- return
- self.pieces.append(text)
-
- def handle_comment(self, text):
- # called for each HTML comment, e.g.
- # Reconstruct the original comment.
- self.pieces.append('' % text)
-
- def handle_decl(self, text):
- # called for the DOCTYPE, if present, e.g.
- #
- # Reconstruct original DOCTYPE
- self.pieces.append('' % text)
-
- def handle_pi(self, text):
- # called for each processing instruction, e.g.
- # Reconstruct original processing instruction.
- self.pieces.append('%s>' % text)
-
- def output(self):
- '''Return processed HTML as a single string'''
- return ''.join(self.pieces)
-
-
class PageController(BaseUIController, SharableMixin,
UsesStoredWorkflowMixin, UsesVisualizationMixin, UsesItemRatings):
@@ -473,9 +267,10 @@ class PageController(BaseUIController, SharableMixin,
def __init__(self, app):
super(PageController, self).__init__(app)
- self.history_manager = managers.histories.HistoryManager(app)
- self.history_serializer = managers.histories.HistorySerializer(self.app)
- self.hda_manager = managers.hdas.HDAManager(app)
+ self.page_manager = PageManager(app)
+ self.history_manager = HistoryManager(app)
+ self.history_serializer = HistorySerializer(self.app)
+ self.hda_manager = HDAManager(app)
@web.expose
@web.json
@@ -541,37 +336,11 @@ class PageController(BaseUIController, SharableMixin,
}]
}
else:
- user = trans.get_user()
- p_title = payload.get('title')
- p_slug = payload.get('slug')
- p_annotation = payload.get('annotation')
- if not p_title:
- return self.message_exception(trans, 'Please provide a page name is required.')
- elif not p_slug:
- return self.message_exception(trans, 'Please provide a unique identifier.')
- elif not self._is_valid_slug(p_slug):
- return self.message_exception(trans, 'Page identifier can only contain lowercase letters, numbers, and dashes (-).')
- elif trans.sa_session.query(model.Page).filter_by(user=user, slug=p_slug, deleted=False).first():
- return self.message_exception(trans, 'Page id must be unique.')
- else:
- # Create the new stored page
- p = model.Page()
- p.title = p_title
- p.slug = p_slug
- p.user = user
- if p_annotation:
- p_annotation = sanitize_html(p_annotation)
- self.add_item_annotation(trans.sa_session, user, p, p_annotation)
- # And the first (empty) page revision
- p_revision = model.PageRevision()
- p_revision.title = p_title
- p_revision.page = p
- p.latest_revision = p_revision
- p_revision.content = ""
- # Persist
- trans.sa_session.add(p)
- trans.sa_session.flush()
- return {'message': 'Page \'%s\' successfully created.' % p.title, 'status': 'success'}
+ try:
+ page = self.page_manager.create(trans, payload)
+ except exceptions.MessageException as e:
+ return self.message_exception(trans, str(e))
+ return {'message': 'Page \'%s\' successfully created.' % page.title, 'status': 'success'}
@web.legacy_expose_api
@web.require_login("edit pages")
@@ -637,11 +406,7 @@ class PageController(BaseUIController, SharableMixin,
id = self.decode_id(id)
page = trans.sa_session.query(model.Page).get(id)
assert page.user == trans.user
- content = page.latest_revision.content
- processor = _PageContentProcessor(trans, _placeholderRenderForEdit)
- processor.feed(content)
- content = unicodify(processor.output(), 'utf-8')
- return trans.fill_template("page/editor.mako", page=page, content=content)
+ return trans.fill_template("page/editor.mako", page=page)
@web.expose
@web.require_login("use Galaxy pages")
@@ -685,57 +450,11 @@ class PageController(BaseUIController, SharableMixin,
@web.expose
@web.require_login()
- def save(self, trans, id, content, annotations):
+ def save(self, trans, id, content):
id = self.decode_id(id)
page = trans.sa_session.query(model.Page).get(id)
assert page.user == trans.user
-
- # Sanitize content
- content = sanitize_html(content)
- processor = _PageContentProcessor(trans, _placeholderRenderForSave)
- processor.feed(content)
- # Output is string, so convert to unicode for saving.
- content = unicodify(processor.output(), 'utf-8')
-
- # Add a new revision to the page with the provided content.
- page_revision = model.PageRevision()
- page_revision.title = page.title
- page_revision.page = page
- page.latest_revision = page_revision
- page_revision.content = content
-
- # Save annotations.
- annotations = loads(annotations)
- for annotation_dict in annotations:
- item_id = self.decode_id(annotation_dict['item_id'])
- item_class = self.get_class(annotation_dict['item_class'])
- item = trans.sa_session.query(item_class).filter_by(id=item_id).first()
- if not item:
- raise RuntimeError("cannot find annotated item")
- text = sanitize_html(annotation_dict['text'])
-
- # Add/update annotation.
- if item_id and item_class and text:
- # Get annotation association.
- annotation_assoc_class = eval("model.%sAnnotationAssociation" % item_class.__name__)
- annotation_assoc = trans.sa_session.query(annotation_assoc_class).filter_by(user=trans.get_user())
- if item_class == model.History.__class__:
- annotation_assoc = annotation_assoc.filter_by(history=item)
- elif item_class == model.HistoryDatasetAssociation.__class__:
- annotation_assoc = annotation_assoc.filter_by(hda=item)
- elif item_class == model.StoredWorkflow.__class__:
- annotation_assoc = annotation_assoc.filter_by(stored_workflow=item)
- elif item_class == model.WorkflowStep.__class__:
- annotation_assoc = annotation_assoc.filter_by(workflow_step=item)
- annotation_assoc = annotation_assoc.first()
- if not annotation_assoc:
- # Create association.
- annotation_assoc = annotation_assoc_class()
- item.annotations.append(annotation_assoc)
- annotation_assoc.user = trans.get_user()
- # Set annotation user text.
- annotation_assoc.annotation = text
- trans.sa_session.flush()
+ self.page_manager.save_new_revision(trans, page, {"content": content})
@web.expose
@web.require_login()
@@ -760,7 +479,7 @@ class PageController(BaseUIController, SharableMixin,
self.security_check(trans, page, False, True)
# Process page content.
- processor = _PageContentProcessor(trans, self._get_embed_html)
+ processor = PageContentProcessor(trans, self._get_embed_html)
processor.feed(page.latest_revision.content)
# Output is string, so convert to unicode for display.
page_content = unicodify(processor.output(), 'utf-8')
@@ -942,7 +661,7 @@ class PageController(BaseUIController, SharableMixin,
def _get_embed_html(self, trans, item_class, item_id):
""" Returns HTML for embedding an item in a page. """
item_class = self.get_class(item_class)
- encoded_id, decoded_id = _get_page_identifiers(item_id, trans.app)
+ encoded_id, decoded_id = get_page_identifiers(item_id, trans.app)
if item_class == model.History:
return self._get_embedded_history_html(trans, decoded_id)
@@ -967,52 +686,3 @@ class PageController(BaseUIController, SharableMixin,
elif item_class == model.Page:
pass
-
-
-PLACEHOLDER_TEMPLATE = ''''''
-
-# This is a mapping of the id portion of page contents to the cssclass/shortname.
-PAGE_CLASS_MAPPING = {
- 'History': 'History',
- 'HistoryDatasetAssociation': 'Dataset',
- 'StoredWorkflow': 'Workflow',
- 'Visualization': 'Visualization'
-}
-
-
-def _placeholderRenderForEdit(trans, item_class, item_id):
- return _placeholderRenderForSave(trans, item_class, item_id, encode=True)
-
-
-def _placeholderRenderForSave(trans, item_class, item_id, encode=False):
- encoded_item_id, decoded_item_id = _get_page_identifiers(item_id, trans.app)
- item_name = ''
- if item_class == 'History':
- history = trans.sa_session.query(trans.model.History).get(decoded_item_id)
- history = managers.base.security_check(trans, history, False, True)
- item_name = history.name
- elif item_class == 'HistoryDatasetAssociation':
- hda = trans.sa_session.query(trans.model.HistoryDatasetAssociation).get(decoded_item_id)
- hda_manager = managers.hdas.HDAManager(trans.app)
- hda = hda_manager.get_accessible(decoded_item_id, trans.user)
- item_name = hda.name
- elif item_class == 'StoredWorkflow':
- wf = trans.sa_session.query(trans.model.StoredWorkflow).get(decoded_item_id)
- wf = managers.base.security_check(trans, wf, False, True)
- item_name = wf.name
- elif item_class == 'Visualization':
- visualization = trans.sa_session.query(trans.model.Visualization).get(decoded_item_id)
- visualization = managers.base.security_check(trans, visualization, False, True)
- item_name = visualization.title
- class_shorthand = PAGE_CLASS_MAPPING[item_class]
- if encode:
- item_id = encoded_item_id
- else:
- item_id = decoded_item_id
- return PLACEHOLDER_TEMPLATE.format(
- item_class=item_class,
- class_shorthand=class_shorthand,
- class_shorthand_lower=class_shorthand.lower(),
- item_id=item_id,
- item_name=item_name
- )
diff --git a/lib/tool_shed/grids/repository_grids.py b/lib/tool_shed/grids/repository_grids.py
index be1b51994e8..ba664184fab 100644
--- a/lib/tool_shed/grids/repository_grids.py
+++ b/lib/tool_shed/grids/repository_grids.py
@@ -364,10 +364,9 @@ class MatchedRepositoryGrid(grids.Grid):
if match_tuples:
for match_tuple in match_tuples:
repository_id, changeset_revision = match_tuple
- clause_list.append("%s=%d and %s='%s'" % (model.RepositoryMetadata.table.c.repository_id,
- int(repository_id),
- model.RepositoryMetadata.table.c.changeset_revision,
- changeset_revision))
+ clause_list.append(and_(
+ model.RepositoryMetadata.repository_id == int(repository_id),
+ model.RepositoryMetadata.changeset_revision == changeset_revision))
return trans.sa_session.query(model.RepositoryMetadata) \
.join(model.Repository) \
.filter(and_(model.Repository.table.c.deleted == false(),
diff --git a/packages/containers/HISTORY.rst b/packages/containers/HISTORY.rst
new file mode 100644
index 00000000000..ec2f0e746e9
--- /dev/null
+++ b/packages/containers/HISTORY.rst
@@ -0,0 +1,12 @@
+.. :changelog:
+
+History
+-------
+
+.. to_doc
+
+---------------------
+19.9.0.dev0
+---------------------
+
+* Initial import from dev branch of Galaxy during 19.09 development cycle.
diff --git a/packages/containers/LICENSE b/packages/containers/LICENSE
new file mode 120000
index 00000000000..1ef648f64b3
--- /dev/null
+++ b/packages/containers/LICENSE
@@ -0,0 +1 @@
+../../LICENSE.txt
\ No newline at end of file
diff --git a/packages/containers/MANIFEST.in b/packages/containers/MANIFEST.in
new file mode 100644
index 00000000000..c74cefe0942
--- /dev/null
+++ b/packages/containers/MANIFEST.in
@@ -0,0 +1 @@
+include *.rst LICENSE
diff --git a/packages/containers/Makefile b/packages/containers/Makefile
new file mode 120000
index 00000000000..37af8bae5ba
--- /dev/null
+++ b/packages/containers/Makefile
@@ -0,0 +1 @@
+../package.Makefile
\ No newline at end of file
diff --git a/packages/containers/README.rst b/packages/containers/README.rst
new file mode 100644
index 00000000000..ed360aeef60
--- /dev/null
+++ b/packages/containers/README.rst
@@ -0,0 +1,14 @@
+
+.. image:: https://badge.fury.io/py/galaxy-containers.svg
+ :target: https://pypi.python.org/pypi/galaxy-containers/
+
+
+Overview
+--------
+
+The Galaxy_ containers module - interfaces for modeling and interacting with container backends (docker and docker swarm currently).
+
+* Free software: Academic Free License version 3.0
+* Code: https://github.com/galaxyproject/galaxy
+
+.. _Galaxy: http://galaxyproject.org/
diff --git a/packages/containers/dev-requirements.txt b/packages/containers/dev-requirements.txt
new file mode 120000
index 00000000000..467b90d7a23
--- /dev/null
+++ b/packages/containers/dev-requirements.txt
@@ -0,0 +1 @@
+../package-dev-requirements.txt
\ No newline at end of file
diff --git a/packages/containers/galaxy/__init__.py b/packages/containers/galaxy/__init__.py
new file mode 100644
index 00000000000..69e3be50dac
--- /dev/null
+++ b/packages/containers/galaxy/__init__.py
@@ -0,0 +1 @@
+__path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/packages/containers/galaxy/containers b/packages/containers/galaxy/containers
new file mode 120000
index 00000000000..bc2353d5e12
--- /dev/null
+++ b/packages/containers/galaxy/containers
@@ -0,0 +1 @@
+../../../lib/galaxy/containers
\ No newline at end of file
diff --git a/packages/containers/galaxy/project_galaxy_containers.py b/packages/containers/galaxy/project_galaxy_containers.py
new file mode 100644
index 00000000000..6442c8261bb
--- /dev/null
+++ b/packages/containers/galaxy/project_galaxy_containers.py
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+
+__version__ = '19.9.0.dev0'
+
+PROJECT_NAME = "galaxy-containers"
+PROJECT_OWNER = PROJECT_USERAME = "galaxyproject"
+PROJECT_URL = "https://github.com/galaxyproject/galaxy"
+PROJECT_AUTHOR = 'Galaxy Project and Community'
+PROJECT_DESCRIPTION = 'Galaxy Container Modeling and Interaction Abstractions'
+PROJECT_EMAIL = 'jmchilton@gmail.com'
+RAW_CONTENT_URL = "https://raw.github.com/%s/%s/master/" % (
+ PROJECT_USERAME, PROJECT_NAME
+)
diff --git a/packages/containers/requirements.txt b/packages/containers/requirements.txt
new file mode 100644
index 00000000000..3a4655d7abd
--- /dev/null
+++ b/packages/containers/requirements.txt
@@ -0,0 +1,3 @@
+galaxy-util
+requests
+
diff --git a/packages/containers/scripts b/packages/containers/scripts
new file mode 120000
index 00000000000..9aec9dc5a06
--- /dev/null
+++ b/packages/containers/scripts
@@ -0,0 +1 @@
+../build_scripts
\ No newline at end of file
diff --git a/packages/containers/setup.cfg b/packages/containers/setup.cfg
new file mode 120000
index 00000000000..eb7cf09393f
--- /dev/null
+++ b/packages/containers/setup.cfg
@@ -0,0 +1 @@
+../../setup.cfg
\ No newline at end of file
diff --git a/packages/containers/setup.py b/packages/containers/setup.py
new file mode 100644
index 00000000000..4d4fb9caec1
--- /dev/null
+++ b/packages/containers/setup.py
@@ -0,0 +1,102 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import ast
+import os
+import re
+try:
+ from setuptools import setup
+except ImportError:
+ from distutils.core import setup
+
+SOURCE_DIR = "galaxy"
+
+_version_re = re.compile(r'__version__\s+=\s+(.*)')
+
+with open('%s/project_galaxy_containers.py' % SOURCE_DIR, 'rb') as f:
+ init_contents = f.read().decode('utf-8')
+
+ def get_var(var_name):
+ pattern = re.compile(r'%s\s+=\s+(.*)' % var_name)
+ match = pattern.search(init_contents).group(1)
+ return str(ast.literal_eval(match))
+
+ version = get_var("__version__")
+ PROJECT_NAME = get_var("PROJECT_NAME")
+ PROJECT_URL = get_var("PROJECT_URL")
+ PROJECT_AUTHOR = get_var("PROJECT_AUTHOR")
+ PROJECT_EMAIL = get_var("PROJECT_EMAIL")
+ PROJECT_DESCRIPTION = get_var("PROJECT_DESCRIPTION")
+
+TEST_DIR = 'tests'
+PACKAGES = [
+ 'galaxy',
+ 'galaxy.containers',
+]
+ENTRY_POINTS = '''
+ [console_scripts]
+'''
+PACKAGE_DATA = {
+ # Be sure to update MANIFEST.in for source dist.
+ 'galaxy': [
+ ],
+}
+PACKAGE_DIR = {
+ SOURCE_DIR: SOURCE_DIR,
+}
+
+readme = open('README.rst').read()
+history = open('HISTORY.rst').read().replace('.. :changelog:', '')
+
+if os.path.exists("requirements.txt"):
+ requirements = open("requirements.txt").read().split("\n")
+else:
+ # In tox, it will cover them anyway.
+ requirements = []
+
+
+test_requirements = [
+ # TODO: put package test requirements here
+]
+
+
+setup(
+ name=PROJECT_NAME,
+ version=version,
+ description=PROJECT_DESCRIPTION,
+ long_description=readme + '\n\n' + history,
+ long_description_content_type='text/x-rst',
+ author=PROJECT_AUTHOR,
+ author_email=PROJECT_EMAIL,
+ url=PROJECT_URL,
+ packages=PACKAGES,
+ entry_points=ENTRY_POINTS,
+ package_data=PACKAGE_DATA,
+ package_dir=PACKAGE_DIR,
+ include_package_data=True,
+ install_requires=requirements,
+ extras_require={
+ 'docker': ['docker'],
+ },
+ license="AFL",
+ zip_safe=False,
+ keywords='galaxy',
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Intended Audience :: Developers',
+ 'Environment :: Console',
+ 'License :: OSI Approved :: Academic Free License (AFL)',
+ 'Operating System :: POSIX',
+ 'Topic :: Software Development',
+ 'Topic :: Software Development :: Code Generators',
+ 'Topic :: Software Development :: Testing',
+ 'Natural Language :: English',
+ "Programming Language :: Python :: 2",
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ ],
+ test_suite=TEST_DIR,
+ tests_require=test_requirements
+)
diff --git a/packages/data/requirements.txt b/packages/data/requirements.txt
index 0c13610d96a..f2b5c80f06e 100644
--- a/packages/data/requirements.txt
+++ b/packages/data/requirements.txt
@@ -1,7 +1,7 @@
galaxy-objectstore
galaxy-util
bdbag
-bx
+bx-python
h5py
isa-rwval
numpy
diff --git a/packages/data/tests/unittest_utils b/packages/data/tests/unittest_utils
deleted file mode 120000
index 6b6233367e6..00000000000
--- a/packages/data/tests/unittest_utils
+++ /dev/null
@@ -1 +0,0 @@
-../../../test/unit/unittest_utils
\ No newline at end of file
diff --git a/packages/data/tests/unittest_utils/__init__.py b/packages/data/tests/unittest_utils/__init__.py
new file mode 120000
index 00000000000..2115ad35783
--- /dev/null
+++ b/packages/data/tests/unittest_utils/__init__.py
@@ -0,0 +1 @@
+../../test/unit/unittest_utils/__init__.py
\ No newline at end of file
diff --git a/packages/data/tests/unittest_utils/tempfilecache.py b/packages/data/tests/unittest_utils/tempfilecache.py
new file mode 120000
index 00000000000..93fb83f1df7
--- /dev/null
+++ b/packages/data/tests/unittest_utils/tempfilecache.py
@@ -0,0 +1 @@
+../../test/unit/unittest_utils/tempfilecache.py
\ No newline at end of file
diff --git a/packages/data/tests/unittest_utils/utility.py b/packages/data/tests/unittest_utils/utility.py
new file mode 120000
index 00000000000..54dd4ca7a3b
--- /dev/null
+++ b/packages/data/tests/unittest_utils/utility.py
@@ -0,0 +1 @@
+../../test/unit/unittest_utils/utility.py
\ No newline at end of file
diff --git a/packages/job_metrics/galaxy/project_galaxy_job_metrics.py b/packages/job_metrics/galaxy/project_galaxy_job_metrics.py
index 755ea7bf08c..5c5c5411ab8 100644
--- a/packages/job_metrics/galaxy/project_galaxy_job_metrics.py
+++ b/packages/job_metrics/galaxy/project_galaxy_job_metrics.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-__version__ = '19.9.0.dev1'
+__version__ = '19.9.0.dev2'
PROJECT_NAME = "galaxy-job-metrics"
PROJECT_OWNER = PROJECT_USERAME = "galaxyproject"
diff --git a/packages/objectstore/galaxy/project_galaxy_objectstore.py b/packages/objectstore/galaxy/project_galaxy_objectstore.py
index 9aae9df3e85..825abc23062 100644
--- a/packages/objectstore/galaxy/project_galaxy_objectstore.py
+++ b/packages/objectstore/galaxy/project_galaxy_objectstore.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-__version__ = '19.9.0.dev1'
+__version__ = '19.9.0.dev2'
PROJECT_NAME = "galaxy-objectstore"
PROJECT_OWNER = PROJECT_USERAME = "galaxyproject"
diff --git a/packages/test.sh b/packages/test.sh
new file mode 100755
index 00000000000..d311a4d5ed1
--- /dev/null
+++ b/packages/test.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+set -e
+
+# Change to packages directory.
+cd "$(dirname "$0")"
+
+# Use a throw-away virtualenv
+TEST_PYTHON=${TEST_PYTHON:-"python"}
+TEST_ENV_DIR=${TEST_ENV_DIR:-$(mktemp -d -t gxpkgtestenvXXXXXX)}
+
+virtualenv -p "$TEST_PYTHON" "$TEST_ENV_DIR"
+. "${TEST_ENV_DIR}/bin/activate"
+pip install pytest
+
+# ensure ordered by dependency dag
+PACKAGE_DIRS=(
+ util
+ objectstore
+ job_metrics
+ containers
+ tool_util
+ data
+)
+# containers has no tests, tool_util not yet working 100%,
+# data has many problems quota, tool shed install database, etc..
+RUN_TESTS=(1 1 1 0 0 0 0)
+
+for ((i=0; i<${#PACKAGE_DIRS[@]}; i++)); do
+ package_dir=${PACKAGE_DIRS[$i]}
+ run_tests=${RUN_TESTS[$i]}
+
+ cd "$package_dir"
+ pip install -e .
+ if [ "$package_dir" = "util" ]; then
+ pip install -e '.[template,jstree]'
+ fi
+
+ if [[ "$run_tests" == "1" ]]; then
+ pytest --doctest-modules galaxy tests
+ fi
+ cd ..
+done
diff --git a/packages/tool_util/MANIFEST.in b/packages/tool_util/MANIFEST.in
index 2bf148a5764..baf7e4b1ce2 100644
--- a/packages/tool_util/MANIFEST.in
+++ b/packages/tool_util/MANIFEST.in
@@ -1,2 +1,4 @@
include *.rst LICENSE
-
+include galaxy/tool_util/deps/mulled/invfile.lua
+include galaxy/tool_util/deps/resolvers/default_conda_mapping.yml
+include galaxy/tool_util/xsd/*
diff --git a/packages/tool_util/galaxy/project_galaxy_tool_util.py b/packages/tool_util/galaxy/project_galaxy_tool_util.py
index c6440bf685a..4f526958884 100644
--- a/packages/tool_util/galaxy/project_galaxy_tool_util.py
+++ b/packages/tool_util/galaxy/project_galaxy_tool_util.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-__version__ = '19.9.0.dev1'
+__version__ = '19.9.0.dev2'
PROJECT_NAME = "galaxy-tool-util"
PROJECT_OWNER = PROJECT_USERAME = "galaxyproject"
diff --git a/packages/tool_util/setup.py b/packages/tool_util/setup.py
index 9645f9942fd..33bf10b7794 100644
--- a/packages/tool_util/setup.py
+++ b/packages/tool_util/setup.py
@@ -53,6 +53,7 @@ PACKAGE_DATA = {
'galaxy': [
'tool_util/deps/mulled/invfile.lua',
'tool_util/deps/resolvers/default_conda_mapping.yml',
+ 'tool_util/xsd/galaxy.xsd',
],
}
PACKAGE_DIR = {
diff --git a/packages/util/galaxy/project_galaxy_util.py b/packages/util/galaxy/project_galaxy_util.py
index 1333aebadd2..c5a4d0ce99a 100644
--- a/packages/util/galaxy/project_galaxy_util.py
+++ b/packages/util/galaxy/project_galaxy_util.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-__version__ = '19.9.0.dev2'
+__version__ = '19.9.0.dev3'
PROJECT_NAME = "galaxy-util"
PROJECT_OWNER = PROJECT_USERAME = "galaxyproject"
diff --git a/packages/util/requirements.txt b/packages/util/requirements.txt
index 3290e4ad496..e15e5db251e 100644
--- a/packages/util/requirements.txt
+++ b/packages/util/requirements.txt
@@ -1,7 +1,6 @@
bleach
boltons
bz2file; python_version < '3.3'
-Cheetah3
docutils
markupsafe
packaging
diff --git a/packages/util/setup.py b/packages/util/setup.py
index ee54c34e225..1227150c7b1 100644
--- a/packages/util/setup.py
+++ b/packages/util/setup.py
@@ -80,6 +80,10 @@ setup(
package_dir=PACKAGE_DIR,
include_package_data=True,
install_requires=requirements,
+ extras_require={
+ 'template': ['future', 'Cheetah3'],
+ 'jstree': ['dictobj'],
+ },
license="AFL",
zip_safe=False,
keywords='galaxy',
diff --git a/run_tests.sh b/run_tests.sh
index 0efac9e7111..1236e8742cc 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -1,7 +1,6 @@
#!/bin/sh
-pwd_dir=$(pwd)
-cd `dirname $0`
+cd "$(dirname "$0")"
rm -f run_functional_tests.log
@@ -318,8 +317,8 @@ then
-e "GALAXY_TEST_DATABASE_TYPE=$db_type" \
-e "LC_ALL=C" \
--rm \
- -v `pwd`:/galaxy \
- -v `pwd`/test/docker/base/run_test_wrapper.sh:/usr/local/bin/run_test_wrapper.sh $DOCKER_IMAGE "$@"
+ -v "$(pwd)":/galaxy \
+ -v "$(pwd)"/test/docker/base/run_test_wrapper.sh:/usr/local/bin/run_test_wrapper.sh "$DOCKER_IMAGE" "$@"
exit $?
fi
@@ -374,7 +373,6 @@ do
api_script="./test/api"
shift 1
fi
- coverage_file="api_coverage.xml"
;;
-selenium|--selenium)
GALAXY_TEST_TOOL_CONF="config/tool_conf.xml.sample,test/functional/tools/samples_tool_conf.xml"
@@ -412,15 +410,15 @@ do
shift
;;
--external_url)
- GALAXY_TEST_EXTERNAL=$2
+ export GALAXY_TEST_EXTERNAL=$2
shift 2
;;
--external_master_key)
- GALAXY_CONFIG_MASTER_KEY=$2
+ export GALAXY_CONFIG_MASTER_API_KEY=$2
shift 2
;;
--external_user_key)
- GALAXY_TEST_USER_API_KEY=$2
+ export GALAXY_TEST_USER_API_KEY=$2
shift 2
;;
-f|-framework|--framework)
@@ -428,7 +426,6 @@ do
marker="-m tool"
test_script="pytest"
report_file="run_framework_tests.html"
- coverage_file="framework_coverage.xml"
framework_test=1;
shift 1
;;
@@ -437,7 +434,6 @@ do
marker="-m tool"
test_script="pytest"
report_file="run_framework_tests.html"
- coverage_file="main_tools_coverage.xml"
framework_test=1;
shift 1
;;
@@ -445,7 +441,6 @@ do
marker="-m data_manager"
test_script="pytest"
report_file="run_data_managers_tests.html"
- coverage_file="data_managers_coverage.xml"
data_managers_test=1;
shift 1
;;
@@ -454,7 +449,6 @@ do
marker="-m tool"
test_script="pytest"
report_file="run_migrated_tests.html"
- coverage_file="migrated_coverage.xml"
migrated_test=1;
shift
;;
@@ -463,7 +457,6 @@ do
marker="-m tool"
test_script="pytest"
report_file="run_installed_tests.html"
- coverage_file="installed_coverage.xml"
installed_test=1;
shift
;;
@@ -503,7 +496,6 @@ do
# Must have coverage installed (try `which coverage`) - only valid with --unit
# for now. Would be great to get this to work with functional tests though.
coverage_arg="--with-coverage"
- NOSE_WITH_COVERAGE=true
shift
;;
--debug)
@@ -515,7 +507,7 @@ do
-u|-unit|--unit)
report_file="run_unit_tests.html"
test_script="pytest"
- unit_extra='--doctest-modules --ignore lib/galaxy/web/proxy/js/node_modules/ --ignore lib/galaxy/webapps/tool_shed/controllers --ignore lib/galaxy/jobs/runners/chronos.py --ignore lib/galaxy/webapps/tool_shed/model/migrate --ignore lib/galaxy/util/jstree.py'
+ unit_extra='--doctest-modules --ignore lib/galaxy/web/proxy/js/node_modules/ --ignore lib/galaxy/webapps/tool_shed/controllers --ignore lib/galaxy/jobs/runners/chronos.py --ignore lib/galaxy/webapps/tool_shed/model/migrate'
if [ $# -gt 1 ]; then
unit_extra="$unit_extra $2"
shift 2
@@ -523,7 +515,6 @@ do
unit_extra="$unit_extra lib test/unit"
shift 1
fi
- coverage_file="unit_coverage.xml"
;;
-i|-integration|--integration)
GALAXY_TEST_TOOL_CONF="config/tool_conf.xml.sample,test/functional/tools/samples_tool_conf.xml"
@@ -535,7 +526,6 @@ do
else
integration_extra="./test/integration"
shift 1
- coverage_file="integration_coverage.xml"
fi
;;
--no_cleanup)
@@ -616,7 +606,7 @@ elif [ -n "$toolshed_script" ]; then
elif [ -n "$api_script" ]; then
extra_args="$api_script"
elif [ -n "$section_id" ]; then
- extra_args=`python tool_list.py $section_id`
+ extra_args=$(python tool_list.py "$section_id")
elif [ -n "$unit_extra" ]; then
extra_args="$unit_extra"
elif [ -n "$integration_extra" ]; then
@@ -645,8 +635,8 @@ else
fi
export GALAXY_TEST_TOOL_CONF
if [ "$test_script" = 'pytest' ]; then
- if [ "$coverage_arg" = "--with_coverage" ]; then
- coverage_arg="--cov-report term --cov-report xml:cov-unit.xml --cov=lib"
+ if [ "$coverage_arg" = '--with-coverage' ]; then
+ coverage_arg="--cov-report term --cov=lib"
fi
"$test_script" -v --html "$report_file" $coverage_arg $xunit_args $extra_args "$@"
else
diff --git a/scripts/cleanup_datasets/delete_datasets.sh b/scripts/cleanup_datasets/delete_datasets.sh
index 501c234a8d5..e7dfb3f6874 100644
--- a/scripts/cleanup_datasets/delete_datasets.sh
+++ b/scripts/cleanup_datasets/delete_datasets.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -6 -r $@ >> ./scripts/cleanup_datasets/delete_datasets.log
+cd "$(dirname "$0")"/../..
+python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -6 -r "$@" >> ./scripts/cleanup_datasets/delete_datasets.log
diff --git a/scripts/cleanup_datasets/delete_userless_histories.sh b/scripts/cleanup_datasets/delete_userless_histories.sh
index 72d68db72ec..9bb8c70882f 100644
--- a/scripts/cleanup_datasets/delete_userless_histories.sh
+++ b/scripts/cleanup_datasets/delete_userless_histories.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -1 $@ >> ./scripts/cleanup_datasets/delete_userless_histories.log
+cd "$(dirname "$0")"/../..
+python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -1 "$@" >> ./scripts/cleanup_datasets/delete_userless_histories.log
diff --git a/scripts/cleanup_datasets/populate_uuid.sh b/scripts/cleanup_datasets/populate_uuid.sh
index ac2028462cf..c12c5240c19 100644
--- a/scripts/cleanup_datasets/populate_uuid.sh
+++ b/scripts/cleanup_datasets/populate_uuid.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-cd `dirname $0`/../..
+cd "$(dirname "$0")"/../..
export PYTHONPATH=./lib/
-python ./scripts/cleanup_datasets/populate_uuid.py ./config/galaxy.ini $@
+python ./scripts/cleanup_datasets/populate_uuid.py ./config/galaxy.ini "$@"
diff --git a/scripts/cleanup_datasets/purge_datasets.sh b/scripts/cleanup_datasets/purge_datasets.sh
index e4405015c50..6d5c12bb880 100644
--- a/scripts/cleanup_datasets/purge_datasets.sh
+++ b/scripts/cleanup_datasets/purge_datasets.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -3 -r $@ >> ./scripts/cleanup_datasets/purge_datasets.log
+cd "$(dirname "$0")"/../..
+python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -3 -r "$@" >> ./scripts/cleanup_datasets/purge_datasets.log
diff --git a/scripts/cleanup_datasets/purge_folders.sh b/scripts/cleanup_datasets/purge_folders.sh
index ff970d0ac8e..d02b7671e6f 100644
--- a/scripts/cleanup_datasets/purge_folders.sh
+++ b/scripts/cleanup_datasets/purge_folders.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -5 -r $@ >> ./scripts/cleanup_datasets/purge_folders.log
+cd "$(dirname "$0")"/../..
+python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -5 -r "$@" >> ./scripts/cleanup_datasets/purge_folders.log
diff --git a/scripts/cleanup_datasets/purge_histories.sh b/scripts/cleanup_datasets/purge_histories.sh
index 66e9f3d285f..8c7ff274d4a 100644
--- a/scripts/cleanup_datasets/purge_histories.sh
+++ b/scripts/cleanup_datasets/purge_histories.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -2 -r $@ >> ./scripts/cleanup_datasets/purge_histories.log
+cd "$(dirname "$0")"/../..
+python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -2 -r "$@" >> ./scripts/cleanup_datasets/purge_histories.log
diff --git a/scripts/cleanup_datasets/purge_libraries.sh b/scripts/cleanup_datasets/purge_libraries.sh
index 6a96b30268d..9e66e05cb5c 100644
--- a/scripts/cleanup_datasets/purge_libraries.sh
+++ b/scripts/cleanup_datasets/purge_libraries.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -4 -r $@ >> ./scripts/cleanup_datasets/purge_libraries.log
+cd "$(dirname "$0")"/../..
+python ./scripts/cleanup_datasets/cleanup_datasets.py -d 10 -4 -r "$@" >> ./scripts/cleanup_datasets/purge_libraries.log
diff --git a/scripts/cleanup_datasets/update_metadata.sh b/scripts/cleanup_datasets/update_metadata.sh
index 7933a0d9ebb..a78325d8ee7 100644
--- a/scripts/cleanup_datasets/update_metadata.sh
+++ b/scripts/cleanup_datasets/update_metadata.sh
@@ -6,4 +6,4 @@
. ./scripts/get_python.sh
. ./setup_paths.sh
-$GALAXY_PYTHON ./scripts/cleanup_datasets/update_metadata.py ./config/galaxy.ini $@
+"$GALAXY_PYTHON" ./scripts/cleanup_datasets/update_metadata.py ./config/galaxy.ini "$@"
diff --git a/scripts/db_shell.py b/scripts/db_shell.py
index 2ec27eb2db4..ddf85059796 100644
--- a/scripts/db_shell.py
+++ b/scripts/db_shell.py
@@ -58,8 +58,7 @@ def printquery(statement, bind=None):
import sqlalchemy.orm
if isinstance(statement, sqlalchemy.orm.Query):
if bind is None:
- bind = statement.session.get_bind(
- statement._mapper_zero_or_none())
+ bind = statement.session.get_bind()
statement = statement.statement
elif bind is None:
bind = statement.bind
diff --git a/scripts/maintenance.sh b/scripts/maintenance.sh
index 8ca4771ed54..e45d11bb603 100755
--- a/scripts/maintenance.sh
+++ b/scripts/maintenance.sh
@@ -6,7 +6,7 @@
set -e
display_help(){
- scriptname=`basename $0`
+ scriptname=$(basename "$0")
printf "./$scriptname [--help] [--no-dry-run] [--days 10]
Will run the galaxy cleanup scripts in the recommend order. By default a 'dry-run' is started. Specify --no-dry-run to do the actual cleanup.
@@ -52,7 +52,7 @@ do
esac
done
-cd "$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"/../
+cd "$(dirname "$0")"/..
. scripts/common_startup_functions.sh
diff --git a/scripts/migrate_tools/0002_tools.sh b/scripts/migrate_tools/0002_tools.sh
index 926aba9529d..7262196b5a9 100644
--- a/scripts/migrate_tools/0002_tools.sh
+++ b/scripts/migrate_tools/0002_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0002_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0002_tools.xml "$@"
diff --git a/scripts/migrate_tools/0003_tools.sh b/scripts/migrate_tools/0003_tools.sh
index dfc3bde56b3..f8a1ba8bb16 100644
--- a/scripts/migrate_tools/0003_tools.sh
+++ b/scripts/migrate_tools/0003_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0003_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0003_tools.xml "$@"
diff --git a/scripts/migrate_tools/0004_tools.sh b/scripts/migrate_tools/0004_tools.sh
index 40b76956fa2..7ae608f3683 100644
--- a/scripts/migrate_tools/0004_tools.sh
+++ b/scripts/migrate_tools/0004_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0004_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0004_tools.xml "$@"
diff --git a/scripts/migrate_tools/0005_tools.sh b/scripts/migrate_tools/0005_tools.sh
index c9f1f3c61d6..da7f9c09098 100644
--- a/scripts/migrate_tools/0005_tools.sh
+++ b/scripts/migrate_tools/0005_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0005_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0005_tools.xml "$@"
diff --git a/scripts/migrate_tools/0006_tools.sh b/scripts/migrate_tools/0006_tools.sh
index 1f000ebeca6..ff85522a5f9 100644
--- a/scripts/migrate_tools/0006_tools.sh
+++ b/scripts/migrate_tools/0006_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0006_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0006_tools.xml "$@"
diff --git a/scripts/migrate_tools/0007_tools.sh b/scripts/migrate_tools/0007_tools.sh
index a6cf948593d..8a88f44420c 100644
--- a/scripts/migrate_tools/0007_tools.sh
+++ b/scripts/migrate_tools/0007_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0007_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0007_tools.xml "$@"
diff --git a/scripts/migrate_tools/0008_tools.sh b/scripts/migrate_tools/0008_tools.sh
index 50cafd19936..d312237023b 100644
--- a/scripts/migrate_tools/0008_tools.sh
+++ b/scripts/migrate_tools/0008_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0008_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0008_tools.xml "$@"
diff --git a/scripts/migrate_tools/0009_tools.sh b/scripts/migrate_tools/0009_tools.sh
index 36f162b141c..78242fe2422 100644
--- a/scripts/migrate_tools/0009_tools.sh
+++ b/scripts/migrate_tools/0009_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0009_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0009_tools.xml "$@"
diff --git a/scripts/migrate_tools/0010_tools.sh b/scripts/migrate_tools/0010_tools.sh
index fde17704dd3..03c65dd9973 100644
--- a/scripts/migrate_tools/0010_tools.sh
+++ b/scripts/migrate_tools/0010_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0010_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0010_tools.xml "$@"
diff --git a/scripts/migrate_tools/0011_tools.sh b/scripts/migrate_tools/0011_tools.sh
index a31365804fd..e06a6be40b3 100644
--- a/scripts/migrate_tools/0011_tools.sh
+++ b/scripts/migrate_tools/0011_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0011_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0011_tools.xml "$@"
diff --git a/scripts/migrate_tools/0012_tools.sh b/scripts/migrate_tools/0012_tools.sh
index 97fbe354d04..2df312f980a 100644
--- a/scripts/migrate_tools/0012_tools.sh
+++ b/scripts/migrate_tools/0012_tools.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
-python ./scripts/migrate_tools/migrate_tools.py 0012_tools.xml $@
+cd "$(dirname "$0")"/../..
+python ./scripts/migrate_tools/migrate_tools.py 0012_tools.xml "$@"
diff --git a/scripts/pages_identifier_conversion.py b/scripts/pages_identifier_conversion.py
index ce914938f21..b9cec401071 100644
--- a/scripts/pages_identifier_conversion.py
+++ b/scripts/pages_identifier_conversion.py
@@ -9,12 +9,12 @@ sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pa
import galaxy
import galaxy.app
import galaxy.config
+from galaxy.managers.pages import PageContentProcessor, placeholderRenderForSave
from galaxy.objectstore import build_object_store_from_config
from galaxy.security.idencoding import IdEncodingHelper
from galaxy.util import unicodify
from galaxy.util.bunch import Bunch
from galaxy.util.script import app_properties_from_args, populate_config_args
-from galaxy.webapps.galaxy.controllers.page import _PageContentProcessor, _placeholderRenderForSave
def main(argv):
@@ -37,7 +37,7 @@ def main(argv):
mock_trans = Bunch(app=Bunch(security=security_helper), model=model, user_is_admin=lambda: True, sa_session=session)
for p in pagerevs:
try:
- processor = _PageContentProcessor(mock_trans, _placeholderRenderForSave)
+ processor = PageContentProcessor(mock_trans, placeholderRenderForSave)
processor.feed(p.content)
newcontent = unicodify(processor.output(), 'utf-8')
if p.content != newcontent:
diff --git a/scripts/tool_shed/migrate_tools_to_repositories.sh b/scripts/tool_shed/migrate_tools_to_repositories.sh
index e1108e20307..bbab9b1b333 100644
--- a/scripts/tool_shed/migrate_tools_to_repositories.sh
+++ b/scripts/tool_shed/migrate_tools_to_repositories.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-cd `dirname $0`/../..
+cd "$(dirname "$0")"/../..
python ./scripts/tool_shed/migrate_tools_to_repositories.py ./community_wsgi.ini >> ./scripts/tool_shed/migrate_tools_to_repositories.log
diff --git a/scripts/validate_tools.sh b/scripts/validate_tools.sh
index 16502e530d8..f57c1cb814a 100755
--- a/scripts/validate_tools.sh
+++ b/scripts/validate_tools.sh
@@ -1,33 +1,31 @@
#!/bin/sh
-cd `dirname $0`/..
+cd "$(dirname "$0")"/..
-./scripts/common_startup.sh
+GALAXY_SKIP_CLIENT_BUILD=1 ./scripts/common_startup.sh
GALAXY_VIRTUAL_ENV="${GALAXY_VIRTUAL_ENV:-.venv}"
-if [ -d "$GALAXY_VIRTUAL_ENV" ];
-then
+if [ -d "$GALAXY_VIRTUAL_ENV" ]; then
printf "Activating virtualenv at $GALAXY_VIRTUAL_ENV\n"
. "$GALAXY_VIRTUAL_ENV/bin/activate"
fi
-xsd_path="lib/galaxy/tools/xsd/galaxy.xsd"
+xsd_path="lib/galaxy/tool_util/xsd/galaxy.xsd"
-err_tmp=`mktemp`
+err_tmp=$(mktemp)
count=0
exit=0
for p in "$@"; do
count=$((count+1))
path="$p"
- echo $path
+ echo "$path"
PYTHONPATH=lib:$PYTHONPATH
export PYTHONPATH
- result=`python -c "import galaxy.tool_util.loader; import xml.etree; xml.etree.ElementTree.dump(galaxy.tool_util.loader.load_tool('$path').getroot())" | xmllint --nowarning --noout --schema "$xsd_path" - 2> "$err_tmp"`
- if [ $? -eq 0 ]
- then
+ python -c "import galaxy.tool_util.loader; import xml.etree; xml.etree.ElementTree.dump(galaxy.tool_util.loader.load_tool('$path').getroot())" | xmllint --nowarning --noout --schema "$xsd_path" - 2> "$err_tmp"
+ if [ $? -eq 0 ]; then
echo "ok $count";
else
echo "not ok $count $path";
- cat "$err_tmp" | sed 's/^/ /'
+ sed 's/^/ /' "$err_tmp"
exit=1
fi
done
diff --git a/templates/base.mako b/templates/base.mako
index 062d988ede5..8c6e3f2ba1d 100644
--- a/templates/base.mako
+++ b/templates/base.mako
@@ -65,7 +65,9 @@
${ galaxy_client.load( app=self.js_app ) }
${ galaxy_client.config_sentry( app=self.js_app ) }
- ${ galaxy_client.config_google_analytics( app=self.js_app ) }
+ %if self.js_app and self.js_app.config and self.js_app.config.ga_code:
+ ${ galaxy_client.config_google_analytics(self.js_app.config.ga_code) }
+ %endif
%if not form_input_auto_focus is UNDEFINED and form_input_auto_focus:
%if t.webapp.name == 'galaxy' and app.config.ga_code:
- ${galaxy_client.config_google_analytics(app)}
+ ${galaxy_client.config_google_analytics(app.config.ga_code)}
%endif
%def>
diff --git a/templates/embed_base.mako b/templates/embed_base.mako
index 1e7c74b2622..163f293392a 100644
--- a/templates/embed_base.mako
+++ b/templates/embed_base.mako
@@ -11,7 +11,6 @@
${self.render_title( item )}