galaxyproject / planemo

Command-line utilities to assist in developing Galaxy and Common Workflow Language artifacts - including tools, workflows, and training materials.
https://planemo.readthedocs.io/
MIT License
90 stars 85 forks source link

test command doesnt reflect documented API #1186

Closed Jo-stfc closed 3 years ago

Jo-stfc commented 3 years ago

test command runs as: planemo test runnable/path tool/path instead of: planemo test --galaxy_root=runnable/path tool/path

the runnable that's passed into for_runnable_identifiers is the first nonflagged argument passed, irrespective of wether the galaxy root has been set. The Python version I'm using is 3.9.7

mvdbeek commented 3 years ago

I think you're misunderstanding something there? The tool path is the runnable thing, and --galaxy_root can point to a galaxy instance you already have on disk. The documented usage is this

Usage: planemo test [OPTIONS] TOOL_PATH

which you can modify with all of the options listed in planemo --help. If you have any suggestions for improving the help section let us know

Jo-stfc commented 3 years ago

Maybe that wasnt clear, I have a tool xml in pm_muairss_write/pm_muairss_write.xml and galaxy installed in muon-galaxy folder. running planemo test --galaxy_root=muon-galaxy pm_muairss_write will give this error: can't copy '/pm_muairss_write/muon-galaxy/lib/galaxy/webapps/base/static/style/base.css': doesn't exist or not a regular file where it tries to find base galaxy files within the tool folder

mvdbeek commented 3 years ago

I don't quite understand your filesystem layout, but you can't have galaxy inside of your tool folder, is that the problem ?

Jo-stfc commented 3 years ago

I dont have it within the tool folder. I've tried both with the tool folder within galaxy/tools and as a sibling folder to the galaxy root. Both give the same error

mvdbeek commented 3 years ago

Can you post the command you're running and the output ? I think something is going quite wrong there. fwiw this is working correctly:

planemo test --galaxy_root=~/src/galaxy ~/src/tools-iuc/tools/minimap2/minimap2.xml
Jo-stfc commented 3 years ago

planemo test planemo test --galaxy_root=~/muon-galaxy ~/muon-galaxy/tools/muon-galaxy-tools/pm_muairss_write/pm_muairss_write.xml

planemo test planemo test --galaxy_root=~/muon-galaxy ~/muon-galaxy-tools/pm_muairss_write/pm_muairss_write.xml

Traceback (most recent call last): File "\~/.local/bin/planemo", line 8, in sys.exit(planemo()) File "\~/.local/lib/python3.9/site-packages/click/core.py", line 1137, in call return self.main(args, kwargs) File "\~/.local/lib/python3.9/site-packages/click/core.py", line 1062, in main rv = self.invoke(ctx) File "\~/.local/lib/python3.9/site-packages/click/core.py", line 1668, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "\~/.local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "\~/.local/lib/python3.9/site-packages/click/core.py", line 763, in invoke return __callback(args, kwargs) File "\~/.local/lib/python3.9/site-packages/click/decorators.py", line 84, in new_func return ctx.invoke(f, obj, *args, *kwargs) File "\~/.local/lib/python3.9/site-packages/click/core.py", line 763, in invoke return __callback(args, kwargs) File "\~/.local/lib/python3.9/site-packages/planemo/cli.py", line 98, in handle_blended_options return f(*args, **kwds) File "\~/.local/lib/python3.9/site-packages/planemo/commands/cmd_test.py", line 72, in cli runnables = for_runnable_identifiers(ctx, uris, kwds, temp_path=temp_path) File "\~/.local/lib/python3.9/site-packages/planemo/runnable_resolve.py", line 33, in for_runnable_identifiers runnable = for_runnable_identifier(ctx, r, kwds, temp_path=temp_path, return_all=True) File "\~/.local/lib/python3.9/site-packages/planemo/runnable_resolve.py", line 21, in for_runnable_identifier runnable = for_path(runnable_identifier, temp_path=temp_path, return_all=return_all) File "\~/.local/lib/python3.9/site-packages/planemo/runnable.py", line 227, in for_path path = _copy_runnable_tree(path, runnable_type, temp_path) File "\~/.local/lib/python3.9/site-packages/planemo/runnable.py", line 164, in _copy_runnable_tree copy_tree(dir_to_copy, temp_path, update=True) File "/usr/local/lib/python3.9/distutils/dir_util.py", line 157, in copy_tree copy_tree(src_name, dst_name, preserve_mode, File "/usr/local/lib/python3.9/distutils/dir_util.py", line 157, in copy_tree copy_tree(src_name, dst_name, preserve_mode, File "/usr/local/lib/python3.9/distutils/dir_util.py", line 157, in copy_tree copy_tree(src_name, dst_name, preserve_mode, [Previous line repeated 4 more times] File "/usr/local/lib/python3.9/distutils/dir_util.py", line 161, in copy_tree copy_file(src_name, dst_name, preserve_mode, File "/usr/local/lib/python3.9/distutils/file_util.py", line 104, in copy_file raise DistutilsFileError( distutils.errors.DistutilsFileError: can't copy '~/muon-galaxy/tools/muon-galaxy-tools/pm_muairss_write/muon-galaxy/lib/galaxy/webapps/base/static/style/base.css': doesn't exist or not a regular file

Jo-stfc commented 3 years ago

this seems to have been an issue with the installed galaxy instance than planemo. It's been resolved now