From c7cf1772a489e4b344a794b490f9ca5cc23f8088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Tue, 5 Mar 2019 13:23:20 +0100 Subject: [PATCH 1/2] Remove superfluous logger setup. --- bioconda_utils/cli.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/bioconda_utils/cli.py b/bioconda_utils/cli.py index 5705294ea8..b1b28f11c5 100644 --- a/bioconda_utils/cli.py +++ b/bioconda_utils/cli.py @@ -633,8 +633,6 @@ def dependent(recipe_folder, config, restrict=False, raise ValueError( 'One of `--dependencies` or `--reverse-dependencies` is required.') - utils.setup_logger('bioconda_utils', loglevel) - d, n2r = graph.build(utils.get_recipes(recipe_folder, "*"), config, restrict=restrict) if reverse_dependencies is not None: @@ -694,7 +692,6 @@ def bioconductor_skeleton( and submit to conda-forge. """ - utils.setup_logger('bioconda_utils', loglevel) seen_dependencies = set() if package == "update-all-packages": From e592c57725465110ee518faf7110e84b0cf4a0bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Wed, 6 Mar 2019 06:36:14 +0100 Subject: [PATCH 2/2] Allow to restrict bioconductor-skeleton update to data packages. --- bioconda_utils/bioconductor_skeleton.py | 10 +++++++--- bioconda_utils/cli.py | 7 +++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bioconda_utils/bioconductor_skeleton.py b/bioconda_utils/bioconductor_skeleton.py index 9ffcfcd287..968bd53d56 100755 --- a/bioconda_utils/bioconductor_skeleton.py +++ b/bioconda_utils/bioconductor_skeleton.py @@ -874,7 +874,7 @@ def write_recipe_recursive(proj, seen_dependencies, recipe_dir, config, force, def write_recipe(package, recipe_dir, config, force=False, bioc_version=None, pkg_version=None, versioned=False, recursive=False, seen_dependencies=None, - packages=None, skip_if_in_channels=None): + packages=None, skip_if_in_channels=None, only_datapkgs=False): """ Write the meta.yaml and build.sh files. If the package is detected to be a data package (bsed on the detected URL from Bioconductor), then also @@ -922,6 +922,11 @@ def write_recipe(package, recipe_dir, config, force=False, bioc_version=None, """ config = utils.load_config(config) proj = BioCProjectPage(package, bioc_version, pkg_version, packages=packages) + + if only_datapkgs and not proj.is_data_package: + logger.info("Skipping non-data package {}".format(proj.package)) + return + logger.info('Making recipe for: {}'.format(package)) if seen_dependencies is None: @@ -972,7 +977,7 @@ def write_recipe(package, recipe_dir, config, force=False, bioc_version=None, ): proj.build_number = int(current_build_number) + 1 if 'extra' in current_meta: - exclude = set(['final', 'copy_test_source_files']) + exclude = set(['final', 'copy_test_source_files', 'parent_recipe']) proj.extra = {x: y for x, y in current_meta['extra'].items() if x not in exclude} with open(os.path.join(recipe_dir, 'meta.yaml'), 'w') as fout: @@ -1002,7 +1007,6 @@ def write_recipe(package, recipe_dir, config, force=False, bioc_version=None, proj.bioconductor_tarball_url, bioarchive_url(proj.package, proj.version, proj.bioc_version), cargoport_url(proj.package, proj.version, proj.bioc_version), - proj.cargoport_url ] if u is not None ] diff --git a/bioconda_utils/cli.py b/bioconda_utils/cli.py index b1b28f11c5..491463d6ca 100644 --- a/bioconda_utils/cli.py +++ b/bioconda_utils/cli.py @@ -669,11 +669,13 @@ def dependent(recipe_folder, config, restrict=False, @arg('--skip-if-in-channels', nargs='*', help="""When --recursive is used, it will build *all* recipes. Use this argument to skip recursive building for packages that already exist in the packages listed here.""") +@arg('--only-datapkgs', action='store_true', help="""Only consider data packages. + To be used in combination with 'update-all-packages'.""") @enable_logging('debug') def bioconductor_skeleton( recipe_folder, config, package, versioned=False, force=False, pkg_version=None, bioc_version=None, recursive=False, - skip_if_in_channels=['conda-forge', 'bioconda']): + skip_if_in_channels=['conda-forge', 'bioconda'], only_datapkgs=False): """ Build a Bioconductor recipe. The recipe will be created in the `recipes` directory and will be prefixed by "bioconductor-". If `--recursive` is set, @@ -704,7 +706,8 @@ def bioconductor_skeleton( _bioconductor_skeleton.write_recipe( k, recipe_folder, config, force=True, bioc_version=bioc_version, pkg_version=v['Version'], versioned=versioned, packages=packages, - skip_if_in_channels=skip_if_in_channels) + skip_if_in_channels=skip_if_in_channels, + only_datapkgs=only_datapkgs) except: problems.append(k) if len(problems):