Almenon/birdseye-vscode

check for update when user launches birdseye

Closed this issue ยท 8 comments

Birdseye does not provide a __version__ attribute so I would either have to add it in or use pip.

pip list --outdated

Unfortunately there does not seem to be a pip argument for checking for new updates of only one package. (pip list --oudated lists all of them)

pip show birdseye gives the version.

@alexmojaki I don't want to just get the version - I want to check if there is a newer version availible.

As a workaround I suppose I could hardcode the latest version into the extension, but then I would have to update that manually each time. Easier to just parse the output of pip list --outdated

You started with

Birdseye does not provide a __version__ attribute

which would have left you in the same situation.

I found a better option:

$ pip search birdseye
birdseye (0.3.0)  - Quick, convenient, expression-centric, graphical Python debugger using the AST
  INSTALLED: 0.3.0 (latest)

Perhaps this should be done in birdseye itself rather than this extension. It can do the check in a background thread and emit a warning if necessary. Then all the extension has to do is show the warning if it sees it in the server output. People not using this extension will also know that they should update.

sounds good to me - I'll raise an issue in your repo.

This is done. Your extension should look for a message along these lines:

The package birdseye is out of date. Your version is 0.4.0, the latest is 0.4.1.

Although you won't be able to test it until a newer version is released.

As it happens I found another bug and I've already released a version 0.4.1, so you should be able to test this soon. But the version check is cached for a day, so if you've already upgraded to 0.4.0 and run birdseye you won't see it yet.

I'm using version 0.0.6 of @Almenon's extension, which was updated on 3/7/2021. There's no message that says "The package birdseye is out of date." Since the extension is a "wrapper", does that mean its underlying package has been updated to version 0.9.4?

When the extension installs birdseye, it should just automatically install the latest version by default.