def execute(args): parser, args = parse_args(args) if not args.subcommand: parser.print_help() exit() elif args.subcommand == 'channels': if not args.test_installable: parser.error("At least one option (--test-installable) is required.") else: print(api.test_installable(args.channel)) elif args.subcommand == 'linkages': print(api.inspect_linkages(args.packages, prefix=get_prefix(args), untracked=args.untracked, all_packages=args.all, show_files=args.show_files, groupby=args.groupby)) elif args.subcommand == 'objects': print(api.inspect_objects(args.packages, prefix=get_prefix(args), groupby=args.groupby)) elif args.subcommand == 'prefix-lengths': if not api.inspect_prefix_length(args.packages, min_prefix_length=args.min_prefix_length): sys.exit(1) elif args.subcommand == 'hash-inputs': pprint(api.inspect_hash_inputs(args.packages)) else: raise ValueError("Unrecognized subcommand: {0}.".format(args.subcommand))
def execute(args): parser, args = parse_args(args) if not args.subcommand: parser.print_help() exit() elif args.subcommand == 'channels': if not args.test_installable: parser.error( "At least one option (--test-installable) is required.") else: print(api.test_installable(args.channel)) elif args.subcommand == 'linkages': print( api.inspect_linkages(args.packages, prefix=get_prefix(args), untracked=args.untracked, all_packages=args.all, show_files=args.show_files, groupby=args.groupby)) elif args.subcommand == 'objects': print( api.inspect_objects(args.packages, prefix=get_prefix(args), groupby=args.groupby)) elif args.subcommand == 'prefix-lengths': if not api.inspect_prefix_length( args.packages, min_prefix_length=args.min_prefix_length): sys.exit(1) elif args.subcommand == 'hash-inputs': pprint(api.inspect_hash_inputs(args.packages)) else: raise ValueError("Unrecognized subcommand: {0}.".format( args.subcommand))
def test_channel_installable(): # make sure the default channel is installable as a reference assert api.test_installable('conda-team')