@@ -407,6 +407,8 @@ def publish_module (args):
407
407
args .password = getpass ()
408
408
au .publish_module (args .module , args .user , args .password , overwrite = args .overwrite , include_data = args .data )
409
409
410
+
411
+
410
412
def install_base (args ):
411
413
args = SimpleNamespace (modules = constants .base_modules ,
412
414
force_data = args .force_data ,
@@ -417,8 +419,11 @@ def install_base (args):
417
419
force = args .force ,
418
420
skip_data = False ,
419
421
install_pypi_dependency = args .install_pypi_dependency ,
420
- md = args .md
422
+ md = args .md ,
423
+ user_email = args .user_email ,
424
+ user_email_opt_out = args .user_email_opt_out
421
425
)
426
+ au .request_user_email (args )
422
427
install_modules (args )
423
428
424
429
def create_account (args ):
@@ -535,119 +540,128 @@ def show_version (args):
535
540
default = None ,
536
541
help = 'Specify the root directory of OpenCRAVAT modules'
537
542
)
543
+ parser_install_base .add_argument ('--user-email' ,
544
+ dest = 'user_email' ,
545
+ help = 'User email for OpenCravat metrics'
546
+ )
547
+ parser_install_base .add_argument ('--user-email-opt-out' ,
548
+ dest = 'user_email_opt_out' ,
549
+ action = 'store_true' ,
550
+ help = 'Opt out of providing a user email for OpenCravat metrics'
551
+ )
538
552
parser_install_base .set_defaults (func = install_base )
539
553
540
554
# install
541
555
parser_install = subparsers .add_parser ('install' ,
542
- help = 'installs modules.' ,
543
- description = 'installs modules.' )
556
+ help = 'installs modules.' ,
557
+ description = 'installs modules.' )
544
558
parser_install .add_argument ('modules' ,
545
- nargs = '+' ,
546
- help = 'Modules to install. May be regular expressions.'
559
+ nargs = '+' ,
560
+ help = 'Modules to install. May be regular expressions.'
547
561
)
548
562
parser_install .add_argument ('-v' ,'--version' ,
549
- help = 'Install a specific version'
563
+ help = 'Install a specific version'
550
564
)
551
565
parser_install .add_argument ('-f' ,'--force' ,
552
- action = 'store_true' ,
553
- help = 'Install module even if latest version is already installed' ,
566
+ action = 'store_true' ,
567
+ help = 'Install module even if latest version is already installed' ,
554
568
)
555
569
parser_install .add_argument ('-d' , '--force-data' ,
556
- action = 'store_true' ,
557
- help = 'Download data even if latest data is already installed'
570
+ action = 'store_true' ,
571
+ help = 'Download data even if latest data is already installed'
558
572
)
559
573
parser_install .add_argument ('-y' ,'--yes' ,
560
- action = 'store_true' ,
561
- help = 'Proceed without prompt'
574
+ action = 'store_true' ,
575
+ help = 'Proceed without prompt'
562
576
)
563
577
parser_install .add_argument ('--skip-dependencies' ,
564
- action = 'store_true' ,
565
- help = 'Skip installing dependencies'
578
+ action = 'store_true' ,
579
+ help = 'Skip installing dependencies'
566
580
)
567
581
parser_install .add_argument ('-p' ,'--private' ,
568
- action = 'store_true' ,
569
- help = 'Install a private module'
582
+ action = 'store_true' ,
583
+ help = 'Install a private module'
570
584
)
571
585
parser_install .add_argument ('--skip-data' ,
572
- action = 'store_true' ,
573
- help = 'Skip installing data'
586
+ action = 'store_true' ,
587
+ help = 'Skip installing data'
574
588
)
575
589
parser_install .add_argument ('--install-pypi-dependency' ,
576
- action = 'store_true' ,
577
- default = True ,
578
- help = 'Try to install non-OpenCRAVAT package dependency with pip'
590
+ action = 'store_true' ,
591
+ default = True ,
592
+ help = 'Try to install non-OpenCRAVAT package dependency with pip'
579
593
)
580
594
parser_install .add_argument ('--md' ,
581
- default = None ,
582
- help = 'Specify the root directory of OpenCRAVAT modules'
595
+ default = None ,
596
+ help = 'Specify the root directory of OpenCRAVAT modules'
583
597
)
584
598
parser_install .set_defaults (func = install_modules )
585
599
586
600
# update
587
601
update_examples = ExampleCommandsFormatter (prefix = 'cravat-admin update' )
588
602
update_examples .add_example ('' ,
589
- '''Enter an interactive update process. Cravat
590
- will check to see which modules need to
591
- be updated, and will ask you if you wish to update them.''' )
603
+ '''Enter an interactive update process. Cravat
604
+ will check to see which modules need to
605
+ be updated, and will ask you if you wish to update them.''' )
592
606
update_examples .add_example ('hg38 aggregator vcf-converter' ,
593
- '''Only attempt update on the hg38, aggregator,
594
- and vcf-converter modules.''' )
607
+ '''Only attempt update on the hg38, aggregator,
608
+ and vcf-converter modules.''' )
595
609
parser_update = subparsers .add_parser ('update' ,
596
- help = 'updates modules.' ,
597
- description = 'updates modules.' ,
598
- epilog = str (update_examples ),
599
- formatter_class = argparse .RawDescriptionHelpFormatter )
610
+ help = 'updates modules.' ,
611
+ description = 'updates modules.' ,
612
+ epilog = str (update_examples ),
613
+ formatter_class = argparse .RawDescriptionHelpFormatter )
600
614
parser_update .add_argument ('modules' ,
601
- nargs = '*' ,
602
- help = 'Modules to update.' )
615
+ nargs = '*' ,
616
+ help = 'Modules to update.' )
603
617
parser_update .add_argument ('-y' ,
604
- action = 'store_true' ,
605
- help = 'Proceed without prompt'
606
- )
618
+ action = 'store_true' ,
619
+ help = 'Proceed without prompt'
620
+ )
607
621
parser_update .add_argument ('--strategy' ,
608
- help = 'Dependency resolution strategy. "consensus" will attemp to resolve dependencies. "force" will install the highest available version. "skip" will skip modules with constraints.' ,
609
- default = 'consensus' ,
610
- type = str ,
611
- choices = ('consensus' ,'force' ,'skip' )
612
- )
622
+ help = 'Dependency resolution strategy. "consensus" will attemp to resolve dependencies. "force" will install the highest available version. "skip" will skip modules with constraints.' ,
623
+ default = 'consensus' ,
624
+ type = str ,
625
+ choices = ('consensus' ,'force' ,'skip' )
626
+ )
613
627
parser_update .add_argument ('--install-pypi-dependency' ,
614
- action = 'store_true' ,
615
- default = True ,
616
- help = 'Try to install non-OpenCRAVAT package dependency with pip'
628
+ action = 'store_true' ,
629
+ default = True ,
630
+ help = 'Try to install non-OpenCRAVAT package dependency with pip'
617
631
)
618
632
parser_update .add_argument ('--md' ,
619
- default = None ,
620
- help = 'Specify the root directory of OpenCRAVAT modules'
633
+ default = None ,
634
+ help = 'Specify the root directory of OpenCRAVAT modules'
621
635
)
622
636
parser_update .set_defaults (func = update_modules )
623
637
624
638
# uninstall
625
639
parser_uninstall = subparsers .add_parser ('uninstall' ,
626
- help = 'uninstalls modules.' )
640
+ help = 'uninstalls modules.' )
627
641
parser_uninstall .add_argument ('modules' ,
628
- nargs = '+' ,
629
- help = 'Modules to uninstall' )
642
+ nargs = '+' ,
643
+ help = 'Modules to uninstall' )
630
644
parser_uninstall .add_argument ('-y' ,'--yes' ,
631
- action = 'store_true' ,
632
- help = 'Proceed without prompt' )
645
+ action = 'store_true' ,
646
+ help = 'Proceed without prompt' )
633
647
parser_uninstall .add_argument ('--md' ,
634
- default = None ,
635
- help = 'Specify the root directory of OpenCRAVAT modules'
648
+ default = None ,
649
+ help = 'Specify the root directory of OpenCRAVAT modules'
636
650
)
637
651
parser_uninstall .set_defaults (func = uninstall_modules )
638
652
639
653
# info
640
654
parser_info = subparsers .add_parser ('info' ,
641
- help = 'shows module information.' )
655
+ help = 'shows module information.' )
642
656
parser_info .add_argument ('module' ,
643
- help = 'Module to get info about' )
657
+ help = 'Module to get info about' )
644
658
parser_info .add_argument ('-l' ,'--local' ,
645
- dest = 'local' ,
646
- help = 'Include local info' ,
647
- action = 'store_true' )
659
+ dest = 'local' ,
660
+ help = 'Include local info' ,
661
+ action = 'store_true' )
648
662
parser_info .add_argument ('--md' ,
649
- default = None ,
650
- help = 'Specify the root directory of OpenCRAVAT modules'
663
+ default = None ,
664
+ help = 'Specify the root directory of OpenCRAVAT modules'
651
665
)
652
666
parser_info .set_defaults (func = print_info )
653
667
@@ -658,35 +672,35 @@ def show_version (args):
658
672
ls_examples .add_example ('-a' , 'List all modules available on the store' )
659
673
ls_examples .add_example ('-a -t mapper' , 'List all mappers available on the store' )
660
674
parser_ls = subparsers .add_parser ('ls' ,
661
- help = 'lists modules.' ,
662
- description = 'lists modules.' ,
663
- epilog = str (ls_examples ),
664
- formatter_class = argparse .RawDescriptionHelpFormatter )
675
+ help = 'lists modules.' ,
676
+ description = 'lists modules.' ,
677
+ epilog = str (ls_examples ),
678
+ formatter_class = argparse .RawDescriptionHelpFormatter )
665
679
parser_ls .add_argument ('pattern' ,
666
- nargs = '?' ,
667
- default = r'.*' ,
668
- help = 'Regular expression for module names' )
680
+ nargs = '?' ,
681
+ default = r'.*' ,
682
+ help = 'Regular expression for module names' )
669
683
parser_ls .add_argument ('-a' ,'--available' ,
670
- action = 'store_true' ,
671
- help = 'Include available modules' )
684
+ action = 'store_true' ,
685
+ help = 'Include available modules' )
672
686
parser_ls .add_argument ('-t' ,'--types' ,
673
- nargs = '+' ,
674
- default = [],
675
- help = 'Only list modules of certain types' )
687
+ nargs = '+' ,
688
+ default = [],
689
+ help = 'Only list modules of certain types' )
676
690
parser_ls .add_argument ('-i' ,'--include-hidden' ,
677
- action = 'store_true' ,
678
- help = 'Include hidden modules' )
691
+ action = 'store_true' ,
692
+ help = 'Include hidden modules' )
679
693
parser_ls .add_argument ('--tags' ,
680
- nargs = '+' ,
681
- default = [],
682
- help = 'Only list modules of given tag(s)'
694
+ nargs = '+' ,
695
+ default = [],
696
+ help = 'Only list modules of given tag(s)'
683
697
)
684
698
parser_ls .add_argument ('-q' ,'--quiet' ,
685
- action = 'store_true' ,
686
- help = 'Only list module names' )
699
+ action = 'store_true' ,
700
+ help = 'Only list module names' )
687
701
parser_ls .add_argument ('--bytes' ,
688
- action = 'store_true' ,
689
- dest = 'raw_bytes' ,
702
+ action = 'store_true' ,
703
+ dest = 'raw_bytes' ,
690
704
help = 'Machine readable data sizes'
691
705
)
692
706
parser_ls .add_argument ('--md' ,
0 commit comments