Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command to self-upgrade #269

Open
corneliusroemer opened this issue Mar 27, 2023 · 3 comments
Open

Add command to self-upgrade #269

corneliusroemer opened this issue Mar 27, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@corneliusroemer
Copy link
Member

Context

When updating nextstrain runtimes, I was told that a new cli version is available and that I should update using:

mamba install -p /opt/homebrew/Caskroom/miniforge/base/envs/nextstrain nextstrain-cli==6.2.1

That doesn't actually work:

nextclade on  feat/masked-sites-for-placement [$?] via  v18.9.0 via 🦀 v1.67.1 mamba install -p /opt/homebrew/Caskroom/miniforge/base/envs/nextstrain nextstrain-cli==6.2.1

Looking for: ['nextstrain-cli==6.2.1']

bioconda/osx-arm64                                          Using cache
bioconda/noarch                                             Using cache
conda-forge/osx-arm64                                       Using cache
conda-forge/noarch                                          Using cache
pkgs/main/osx-arm64                                         Using cache
pkgs/main/noarch                                            Using cache
pkgs/r/osx-arm64                                            Using cache
pkgs/r/noarch                                               Using cache

Pinned packages:
  - python 3.10.*
  - biopython 1.80.*


Could not solve for environment specs
The following package could not be installed
└─ nextstrain-cli 6.2.1  does not exist (perhaps a typo or a missing channel).

(but that's not what this issue is about)

Description

I was wondering whether it would make sense to add self update to the options of nextstrain update.

Rather than prompting the user to run a specific command (that may actually not work) why not run some code that we know works to update the version?

@corneliusroemer corneliusroemer added the enhancement New feature or request label Mar 27, 2023
@corneliusroemer
Copy link
Member Author

The following worked:

pip install --upgrade nextstrain-cli

@tsibley
Copy link
Member

tsibley commented Mar 27, 2023

mamba install was recommended as the update mechanism because the copy of nextstrain that you're using was installed via the Conda package originally and you have mamba available.

The 6.2.1 version was recommended because Nextstrain CLI only checks PyPI for the latest version.

The reason (as I suspect you know, but saying for posterity) that the mamba install command didn't work is because the Bioconda nextstrain-cli package has not yet gotten the 6.2.1 update.

The window of time between the PyPI package updating and the Conda package updating is usually relatively short, but I suppose to avoid it we could query the Bioconda package version if we know we're going to recommend updating with it.

Separately, by installing with pip, you've now switched from a Conda-installed copy of Nextstrain CLI to a Pip-installed copy. It's best to avoid Pip when possible when you're working in a Conda env, as mixing them can cause dependency issues later. You might consider re-installing 6.2.1 from Conda once it's available there.

@tsibley
Copy link
Member

tsibley commented Mar 27, 2023

I was wondering whether it would make sense to add self update to the options of nextstrain update.

Rather than prompting the user to run a specific command (that may actually not work) why not run some code that we know works to update the version?

Yeah, I've been meaning to add a self-upgrade command. I thought there was an issue for it, but maybe not. Half of the reason why we carefully construct a command to suggest to the user is that it also will let us provide a way to run it automatically. Just haven't gotten 'round to it yet. I'm not sure nextstrain update self is the right invocation, though.

@tsibley tsibley changed the title Add self to nextstrain update allowed arguments Add command to self-upgrade Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

2 participants