Skip to content

Commit

Permalink
feat: be smarter about build number bumps
Browse files Browse the repository at this point in the history
this makes `bioconductor-skeleton update-all-packages` idempotent, which
is convenient when the update process fails halfway for some reason.
  • Loading branch information
daler committed Dec 2, 2023
1 parent e6d3cac commit afc4bf2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion bioconda_utils/bioconductor_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,19 @@ def write_recipe(package, recipe_dir, config, bioc_data_packages=None, force=Fal
(updated_version == current_version) and
(updated_meta != current_meta)
):
proj.build_number = int(current_build_number) + 1
# Sometimes when updating all packages, the updating process fails
# partway. Re-running the updating process should not bump the
# build number if no builds for this version exist yet in the repo.
existing_bldnos = utils.RepoData().get_package_data(
key="build_number",
name="bioconductor-" + proj.package.lower(),
version=updated_version
)
if not existing_bldnos:
proj.build_number = 0
else:
proj.build_number = sorted([int(i) for i in existing_bldnos]) [-1] + 1

if 'extra' in current_meta:
exclude = set(['final', 'copy_test_source_files'])
proj.extra = {x: y for x, y in current_meta['extra'].items() if x not in exclude}
Expand Down

0 comments on commit afc4bf2

Please sign in to comment.