mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-29 07:28:11 +08:00
Change modify upgrade message to print to stderr instead of stdout (#1827)
When generating a config file, you can do this: > cellxgene launch --dump-default-config > myconfig.yaml And then modify the myconfig.yaml. However, if an upgrade is available then you would get extra lines in the yaml file, which are not yaml code: There's a new version of cellxgene available (0.16.4)! To upgrade, run the following: pip install --upgrade cellxgene To solve this problem, the upgrade messages are sent to stderr instead, so they will appear on the screen and not in the config file. Alternatives: One workaround is "cellxgene --no-upgrade-check launch --dump-default-config > myconfig.yaml" But that's a bit verbose and not user friendly. The way we've setup the upgrade check to be separate and before the launch sub command, makes other code changes more involved. #1826
This commit is contained in:
@@ -22,8 +22,8 @@ def log_upgrade_check():
|
||||
release_tag_generator = (r["tag_name"] for r in _request_cellxgene_releases())
|
||||
latest_release = next(release_tag_generator, lambda tag_name: validate_version_str(tag_name))
|
||||
if version_gt(latest_release, __version__):
|
||||
click.echo(f"There's a new version of cellxgene available ({latest_release})!")
|
||||
click.echo("To upgrade, run the following: pip install --upgrade cellxgene\n")
|
||||
click.echo(f"There's a new version of cellxgene available ({latest_release})!", err=True)
|
||||
click.echo("To upgrade, run the following: pip install --upgrade cellxgene\n", err=True)
|
||||
except (ConnectionError, RateLimitException):
|
||||
click.echo("Upgrade check failed.\n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user