comparison env/lib/python3.9/site-packages/planemo/commands/cmd_shed_upload.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 """Module describing the planemo ``shed_upload`` command."""
2 import sys
3
4 import click
5
6 from planemo import options
7 from planemo import shed
8 from planemo.cli import command_function
9
10
11 tar_path = click.Path(
12 exists=True,
13 file_okay=True,
14 dir_okay=False,
15 resolve_path=True,
16 )
17
18
19 @click.command("shed_upload")
20 @options.shed_publish_options()
21 @options.shed_upload_options()
22 @click.option(
23 '--tar_only',
24 is_flag=True,
25 help="Produce tar file for upload but do not publish to a tool shed.",
26 )
27 @click.option(
28 '--tar',
29 help="Specify a pre-existing tar file instead of automatically building "
30 "one as part of this command.",
31 type=tar_path,
32 default=None,
33 )
34 @command_function
35 def cli(ctx, paths, **kwds):
36 """Low-level command to upload tarballs.
37
38 Generally, ``shed_update`` should be used instead since it also updates
39 both tool shed contents (via tar ball generation and upload) as well as
40 metadata (to handle metadata changes in ``.shed.yml`` files).
41
42 \b
43 % planemo shed_upload --tar_only ~/
44 % tar -tzf shed_upload.tar.gz
45 test-data/blastdb.loc
46 ...
47 tools/ncbi_blast_plus/tool_dependencies.xml
48 % tar -tzf shed_upload.tar.gz | wc -l
49 117
50
51 """
52 def upload(realized_repository):
53 return shed.upload_repository(ctx, realized_repository, **kwds)
54
55 exit_code = shed.for_each_repository(ctx, upload, paths, **kwds)
56 sys.exit(exit_code)