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

verdi --version can report incorrect version if package is installed in editable mode #4556

Closed
sphuber opened this issue Nov 11, 2020 · 1 comment · Fixed by #4576
Closed
Assignees
Milestone

Comments

@sphuber
Copy link
Contributor

sphuber commented Nov 11, 2020

To reproduce:

  1. Install aiida-core==1.4.2 in editable mode
  2. verdi --version prints 1.4.2
  3. Switch to aiida-core==1.4.3
  4. verdi --version still prints 1.4.2

This is a problem of the @click.version_option decorator which does not dynamically inspect the linked library version but the version that was copied when it was installed.

@sphuber sphuber self-assigned this Nov 11, 2020
@greschd
Copy link
Member

greschd commented Nov 11, 2020

(Copied from #4551 (comment))

Guess that's a limitation of importlib.metadata.version, in the master branch they added some more documentation for that: https://click.palletsprojects.com/en/master/api/#click.version_option

We should be able to get around that by simply passing version=aiida.__version__ to version_option. That might be a few milliseconds slower, but at least it'll be correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants