def clone_all_feedstocks(organization, feedstocks_dir): ''' Clones all feedstock repos from organization to local feedstocks_dir. Uses conda-smithy's clone all utility. Parameters ---------- organization: str GitHub organization to clone feedstock repos from. feedstocks_dir: str Path to local directory to place cloned feedstocks. ''' from conda_smithy import feedstocks print(f'Cloning all feedstocks from {organization}...') feedstocks.clone_all(gh_org=organization, feedstocks_dir=feedstocks_dir)
import conda_smithy.lint_recipe import conda_smithy import conda_smithy.feedstocks as feedstocks parser = argparse.ArgumentParser(description=('Lint all of the feedstocks, ' 'raising issues if there is any.')) parser.add_argument('--feedstocks-dir', help="The location of the feedstocks.", default="~/dev/conda-forge/feedstocks") parser.add_argument('--regexp', help="Regexp of feedstocks to consider.", default=".*") args = parser.parse_args() feedstocks_dir = os.path.expanduser(args.feedstocks_dir) feedstocks.clone_all('conda-forge', feedstocks_dir) feedstocks.fetch_feedstocks(feedstocks_dir) regexp = re.compile(args.regexp) randomised_feedstocks = [feedstock for feedstock in feedstocks.cloned_feedstocks(feedstocks_dir) if regexp.match(feedstock.package)] random.shuffle(randomised_feedstocks) gh_token = conda_smithy.github.gh_token() gh = github.Github(gh_token) gh_forge = gh.get_organization('conda-forge') # Set to false to debug. if True: print("Collecting list of conda-forge repos...") forge_repos = {repo.name: repo for repo in gh_forge.get_repos()}
import conda_smithy.feedstocks as feedstocks parser = argparse.ArgumentParser( description=('Lint all of the feedstocks, ' 'raising issues if there is any.')) parser.add_argument('--feedstocks-dir', help="The location of the feedstocks.", default="~/dev/conda-forge/feedstocks") parser.add_argument('--regexp', help="Regexp of feedstocks to consider.", default=".*") args = parser.parse_args() feedstocks_dir = os.path.expanduser(args.feedstocks_dir) feedstocks.clone_all('conda-forge', feedstocks_dir) feedstocks.fetch_feedstocks(feedstocks_dir) regexp = re.compile(args.regexp) randomised_feedstocks = [ feedstock for feedstock in feedstocks.cloned_feedstocks(feedstocks_dir) if regexp.match(feedstock.package) ] random.shuffle(randomised_feedstocks) gh_token = conda_smithy.github.gh_token() gh = github.Github(gh_token) gh_forge = gh.get_organization('conda-forge') # Set to false to debug. if True: