def main(): parser = argparse.ArgumentParser( description='print git messages for a set of feedstocks.') parser.add_argument( 'feedstock_dir', nargs='*', help='one or more feedstock directories to prepare files for') parser.add_argument( '--file', '-f', type=str, help='file with feedstock directories to prepare files for') parser.add_argument( '--base_dir', default='.', type=str, help='feedstock base directory, default is current directory') args = parser.parse_args() feedstock_dirs = get_feedstock_dirs(args.feedstock_dir, args.file) for feedstock_dir in feedstock_dirs: if feedstock_dir.endswith('/'): feedstock_dir = feedstock_dir[:-1] show_git_message(feedstock_dir) return 0
def main(): parser = argparse.ArgumentParser( description='Push feedstock git changes to AnacondaRecipes.') parser.add_argument( 'feedstock_dir', nargs='*', help='one or more feedstock directories to push') parser.add_argument( '--file', '-f', type=str, help='file with feedstock directories to push') parser.add_argument( '--base_dir', default='.', type=str, help='feedstock base directory, default is current directory') parser.add_argument( '--log', default='info', help='log level; debug, info, warning, error, critical') args = parser.parse_args() # set up logging log_numeric_level = getattr(logging, args.log.upper(), None) if not isinstance(log_numeric_level, int): raise ValueError('Invalid log level: %s' % args.log) logging.basicConfig(level=log_numeric_level, format=LOG_FORMAT) # sync recipes feedstock_dirs = get_feedstock_dirs(args.feedstock_dir, args.file) for feedstock_dir in feedstock_dirs: if feedstock_dir.endswith('/'): feedstock_dir = feedstock_dir[:-1] logging.info('pushing: ' + feedstock_dir) feedstock_path = os.path.join(args.base_dir, feedstock_dir) if not push_feedstock(feedstock_path): logging.warning('push failed: ' + feedstock_dir) return 0
def main(): parser = argparse.ArgumentParser(description=( 'Find feedstocks which have changed since they were last checked')) parser.add_argument('feedstock_dir', nargs='*', help='one or more feedstock directories to check') parser.add_argument('--file', '-f', type=str, help='file with feedstock directories to check') parser.add_argument('--outfile', default='changed_feedstocks.txt', type=str, help='name of file to write changed feedstocks.') parser.add_argument( '--checkfile', default='cf_feedstock_commits.json', type=str, help='name of file to check and store the commit hashes') parser.add_argument('--remote-org', default='conda-forge', type=str, help='GitHub organization to check for updates.') parser.add_argument( '--base_dir', default='.', type=str, help='feedstock base directory, default is current directory') parser.add_argument( '--log', default='info', help='log level; debug, info, warning, error, critical') args = parser.parse_args() # set up logging log_numeric_level = getattr(logging, args.log.upper(), None) if not isinstance(log_numeric_level, int): raise ValueError('Invalid log level: %s' % args.log) logging.basicConfig(level=log_numeric_level, format=LOG_FORMAT) # find outdated feedstocks feedstock_dirs = get_feedstock_dirs(args.feedstock_dir, args.file) last_commits = read_last_commits(args.checkfile) changed_feedstocks = find_changed_feedstocks(feedstock_dirs, last_commits, args.remote_org) # write checkfile and outfile with open(args.checkfile, 'w') as f: json.dump(last_commits, f) with open(args.outfile, 'wt') as f: for changed_feedstock in changed_feedstocks: f.write(changed_feedstock + '\n') return 0
def main(): args = parse_args() feedstock_dirs = get_feedstock_dirs(args.feedstock_dir, args.file) # create report entires report_entries = [] for feedstock_name in feedstock_dirs: report_entries.append(create_report_entry( feedstock_name, args.label_prefix, args.concourse_url, args.base_dir, args.remote_org)) # write report make_report(report_entries, args.template, args.outfile) return 0
def main(): parser = argparse.ArgumentParser( description='Sync feedstocks with conda-forge by rebasing') parser.add_argument('feedstock_dir', nargs='*', help='one or more feedstock directories to sync') parser.add_argument('--file', '-f', type=str, help='file with feedstock directories to sync') parser.add_argument( '--outfile', help='file to write synced feedstocks, default is not to write') parser.add_argument( '--base_dir', default='.', type=str, help='feedstock base directory, default is current directory') parser.add_argument( '--log', default='info', help='log level; debug, info, warning, error, critical') args = parser.parse_args() # set up logging log_numeric_level = getattr(logging, args.log.upper(), None) if not isinstance(log_numeric_level, int): raise ValueError('Invalid log level: %s' % args.log) logging.basicConfig(level=log_numeric_level, format=LOG_FORMAT) # sync recipes feedstock_dirs = get_feedstock_dirs(args.feedstock_dir, args.file) successfully_rebased = [] for feedstock_dir in feedstock_dirs: if feedstock_dir.endswith('/'): feedstock_dir = feedstock_dir[:-1] logging.info('rebasing: ' + feedstock_dir) feedstock_path = os.path.join(args.base_dir, feedstock_dir) if sync_feedstock(feedstock_path): successfully_rebased.append(feedstock_path) else: logging.warning('rebase failed: ' + feedstock_dir) # write file of successfully rebased feedstocks if requested if args.outfile: with open(args.outfile, 'w') as f: for fs in successfully_rebased: f.write(str(pathlib.Path(fs)) + '\n') return 0
def main(): args = parse_arguments() if args.all: pathname = os.path.join(args.base_dir, '*-feedstock') feedstock_paths = sorted(glob.glob(pathname)) else: dirs = get_feedstock_dirs(args.feedstock_dir, args.file) feedstock_paths = [os.path.join(args.base_dir, d) for d in dirs] if not args.no_header: print("pkg_name,can_rebase,exact_rebase") for feedstock_path in feedstock_paths: can_be_rebased, is_exact = can_rebase(feedstock_path, args.upstream) pkg_name = (feedstock_path.replace('./', '').replace('/', '').replace( '-feedstock', '')) print(f'{pkg_name},{can_be_rebased},{is_exact}')
def main(): parser = argparse.ArgumentParser( description='Prepare recipe clobber file for a feedstock') parser.add_argument( 'feedstock_dir', nargs='*', help='one or more feedstock directories to prepare clobber file for') parser.add_argument( '--file', '-f', type=str, help='file with feedstock directories to prepare file for') parser.add_argument( '--base_dir', default='.', type=str, help='feedstock base directory, default is current directory') parser.add_argument( '--log', default='info', help='log level; debug, info, warning, error, critical') args = parser.parse_args() # set up logging log_numeric_level = getattr(logging, args.log.upper(), None) if not isinstance(log_numeric_level, int): raise ValueError('Invalid log level: %s' % args.log) logging.basicConfig(level=log_numeric_level, format=LOG_FORMAT) feedstock_dirs = get_feedstock_dirs(args.feedstock_dir, args.file) for feedstock_dir in feedstock_dirs: if feedstock_dir.endswith('/'): feedstock_dir = feedstock_dir[:-1] logging.info('preparing files for: ' + feedstock_dir) prep_clobber(feedstock_dir) return 0