diff --git a/shared/vendored/.github/workflows/update-downstream-repos.yaml b/shared/vendored/.github/workflows/update-downstream-repos.yaml index 76860d9..98a45c3 100644 --- a/shared/vendored/.github/workflows/update-downstream-repos.yaml +++ b/shared/vendored/.github/workflows/update-downstream-repos.yaml @@ -5,6 +5,12 @@ on: branches: - main workflow_dispatch: + inputs: + force: + description: 'Pass --force to git subrepo pull' + type: boolean + required: false + default: false concurrency: group: ${{ github.workflow }} @@ -106,7 +112,7 @@ jobs: git switch -c "$branch" fi - git subrepo pull "$VENDORED_PATH" + git subrepo pull "$VENDORED_PATH" ${{ inputs.force && '--force' || '' }} # Check for changes to determine if we need to create/update PRs changes=$(git rev-list --count "$parent".."$branch") @@ -124,6 +130,8 @@ jobs: Subrepo changes may break workflows and require manual updates to fix errors. It is safe to add manual updates directly to this PR since they will not be overwritten by future automatic updates. + + ${{ inputs.force && 'Subrepo updates were made with the `--force` flag so it overwrites any local changes in the subrepo.' || '' }} run: | if [[ "$changes" == "1" ]]; then git push origin HEAD diff --git a/shared/vendored/.gitrepo b/shared/vendored/.gitrepo index 0f74d7c..1c6fcca 100644 --- a/shared/vendored/.gitrepo +++ b/shared/vendored/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/nextstrain/shared branch = main - commit = 0fb80b17054fdd283d35a6c4c00e3cab810a5781 - parent = 75428af330b0ec08ebcbe764fe53d9bf6e2b1f63 + commit = 9b91ad2885963b5596ef80f78db12c1f1f7577b7 + parent = 35f06c363137ee08a2ff2e184cd5cb433aedf6e4 method = merge cmdver = 0.4.9 diff --git a/shared/vendored/README.md b/shared/vendored/README.md index 75e6add..2dc8cb2 100644 --- a/shared/vendored/README.md +++ b/shared/vendored/README.md @@ -125,6 +125,7 @@ Snakemake workflow functions that are shared across many pathogen workflows that - [config.smk](snakemake/config.smk) - Shared functions for handling workflow configs. - [remote_files.smk](snakemake/remote_files.smk) - Exposes the `path_or_url` function which will use Snakemake's storage plugins to download/upload files to remote providers as needed. +- [dependencies.py](./snakemake/dependencies.py) - Helper functions for checking dependency versions. ## Software requirements diff --git a/shared/vendored/snakemake/config.smk b/shared/vendored/snakemake/config.smk index ab33cb8..5e96b98 100644 --- a/shared/vendored/snakemake/config.smk +++ b/shared/vendored/snakemake/config.smk @@ -2,6 +2,9 @@ Shared functions to be used within a Snakemake workflow for handling workflow configs. """ +from dependencies import set_min_augur_version +set_min_augur_version("34.1.0") + import os import sys import yaml diff --git a/shared/vendored/snakemake/dependencies.py b/shared/vendored/snakemake/dependencies.py new file mode 100644 index 0000000..4524696 --- /dev/null +++ b/shared/vendored/snakemake/dependencies.py @@ -0,0 +1,10 @@ +from packaging import version +from augur.__version__ import __version__ as augur_version +import sys + + +def set_min_augur_version(min_augur_version: str): + if version.parse(augur_version) < version.parse(min_augur_version): + print("This pipeline needs a newer version of augur than you currently have...") + print(f"Current augur version: {augur_version}. Minimum required: {min_augur_version}") + sys.exit(1)