Skip to content

Commit

Permalink
runner.conda: Allow downgrades during update of nextstrain-base
Browse files Browse the repository at this point in the history
This permits Micromamba to downgrade packages that are already installed
in order to upgrade nextstrain-base.  While nextstrain-base's
fully-locked dependencies from version to version will typically only
cause upgrades, there are times when downgrades may be required.¹  When
that's the case, Micromamba simply won't consider that nextstrain-base
version as available without --allow-downgrade.

Resolves <#264>.

¹ For example, the deps of Nextstrain CLI's package in Bioconda changed
  to better match its deps in PyPI², which meant versions of botocore,
  boto3, and some related packages had to be downgraded.

² <bioconda/bioconda-recipes#39711>
  • Loading branch information
tsibley committed Mar 21, 2023
1 parent f315820 commit 187d155
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nextstrain/cli/runner/conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ def micromamba(*args, add_prefix: bool = True) -> None:
# Don't automatically pin Python so nextstrain-base deps can change
# it on upgrade.
"--no-py-pin",

# Allow uninstalls and downgrades of existing installed packages so
# nextstrain-base deps can change on upgrade. Uninstalls are
# currently allowed by default (unlike downgrades), but make it
# explicit here.
"--allow-uninstall",
"--allow-downgrade",
)

env = {
Expand Down

0 comments on commit 187d155

Please sign in to comment.