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
Hub version command cli #628
Hub version command cli #628
Conversation
Locust summaryGit referencesInitial: 1ac80bbTerminal: d9fb971 hub/cli/auth.pyChanges:
hub/cli/command.pyChanges:
|
hub/cli/command.py
Outdated
@click.command() | ||
def version(version=1.22): | ||
"""Get the version of the hub package""" | ||
click.echo(f"you are using the hub version:{version}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this - we definitely need to be able to retrieve the version from the CLI.
I would suggest storing a version in one central place (currently we keep it in setup.py but probably version would be better) and then importing it in the CLI rather then setting it there. Also, it's better to return just the version or package name (Hub) + the version. Perhaps, the version should be just an argument to hub, not a separate command. In that case, we could invoke it in the following way: hub --version
.
Compare python --version
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah tried to do but got some distribution error regarding some packages, so is it okay to store it in version.py and import as required. Actually I don't understand how to add --version
in the click module, can you give some hint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added requested changes @mynameisvinn @haiyangdeperci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all right now. One possible enhancement could be swapping the version in setup.py
to have a single source of truth for the version.
Codecov Report
@@ Coverage Diff @@
## master #628 +/- ##
==========================================
- Coverage 89.32% 89.12% -0.21%
==========================================
Files 54 55 +1
Lines 3925 3935 +10
==========================================
+ Hits 3506 3507 +1
- Misses 419 428 +9
Continue to review full report at Codecov.
|
It's possible but hub has some dependency issue with boto3 and other
dependant packages on it.need to upgrade them to latest version otherwise
it give distributionerror.
…On Sat, Feb 27, 2021, 20:43 haiyangdeperci ***@***.***> wrote:
***@***.**** commented on this pull request.
This is all right now. One possible enhancement could be swapping the
version in setup.py to have a single source of truth
<https://packaging.python.org/guides/single-sourcing-package-version/>
for the version.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#628 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL7XHCARYEYJCKZLXV7FWRTTBEDYNANCNFSM4YJZGM3A>
.
|
@mynameisvinn Could you take a look? What's the reasoning behind separate CLI version? |
can you check @haiyangdeperci @mynameisvinn |
I agree with @haiyangdeperci, version info should be stored only in a single place and accessed by both setup.py and this click command. |
@AbhinavTuli I try to import version from the setup.py but got error regarding some distributions in package. |
I think @AbhinavTuli meant that you import the version in |
@haiyangdeperci Not sure since this predates me. We should remove it. |
This looks good @sparkingdark! Nice work! |
Thanks @mynameisvinn |
This will add the
version
command to hub cli and it can be used like this:fixes issue #627
I think it will be better if I use
from setup import VERSION
but I got some errors due to packages and python version 3.8.can you give some highlight regarding this @mynameisvinn @AbhinavTuli