def execute(args): parser, args = parse_args(args) config = Config(**args.__dict__) build.check_external() # change globals in build module, see comment there as well channel_urls = args.__dict__.get('channel') or args.__dict__.get( 'channels') or () config.channel_urls = [] for url in channel_urls: # allow people to specify relative or absolute paths to local channels # These channels still must follow conda rules - they must have the # appropriate platform-specific subdir (e.g. win-64) if os.path.isdir(url): if not os.path.isabs(url): url = os.path.normpath( os.path.abspath(os.path.join(os.getcwd(), url))) url = url_path(url) config.channel_urls.append(url) config.override_channels = args.override_channels config.verbose = not args.quiet or args.debug if 'purge' in args.recipe: build.clean_build(config) return if 'purge-all' in args.recipe: build.clean_build(config) config.clean_pkgs() return action = None if args.output: action = output_action config.verbose = False config.quiet = True config.debug = False elif args.test: action = test_action elif args.source: action = source_action elif args.check: action = check_action if action: outputs = [action(recipe, config) for recipe in args.recipe] else: outputs = api.build(args.recipe, post=args.post, build_only=args.build_only, notest=args.notest, already_built=None, config=config, noverify=args.no_verify) if not args.output and len(utils.get_build_folders(config.croot)) > 0: build.print_build_intermediate_warning(config) return outputs
def execute(args): parser, args = parse_args(args) config = Config(**args.__dict__) build.check_external() # change globals in build module, see comment there as well channel_urls = args.__dict__.get('channel') or args.__dict__.get('channels') or () config.channel_urls = [] for url in channel_urls: # allow people to specify relative or absolute paths to local channels # These channels still must follow conda rules - they must have the # appropriate platform-specific subdir (e.g. win-64) if os.path.isdir(url): if not os.path.isabs(url): url = os.path.normpath(os.path.abspath(os.path.join(os.getcwd(), url))) url = url_path(url) config.channel_urls.append(url) config.override_channels = args.override_channels config.verbose = not args.quiet or args.debug if 'purge' in args.recipe: build.clean_build(config) return if 'purge-all' in args.recipe: build.clean_build(config) config.clean_pkgs() return action = None if args.output: action = output_action config.verbose = False config.quiet = True config.debug = False elif args.test: action = test_action elif args.source: action = source_action elif args.check: action = check_action if action: outputs = [action(recipe, config) for recipe in args.recipe] else: outputs = api.build(args.recipe, post=args.post, build_only=args.build_only, notest=args.notest, already_built=None, config=config, noverify=args.no_verify) if not args.output and len(utils.get_build_folders(config.croot)) > 0: build.print_build_intermediate_warning(config) return outputs
def publish(c, recipe): config = CondaConfig() config.verbose = False config.debug = False spinner = Halo( text=f"Deriving conda build package paths for `{recipe}` recipe...", spinner="dots", ) spinner.start() package_paths = conda_build_api.get_output_file_paths(recipe, config=config) spinner.succeed(f"Derived the following paths: {package_paths}") for p in package_paths: if not Path(p).exists(): raise exceptions.Exit( f"{Fore.RED}ERROR:{Style.RESET_ALL} Conda package path `{p}` does not exist! Please run " f"`$ inv build {recipe}` to build this package.", code=1, ) packages = " ".join(package_paths) c.run(f"anaconda upload {packages}") print(f"{Fore.CYAN}Publish done!")
def execute(args): _parser, args = parse_args(args) config = Config(**args.__dict__) build.check_external() # change globals in build module, see comment there as well channel_urls = args.__dict__.get('channel') or args.__dict__.get( 'channels') or () config.channel_urls = [] for url in channel_urls: # allow people to specify relative or absolute paths to local channels # These channels still must follow conda rules - they must have the # appropriate platform-specific subdir (e.g. win-64) if os.path.isdir(url): if not os.path.isabs(url): url = os.path.normpath( os.path.abspath(os.path.join(os.getcwd(), url))) url = url_path(url) config.channel_urls.append(url) config.override_channels = args.override_channels config.verbose = not args.quiet or args.debug if 'purge' in args.recipe: build.clean_build(config) return if 'purge-all' in args.recipe: build.clean_build(config) config.clean_pkgs() return action = None outputs = None if args.output: action = output_action config.verbose = False config.quiet = True config.debug = False elif args.test: action = test_action elif args.source: action = source_action elif args.check: action = check_action if action == test_action: failed_recipes = [] recipes = [ item for sublist in [ glob(os.path.abspath(recipe)) if '*' in recipe else [recipe] for recipe in args.recipe ] for item in sublist ] for recipe in recipes: try: action(recipe, config) except: if not args.keep_going: raise else: failed_recipes.append(recipe) continue if failed_recipes: print("Failed recipes:") for recipe in failed_recipes: print(" - %s" % recipe) sys.exit(len(failed_recipes)) else: print("All tests passed") outputs = [] elif action: outputs = [action(recipe, config) for recipe in args.recipe] else: outputs = api.build(args.recipe, post=args.post, build_only=args.build_only, notest=args.notest, already_built=None, config=config, verify=args.verify, variants=args.variants) if not args.output and len(utils.get_build_folders(config.croot)) > 0: build.print_build_intermediate_warning(config) return outputs
def execute(args): _parser, args = parse_args(args) config = Config(**args.__dict__) build.check_external() # change globals in build module, see comment there as well config.channel_urls = get_channel_urls(args.__dict__) config.override_channels = args.override_channels config.verbose = not args.quiet or args.debug if 'purge' in args.recipe: build.clean_build(config) return if 'purge-all' in args.recipe: build.clean_build(config) config.clean_pkgs() return action = None outputs = None if args.output: action = output_action config.verbose = False config.quiet = True config.debug = False elif args.test: action = test_action elif args.source: action = source_action elif args.check: action = check_action if action == test_action: failed_recipes = [] recipes = [item for sublist in [glob(os.path.abspath(recipe)) if '*' in recipe else [recipe] for recipe in args.recipe] for item in sublist] for recipe in recipes: try: action(recipe, config) except: if not args.keep_going: raise else: failed_recipes.append(recipe) continue if failed_recipes: print("Failed recipes:") for recipe in failed_recipes: print(" - %s" % recipe) sys.exit(len(failed_recipes)) else: print("All tests passed") outputs = [] elif action: outputs = [action(recipe, config) for recipe in args.recipe] else: outputs = api.build(args.recipe, post=args.post, test_run_post=args.test_run_post, build_only=args.build_only, notest=args.notest, already_built=None, config=config, verify=args.verify, variants=args.variants) if not args.output and len(utils.get_build_folders(config.croot)) > 0: build.print_build_intermediate_warning(config) return outputs
def execute(args): parser, args = parse_args(args) config = Config(**args.__dict__) build.check_external() # change globals in build module, see comment there as well channel_urls = args.__dict__.get('channel') or args.__dict__.get('channels') or () config.channel_urls = [] for url in channel_urls: # allow people to specify relative or absolute paths to local channels # These channels still must follow conda rules - they must have the # appropriate platform-specific subdir (e.g. win-64) if os.path.isdir(url): if not os.path.isabs(url): url = os.path.normpath(os.path.abspath(os.path.join(os.getcwd(), url))) url = url_path(url) config.channel_urls.append(url) config.override_channels = args.override_channels config.verbose = not args.quiet or args.debug if 'purge' in args.recipe: build.clean_build(config) return if 'purge-all' in args.recipe: build.clean_build(config) config.clean_pkgs() return action = None outputs = None if args.output: action = output_action config.verbose = False config.quiet = True config.debug = False elif args.test: action = test_action elif args.source: action = source_action elif args.check: action = check_action if action == test_action: failed_recipes = [] recipes = [item for sublist in [glob(os.path.abspath(recipe)) if '*' in recipe else [recipe] for recipe in args.recipe] for item in sublist] for recipe in recipes: try: action(recipe, config) except: if not args.keep_going: raise else: failed_recipes.append(recipe) continue if failed_recipes: print("Failed recipes:") for recipe in failed_recipes: print(" - %s" % recipe) sys.exit(len(failed_recipes)) else: print("All tests passed") outputs = [] elif action: outputs = [action(recipe, config) for recipe in args.recipe] else: outputs = api.build(args.recipe, post=args.post, build_only=args.build_only, notest=args.notest, already_built=None, config=config, verify=args.verify, variants=args.variants) if not args.output and len(utils.get_build_folders(config.croot)) > 0: build.print_build_intermediate_warning(config) return outputs