Skip to content

Commit 646cf2b

Browse files
committed
Create and use a temporary shed_data_manager_conf.xml
Otherwise installing a data manager from the Tool Shed under `planemo serve` adds it to the shed_data_manager_conf.xml file of the Galaxy repo. Also: - Fix Python3 compatibility - Remove duplicated statements
1 parent 0238498 commit 646cf2b

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

planemo/galaxy/config.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
from galaxy.tools.deps import docker_util
1717
from galaxy.tools.deps.commands import argv_to_str
1818

19-
from six import iteritems
19+
from six import (
20+
add_metaclass,
21+
iteritems
22+
)
2023
from six.moves.urllib.request import urlopen
2124
from six.moves.urllib.request import urlretrieve
2225

@@ -79,6 +82,10 @@
7982
</toolbox>
8083
"""
8184

85+
SHED_DATA_MANAGER_CONF_TEMPLATE = """<?xml version="1.0"?>
86+
<data_managers>
87+
</data_managers>
88+
"""
8289

8390
EMPTY_JOB_METRICS_TEMPLATE = """<?xml version="1.0"?>
8491
<job_metrics>
@@ -281,7 +288,6 @@ def config_join(*args):
281288

282289
tool_conf = config_join("tool_conf.xml")
283290

284-
tool_conf = config_join("tool_conf.xml")
285291
shed_tool_path = kwds.get("shed_tool_path") or config_join("shed_tools")
286292
_ensure_directory(shed_tool_path)
287293

@@ -393,7 +399,8 @@ def config_join(*args):
393399

394400
tool_conf = config_join("tool_conf.xml")
395401

396-
tool_conf = config_join("tool_conf.xml")
402+
shed_data_manager_config_file = config_join("shed_data_manager_conf.xml")
403+
397404
shed_tool_path = kwds.get("shed_tool_path") or config_join("shed_tools")
398405
_ensure_directory(shed_tool_path)
399406

@@ -461,6 +468,7 @@ def config_join(*args):
461468
amqp_internal_connection="sqlalchemy+sqlite://",
462469
migrated_tools_config=empty_tool_conf,
463470
test_data_dir=test_data_dir, # TODO: make gx respect this
471+
shed_data_manager_config_file=shed_data_manager_config_file,
464472
))
465473
_handle_container_resolution(ctx, kwds, properties)
466474
write_file(config_join("logging.ini"), _sub(LOGGING_TEMPLATE, template_args))
@@ -502,6 +510,8 @@ def config_join(*args):
502510
# Write a new shed_tool_conf.xml if needed.
503511
write_file(shed_tool_conf, shed_tool_conf_contents, force=False)
504512

513+
write_file(shed_data_manager_config_file, SHED_DATA_MANAGER_CONF_TEMPLATE)
514+
505515
pid_file = kwds.get("pid_file") or config_join("galaxy.pid")
506516

507517
yield LocalGalaxyConfig(
@@ -578,15 +588,14 @@ def _config_directory(ctx, **kwds):
578588
shutil.rmtree(config_directory)
579589

580590

591+
@add_metaclass(abc.ABCMeta)
581592
class GalaxyConfig(object):
582593
"""Abstraction around a Galaxy instance.
583594
584595
This requires more than just an API connection and assumes access to files
585596
etc....
586597
"""
587598

588-
__metaclass__ = abc.ABCMeta
589-
590599
@abc.abstractproperty
591600
def kill(self):
592601
"""Stop the running instance."""
@@ -1167,7 +1176,7 @@ def _build_env_for_galaxy(properties, template_args):
11671176

11681177

11691178
def _build_test_env(properties, env):
1170-
# Keeping these environment variables around for a little while but they
1179+
# Keeping these environment variables around for a little while but
11711180
# many are probably not needed as of the following commit.
11721181
# https://bitbucket.org/galaxy/galaxy-central/commits/d7dd1f9
11731182
test_property_variants = {

0 commit comments

Comments
 (0)