Skip to content

Commit 0a1abfe

Browse files
committed
First crack at containers documentation and related usability improvements.
- Implement ``planemo lint --biocontainer`` to mirror ``planemo lint --conda_requirements``. Just checks that a tool is ready to go with best practice namespaces for BioContainers tools. - Implement test case for new linting flag. - Add new section of documentation to advanced tool topics for containers. Work through examples of both an existing working container (seqtk) and one that must be built on the fly. Demonstrate ``planemo mull``. - Hack around a bug in Conda 4.2 that makes it so ``planemo mull`` doesn't work out of the box on Mac OS X. - Add more options and more documentation to the ``planemo mull`` command.
1 parent 9af67bf commit 0a1abfe

16 files changed

+478
-13
lines changed

docs/_writing_dependencies_conda.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _dependencies_and_conda:
2+
13
Dependencies and Conda
24
===========================================
35

docs/_writing_dependencies_docker.rst

Lines changed: 319 additions & 0 deletions
Large diffs are not rendered by default.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686

8787
# List of patterns, relative to source directory, that match files and
8888
# directories to ignore when looking for source files.
89-
exclude_patterns = ['_build']
89+
exclude_patterns = ['_build', '_*']
9090

9191
# The reST default role (used for this markup: `text`) to use for all
9292
# documents.

docs/planemo.commands.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ planemo.commands.cmd_clone module
6868
:undoc-members:
6969
:show-inheritance:
7070

71+
planemo.commands.cmd_conda_build module
72+
---------------------------------------
73+
74+
.. automodule:: planemo.commands.cmd_conda_build
75+
:members:
76+
:undoc-members:
77+
:show-inheritance:
78+
7179
planemo.commands.cmd_conda_env module
7280
-------------------------------------
7381

docs/planemo.linters.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ planemo.linters package
44
Submodules
55
----------
66

7+
planemo.linters.biocontainer_registered module
8+
----------------------------------------------
9+
10+
.. automodule:: planemo.linters.biocontainer_registered
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
715
planemo.linters.conda_requirements module
816
-----------------------------------------
917

docs/writing_advanced.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ available - check out tutorial_ if you have never developed a Galaxy tool.
1414
.. include:: _writing_tool_metadata.rst
1515
.. include:: _writing_clusters.rst
1616
.. include:: _writing_dependencies_conda.rst
17+
.. include:: _writing_dependencies_docker.rst
1718

1819
.. _Galaxy: http://galaxyproject.org/
1920
.. _Docker: https://www.docker.com/

planemo/commands/cmd_docker_shell.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def cli(ctx, path, **kwds):
6464
if container.type == "docker":
6565
identifier = container.identifier
6666

67+
# Refactor mulled container resolver to be able to do this.
6768
if kwds["from_tag"]:
6869
identifier = "-t %s" % identifier
6970

planemo/commands/cmd_lint.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
default=False,
3434
help="Check tool requirements for availability in best practice Conda channels.",
3535
)
36+
@click.option(
37+
"--biocontainer",
38+
is_flag=True,
39+
default=False,
40+
help="Check best practice BioContainer namespaces for a container definition applicable for this tool.",
41+
)
3642
# @click.option(
3743
# "--verify",
3844
# is_flag=True,

planemo/commands/cmd_mull.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@click.command('mull')
1414
@options.optional_tools_arg(multiple=True)
1515
@options.recursive_option()
16+
@options.mulled_options()
17+
@options.conda_ensure_channels_option()
1618
@command_function
1719
def cli(ctx, paths, **kwds):
1820
"""Build containers for specified tools.
@@ -30,4 +32,5 @@ def cli(ctx, paths, **kwds):
3032
for conda_targets in collect_conda_target_lists(ctx, paths):
3133
mulled_targets = map(lambda c: build_target(c.package, c.version), conda_targets)
3234
mull_target_kwds = build_mull_target_kwds(ctx, **kwds)
33-
mull_targets(mulled_targets, command="build", **mull_target_kwds)
35+
command = kwds["mulled_command"]
36+
mull_targets(mulled_targets, command=command, **mull_target_kwds)

planemo/lint.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
urlopen,
1616
)
1717

18+
import planemo.linters.biocontainer_registered
1819
import planemo.linters.conda_requirements
1920
import planemo.linters.doi
2021
import planemo.linters.urls
@@ -60,6 +61,9 @@ def _lint_extra_modules(**kwds):
6061
if kwds.get("conda_requirements", False):
6162
linters.append(planemo.linters.conda_requirements)
6263

64+
if kwds.get("biocontainer", False):
65+
linters.append(planemo.linters.biocontainer_registered)
66+
6367
return linters
6468

6569

0 commit comments

Comments
 (0)