lockss-turtles 0.4.0.dev1__py3-none-any.whl → 0.4.0.dev3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
CHANGELOG.rst CHANGED
@@ -14,6 +14,8 @@ Released: ?
14
14
 
15
15
  * New ``directory``/``rcs`` file naming convention ``underscore``: replace ``.`` in the plugin identifier by ``_`` and add ``.jar``.
16
16
 
17
+ * CLI improvements.
18
+
17
19
  * **Changes**
18
20
 
19
21
  * The ``--output-format`` option is now only available in the context of commands where it makes sense.
@@ -28,7 +28,7 @@
28
28
  # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
29
  # POSSIBILITY OF SUCH DAMAGE.
30
30
 
31
- __version__ = '0.4.0-dev1'
31
+ __version__ = '0.4.0-dev3'
32
32
 
33
33
  __copyright__ = '''
34
34
  Copyright (c) 2000-2023, Board of Trustees of Leland Stanford Jr. University
lockss/turtles/cli.py CHANGED
@@ -31,9 +31,11 @@
31
31
  import argparse
32
32
  import getpass
33
33
  from pathlib import Path
34
- import tabulate
35
34
  import sys
36
35
 
36
+ import rich_argparse
37
+ import tabulate
38
+
37
39
  import lockss.turtles
38
40
  from lockss.turtles.app import TurtlesApp
39
41
  from lockss.turtles.plugin_registry import PluginRegistryLayer
@@ -162,7 +164,7 @@ class TurtlesCli(object):
162
164
  if self._identifiers is None:
163
165
  self._identifiers = list()
164
166
  self._identifiers.extend(self._args.remainder)
165
- self._identifiers.extend(self._args.get_identifier)
167
+ self._identifiers.extend(self._args.identifier)
166
168
  for path in self._args.identifiers:
167
169
  self._identifiers.extend(_file_lines(path))
168
170
  if len(self._identifiers) == 0:
@@ -297,9 +299,17 @@ class TurtlesCli(object):
297
299
  help='add the layers in %(metavar)s to the list of plugin registry layers to process')
298
300
 
299
301
  def _make_parser(self):
300
- self._parser = argparse.ArgumentParser(prog=TurtlesCli.PROG)
302
+ for cls in [rich_argparse.RichHelpFormatter]:
303
+ cls.styles.update({
304
+ 'argparse.args': f'bold {cls.styles["argparse.args"]}',
305
+ 'argparse.groups': f'bold {cls.styles["argparse.groups"]}',
306
+ 'argparse.metavar': f'bold {cls.styles["argparse.metavar"]}',
307
+ 'argparse.prog': f'bold {cls.styles["argparse.prog"]}',
308
+ })
309
+ self._parser = argparse.ArgumentParser(prog=TurtlesCli.PROG,
310
+ formatter_class=rich_argparse.RichHelpFormatter)
301
311
  self._subparsers = self._parser.add_subparsers(title='commands',
302
- description="Add --help to see the command's own help message",
312
+ description="Add --help to see the command's own help message.",
303
313
  # With subparsers, metavar is also used as the heading of the column of subcommands
304
314
  metavar='COMMAND',
305
315
  # With subparsers, help is used as the heading of the column of subcommand descriptions
@@ -326,8 +336,9 @@ class TurtlesCli(object):
326
336
 
327
337
  def _make_parser_build_plugin(self, container):
328
338
  parser = container.add_parser('build-plugin', aliases=['bp'],
329
- description='Build (package and sign) plugins',
330
- help='build (package and sign) plugins')
339
+ description='Build (package and sign) plugins.',
340
+ help='build (package and sign) plugins',
341
+ formatter_class=self._parser.formatter_class)
331
342
  parser.set_defaults(fun=self._build_plugin)
332
343
  self._make_option_output_format(parser)
333
344
  self._make_option_password(parser)
@@ -337,14 +348,16 @@ class TurtlesCli(object):
337
348
 
338
349
  def _make_parser_copyright(self, container):
339
350
  parser = container.add_parser('copyright',
340
- description='Show copyright and exit',
341
- help='show copyright and exit')
351
+ description='Show copyright and exit.',
352
+ help='show copyright and exit',
353
+ formatter_class=self._parser.formatter_class)
342
354
  parser.set_defaults(fun=self._copyright)
343
355
 
344
356
  def _make_parser_deploy_plugin(self, container):
345
357
  parser = container.add_parser('deploy-plugin', aliases=['dp'],
346
- description='Deploy plugins',
347
- help='deploy plugins')
358
+ description='Deploy plugins.',
359
+ help='deploy plugins',
360
+ formatter_class=self._parser.formatter_class)
348
361
  parser.set_defaults(fun=self._deploy_plugin)
349
362
  self._make_option_output_format(parser)
350
363
  self._make_option_plugin_registry_catalog(parser)
@@ -355,14 +368,16 @@ class TurtlesCli(object):
355
368
 
356
369
  def _make_parser_license(self, container):
357
370
  parser = container.add_parser('license',
358
- description='Show license and exit',
359
- help='show license and exit')
371
+ description='Show license and exit.',
372
+ help='show license and exit',
373
+ formatter_class=self._parser.formatter_class)
360
374
  parser.set_defaults(fun=self._license)
361
375
 
362
376
  def _make_parser_release_plugin(self, container):
363
377
  parser = container.add_parser('release-plugin', aliases=['rp'],
364
- description='Release (build and deploy) plugins',
365
- help='release (build and deploy) plugins')
378
+ description='Release (build and deploy) plugins.',
379
+ help='release (build and deploy) plugins',
380
+ formatter_class=self._parser.formatter_class)
366
381
  parser.set_defaults(fun=self._release_plugin)
367
382
  self._make_option_output_format(parser)
368
383
  self._make_option_password(parser)
@@ -376,14 +391,16 @@ class TurtlesCli(object):
376
391
 
377
392
  def _make_parser_usage(self, container):
378
393
  parser = container.add_parser('usage',
379
- description='Show detailed usage and exit',
380
- help='show detailed usage and exit')
394
+ description='Show detailed usage and exit.',
395
+ help='show detailed usage and exit',
396
+ formatter_class=self._parser.formatter_class)
381
397
  parser.set_defaults(fun=self._usage)
382
398
 
383
399
  def _make_parser_version(self, container):
384
400
  parser = container.add_parser('version',
385
- description='Show version and exit',
386
- help='show version and exit')
401
+ description='Show version and exit.',
402
+ help='show version and exit',
403
+ formatter_class=self._parser.formatter_class)
387
404
  parser.set_defaults(fun=self._version)
388
405
 
389
406
  def _obtain_password(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lockss-turtles
3
- Version: 0.4.0.dev1
3
+ Version: 0.4.0.dev3
4
4
  Summary: Tool to manage LOCKSS plugin sets and LOCKSS plugin registries
5
5
  Home-page: https://www.lockss.org/
6
6
  License: BSD-3-Clause
@@ -23,6 +23,7 @@ Classifier: Topic :: Utilities
23
23
  Requires-Dist: java-manifest (>=1.1.0,<2.0.0)
24
24
  Requires-Dist: jsonschema (>=4.17.3,<5.0.0)
25
25
  Requires-Dist: pyyaml (>=6.0,<7.0)
26
+ Requires-Dist: rich-argparse (>=1.1.0,<2.0.0)
26
27
  Requires-Dist: tabulate (>=0.9.0,<0.10.0)
27
28
  Requires-Dist: xdg (>=6.0.0,<7.0.0)
28
29
  Project-URL: Repository, https://github.com/lockss/lockss-turtles
@@ -32,6 +33,9 @@ Description-Content-Type: text/x-rst
32
33
  Turtles
33
34
  =======
34
35
 
36
+ .. |RELEASE| replace:: 0.4.0-dev3
37
+ .. |RELEASE_DATE| replace:: ?
38
+
35
39
  .. |HELP| replace:: ``--help/-h``
36
40
  .. |IDENTIFIER| replace:: ``--identifier/-i``
37
41
  .. |IDENTIFIERS| replace:: ``--identifiers/-I``
@@ -47,7 +51,7 @@ Turtles
47
51
 
48
52
  Turtles is a tool to manage LOCKSS plugin sets and LOCKSS plugin registries.
49
53
 
50
- **Latest release:** 0.4.0-dev1 (?)
54
+ **Latest release:** |RELEASE| (|RELEASE_DATE|)
51
55
 
52
56
  -----------------
53
57
  Table of Contents
@@ -292,7 +296,16 @@ Maven Plugin Set Builder Prerequisites
292
296
  Maven Plugin Set Builder Declaration
293
297
  ++++++++++++++++++++++++++++++++++++
294
298
 
295
- For this plugin set builder type, the ``builder`` object in the plugin set definition has the following structure:
299
+ For this plugin set builder type, the ``builder`` object in the plugin set definition has the following structure::
300
+
301
+ ---
302
+ kind: PluginSet
303
+ id: ...
304
+ name: ...
305
+ builder:
306
+ type: mvn
307
+ main: ...
308
+ test: ...
296
309
 
297
310
  ``type``
298
311
  *Required.* Must be set to ``mvn``.
@@ -320,7 +333,16 @@ Ant Plugin Set Builder Prerequisites
320
333
  Ant Plugin Set Builder Declaration
321
334
  ++++++++++++++++++++++++++++++++++
322
335
 
323
- For this plugin set builder type, the ``builder`` object in the plugin set definition has the following structure:
336
+ For this plugin set builder type, the ``builder`` object in the plugin set definition has the following structure::
337
+
338
+ ---
339
+ kind: PluginSet
340
+ id: ...
341
+ name: ...
342
+ builder:
343
+ type: ant
344
+ main: ...
345
+ test: ...
324
346
 
325
347
  ``type``
326
348
  *Required.* Must be set to ``ant``.
@@ -370,12 +392,6 @@ A plugin registry is defined by a YAML document::
370
392
  type: ...
371
393
  ...
372
394
  layers:
373
- - id: testing
374
- name: My Plugin Registry (Testing)
375
- path: /path/to/testing
376
- - id: production
377
- name: My Plugin Registry (Production)
378
- path: /path/to/production
379
395
  - ...
380
396
  plugin-identifiers:
381
397
  - edu.myuniversity.plugin.publisherx.PublisherXPlugin
@@ -411,7 +427,7 @@ The contents are described below:
411
427
  ``plugin-identifiers``
412
428
  *Required.* Non-empty list of the plugin identifiers in this plugin registry.
413
429
 
414
- ``plugin-identifiers``
430
+ ``suppressed-plugin-identifiers``
415
431
  *Optional.* Non-empty list of plugin identifiers that are excluded from this plugin registry.
416
432
 
417
433
  Turtles does not currently do anything with this information, but it can be used to record plugins that have been abandoned or retracted over the lifetime of the plugin registry.
@@ -438,12 +454,33 @@ None.
438
454
  Directory Plugin Registry Layout Declaration
439
455
  ++++++++++++++++++++++++++++++++++++++++++++
440
456
 
441
- For this plugin registry layout type, the ``layout`` object in the plugin registry definition has the following structure:
457
+ For this plugin registry layout type, the ``layout`` object in the plugin registry definition has the following structure::
458
+
459
+ ---
460
+ kind: PluginRegistry
461
+ id: ...
462
+ name: ...
463
+ layout:
464
+ type: directory
465
+ file-naming-convention: ...
466
+ layers:
467
+ - ...
468
+ plugin-identifiers:
469
+ - ...
470
+ suppressed-plugin-identifiers:
471
+ - ...
442
472
 
443
473
  ``type``
444
474
  *Required.* Must be set to ``directory``.
445
475
 
446
- Currently, this layout type does not support the ``file-naming-convention`` option of the `RCS Plugin Registry Layout`_, but this feature will be introduced in a future release.
476
+ ``file-naming-convention``
477
+ *Optional.* A rule for what to name each deployed JAR file. If unspecified, the behavior is that of ``identifier``. Can be one of:
478
+
479
+ * ``identifier``: Use the plugin identifier and add ``.jar``. For example ``edu.myuniversity.plugin.publisherx.PublisherXPlugin`` results in ``edu.myuniversity.plugin.publisherx.PublisherXPlugin.jar``.
480
+
481
+ * ``underscore``: Replace ``.`` in the plugin identifier with ``_``, and add ``.jar``. For example ``edu.myuniversity.plugin.publisherx.PublisherXPlugin`` results in ``edu_myuniversity_plugin_publisherx_PublisherXPlugin.jar``.
482
+
483
+ * ``abbreviated``: Use the last dotted component of the plugin identifier and add ``.jar``. For example ``edu.myuniversity.plugin.publisherx.PublisherXPlugin`` results in ``PublisherXPlugin.jar``.
447
484
 
448
485
  RCS Plugin Registry Layout
449
486
  --------------------------
@@ -458,7 +495,21 @@ RCS Plugin Registry Layout Prerequisites
458
495
  RCS Plugin Registry Layout Declaration
459
496
  ++++++++++++++++++++++++++++++++++++++
460
497
 
461
- For this plugin registry layout type, the ``layout`` object in the plugin registry definition has the following structure:
498
+ For this plugin registry layout type, the ``layout`` object in the plugin registry definition has the following structure::
499
+
500
+ ---
501
+ kind: PluginRegistry
502
+ id: ...
503
+ name: ...
504
+ layout:
505
+ type: rcs
506
+ file-naming-convention: ...
507
+ layers:
508
+ - ...
509
+ plugin-identifiers:
510
+ - ...
511
+ suppressed-plugin-identifiers:
512
+ - ...
462
513
 
463
514
  ``type``
464
515
  *Required.* Must be set to ``rcs``.
@@ -468,7 +519,9 @@ For this plugin registry layout type, the ``layout`` object in the plugin regist
468
519
 
469
520
  * ``identifier``: Use the plugin identifier and add ``.jar``. For example ``edu.myuniversity.plugin.publisherx.PublisherXPlugin`` results in ``edu.myuniversity.plugin.publisherx.PublisherXPlugin.jar``.
470
521
 
471
- * ``abbreviated``: Use the last component of the plugin identifier and add ``.jar``. For example ``edu.myuniversity.plugin.publisherx.PublisherXPlugin`` results in ``PublisherXPlugin.jar``.
522
+ * ``underscore``: Replace ``.`` in the plugin identifier with ``_``, and add ``.jar``. For example ``edu.myuniversity.plugin.publisherx.PublisherXPlugin`` results in ``edu_myuniversity_plugin_publisherx_PublisherXPlugin.jar``.
523
+
524
+ * ``abbreviated``: Use the last dotted component of the plugin identifier and add ``.jar``. For example ``edu.myuniversity.plugin.publisherx.PublisherXPlugin`` results in ``PublisherXPlugin.jar``.
472
525
 
473
526
  Plugin Registry Layers
474
527
  ======================
@@ -483,7 +536,27 @@ Although the identifiers (see ``id`` below) and display names (see ``name`` belo
483
536
 
484
537
  It is possible for multiple plugin registries to have a layer ``path`` in common. An example would be a team working on several plugin registries for different purposes, having distinct (public) production layer paths, but sharing a single (internal) testing layer path, if they are the only audience for it.
485
538
 
486
- A plugin registry layer is defined as one of the objects in the plugin registry definition's ``layers`` list. Each layer object has the following structure:
539
+ A plugin registry layer is defined as one of the objects in the plugin registry definition's ``layers`` list. Each layer object has the following structure::
540
+
541
+ ---
542
+ kind: PluginRegistry
543
+ id: ...
544
+ name: ...
545
+ layout:
546
+ type: ...
547
+ ...
548
+ layers:
549
+ - id: testing
550
+ name: My Plugin Registry (Testing)
551
+ path: /path/to/testing
552
+ - id: production
553
+ name: My Plugin Registry (Production)
554
+ path: /path/to/production
555
+ - ...
556
+ plugin-identifiers:
557
+ - ...
558
+ suppressed-plugin-identifiers:
559
+ - ...
487
560
 
488
561
  ``id``
489
562
  *Required.* A short identifier for the plugin registry layer, for example ``testing``.
@@ -598,7 +671,7 @@ The top-level executable alone does not perform any action or default to a given
598
671
  disallow interactive prompts (default: allow)
599
672
 
600
673
  commands:
601
- Add --help to see the command's own help message
674
+ Add --help to see the command's own help message.
602
675
 
603
676
  COMMAND DESCRIPTION
604
677
  build-plugin (bp) build (package and sign) plugins
@@ -623,7 +696,7 @@ The ``build-plugin`` command is used for `Building Plugins`_. It has its own |HE
623
696
  [--identifier PLUGID] [--identifiers FILE]
624
697
  [PLUGID ...]
625
698
 
626
- Build (package and sign) plugins
699
+ Build (package and sign) plugins.
627
700
 
628
701
  options:
629
702
  -h, --help show this help message and exit
@@ -668,6 +741,8 @@ The command needs:
668
741
 
669
742
  * One or more plugin identifiers, from the `Plugin Identifier Arguments and Options`_ (bare arguments, |IDENTIFIER| options, |IDENTIFIERS| options).
670
743
 
744
+ It also accepts `Options`_ for `Output Format Control`_
745
+
671
746
  Examples::
672
747
 
673
748
  # Help message
@@ -711,7 +786,7 @@ The ``deploy-plugin`` command is used for `Deploying Plugins`_. It has its own |
711
786
  [--layer LAYER] [--layers FILE]
712
787
  [PLUGJAR ...]
713
788
 
714
- Deploy plugins
789
+ Deploy plugins.
715
790
 
716
791
  options:
717
792
  -h, --help show this help message and exit
@@ -765,6 +840,8 @@ The command needs:
765
840
 
766
841
  * The JAR paths found in the files listed as |JARS| options.
767
842
 
843
+ It also accepts `Options`_ for `Output Format Control`_.
844
+
768
845
  Examples::
769
846
 
770
847
  # Help message
@@ -814,7 +891,7 @@ The ``release-plugin`` command is used for `Building Plugins`_ and `Deploying Pl
814
891
  [--layers FILE]
815
892
  [PLUGID ...]
816
893
 
817
- Release (build and deploy) plugins
894
+ Release (build and deploy) plugins.
818
895
 
819
896
  options:
820
897
  -h, --help show this help message and exit
@@ -882,6 +959,8 @@ The command needs:
882
959
 
883
960
  * One or more plugin identifiers, from the `Plugin Identifier Arguments and Options`_ (bare arguments, |IDENTIFIER| options, |IDENTIFIERS| options).
884
961
 
962
+ It also accepts `Options`_ for `Output Format Control`_.
963
+
885
964
  Examples::
886
965
 
887
966
  # Help message
@@ -1,8 +1,8 @@
1
- CHANGELOG.rst,sha256=q-WdgxGyEUiHVUiqg6JgxKlHxfCGfY9dCVMYatb0HZ8,3133
2
- lockss/turtles/__init__.py,sha256=mASwMXUfE67Vvo3sr8WnczkWPC6qjIpmfa6Gm51yc5Y,3201
1
+ CHANGELOG.rst,sha256=Lv-bS9-c4dtclJrtlNr8HymmhR283_WgqERmG-Qqg8A,3158
2
+ lockss/turtles/__init__.py,sha256=51WIQO-8H8jLDlJIE4s8kIbzN_Ucz3yvwC3L_EHkMfo,3201
3
3
  lockss/turtles/__main__.py,sha256=57NMiI-NAibLExMX0Y6QApQhaDUblHTQqCDSiWBVt6k,1633
4
4
  lockss/turtles/app.py,sha256=X6AoOPPJEKrhcT9kwNXp7J7XO3KLoXdLdozgKf49Ajw,9074
5
- lockss/turtles/cli.py,sha256=YN0tCk_kCCpSjgIB-y5wpvtP4tg3S2wLFvxntmqJapI,21367
5
+ lockss/turtles/cli.py,sha256=yZqmRrGSY_4aMAv6nvx-ax6Lab_ckoNg1BVsOuoGm1U,22476
6
6
  lockss/turtles/plugin.py,sha256=ewDT3d_QPKnQqO_zuiD2XQaDcJSzoVDPylmFPe_OELU,4312
7
7
  lockss/turtles/plugin_registry.py,sha256=8MXzfybo-0jmBgIQlcTMbLvJVgU3ZsYomdP0PnMh2RM,9445
8
8
  lockss/turtles/plugin_set.py,sha256=jB8fGMwsYdXcZab_GRcvTahVCnjW94AkyWeHlgg7qLc,10486
@@ -13,8 +13,8 @@ lockss/turtles/resources/plugin-set-catalog-schema.json,sha256=UbB0BCd9jdROGyXf2
13
13
  lockss/turtles/resources/plugin-set-schema.json,sha256=EeptOiipJdWwfLIxUHXap59Hbq32UXzT2MpI2eADM1U,2338
14
14
  lockss/turtles/resources/plugin-signing-credentials-schema.json,sha256=VLld14jOMG8V_ru0jtQD5GunNDNLp2MoRGMSZg9xVn8,753
15
15
  lockss/turtles/util.py,sha256=g3pGADgnmaQce3pNrpA1VjuSlNUJUAITyPyM6pNdVOA,2430
16
- lockss_turtles-0.4.0.dev1.dist-info/LICENSE,sha256=ArAnVWK-WhSxCVQWDF_PWBETwjSZ35HfugnUJPqPXyg,1506
17
- lockss_turtles-0.4.0.dev1.dist-info/METADATA,sha256=L_Yz1e1aYFBFNY-vRX3OJf91uQ_V6vzjKFhevkPO4xs,37326
18
- lockss_turtles-0.4.0.dev1.dist-info/WHEEL,sha256=kLuE8m1WYU0Ig0_YEGrXyTtiJvKPpLpDEiChiNyei5Y,88
19
- lockss_turtles-0.4.0.dev1.dist-info/entry_points.txt,sha256=25BAVFSBRKWAWiXIGZgcr1ypt2mV7nj31Jl8WcNZZOk,51
20
- lockss_turtles-0.4.0.dev1.dist-info/RECORD,,
16
+ lockss_turtles-0.4.0.dev3.dist-info/LICENSE,sha256=ArAnVWK-WhSxCVQWDF_PWBETwjSZ35HfugnUJPqPXyg,1506
17
+ lockss_turtles-0.4.0.dev3.dist-info/METADATA,sha256=_6t341PXJGg_osEaHNh7Q5GVGE3X9Vx6R-ZJmJJvREU,39406
18
+ lockss_turtles-0.4.0.dev3.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
19
+ lockss_turtles-0.4.0.dev3.dist-info/entry_points.txt,sha256=25BAVFSBRKWAWiXIGZgcr1ypt2mV7nj31Jl8WcNZZOk,51
20
+ lockss_turtles-0.4.0.dev3.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.5.1
2
+ Generator: poetry-core 1.5.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any