Skip to content

ENH: Make --version output just version, and CMD --version output module and its version #5543

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

Merged
merged 4 commits into from
Apr 8, 2021

Conversation

yarikoptic
Copy link
Member

@yarikoptic yarikoptic commented Apr 3, 2021

I might have went a little too wild, but I felt that having clean output
of datalad --version is nice -- it could facilitate use by scripts since
would no longer need parsing etc (but also might break them now).

So here is how it would look now with these changes:

$> datalad --version
0.14.1.dev129

$> datalad install --version
datalad 0.14.1.dev129

$> datalad containers-list --version
datalad_container 1.1.2

$> git-annex-remote-datalad --version
datalad 0.14.1.dev129

Closes #5527

edit: a side effect, it also addresses #3067 which was worked around via adding -- to separate out command for datalad run. Now would even work in the datalad run whatever --version without --

…ule and its version

I might have went a little too wild, but I felt that having clean output
of datalad --version is nice -- it could facilitate use by scripts since
would no longer need parsing etc (but also might break them now).

So here is how it would look now with these changes:

	$> datalad --version
	0.14.1.dev129

	$> datalad install --version
	datalad 0.14.1.dev129

	$> datalad containers-list --version
	datalad_container 1.1.2

	$> git-annex-remote-datalad --version
	datalad 0.14.1.dev129

Closes datalad#5527
@codecov
Copy link

codecov bot commented Apr 3, 2021

Codecov Report

Merging #5543 (b0e3220) into master (f2f95b3) will increase coverage by 0.04%.
The diff coverage is 80.76%.

❗ Current head b0e3220 differs from pull request most recent head 02635fd. Consider uploading reports for the commit 02635fd to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5543      +/-   ##
==========================================
+ Coverage   88.52%   88.56%   +0.04%     
==========================================
  Files         296      296              
  Lines       42467    42510      +43     
==========================================
+ Hits        37592    37651      +59     
+ Misses       4875     4859      -16     
Impacted Files Coverage Δ
datalad/cmdline/common_args.py 100.00% <ø> (ø)
datalad/customremotes/main.py 25.49% <0.00%> (ø)
datalad/support/gitrepo.py 91.61% <ø> (ø)
datalad/cmdline/helpers.py 69.82% <72.00%> (-0.05%) ⬇️
datalad/cmdline/tests/test_main.py 95.17% <85.71%> (-1.16%) ⬇️
datalad/cmdline/main.py 75.31% <100.00%> (+0.31%) ⬆️
datalad/core/local/tests/test_run.py 100.00% <100.00%> (ø)
datalad/interface/tests/test_base.py 99.15% <100.00%> (ø)
datalad/support/tests/test_gitrepo.py 99.80% <100.00%> (ø)
datalad/downloaders/credentials.py 84.11% <0.00%> (-1.18%) ⬇️
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2f95b3...02635fd. Read the comment docs.

@yarikoptic yarikoptic added feedback-desired merge-if-ok OP considers this work done, and requests review/merge labels Apr 3, 2021
Copy link
Contributor

@kyleam kyleam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, and it's nice that it fixed the deeper issue in gh-3067.

----------
parser:
mod_name: str, optional
include_name: bool, optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel strongly about it, but my vote would be to just stick with the previous output and always include the name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also luke warm about this change -- benefit is minimal and it might break someone's (unlikely but possible to exist) script. May be @mih has an opinion on this minute aspect?

@yarikoptic
Copy link
Member Author

ok, added a commit to revert back to the prior behavior for datalad --version (left possibility/option in the function to exclude just in case). So should be ready to go if no tests broken

@kyleam kyleam merged commit 6d3ac7e into datalad:master Apr 8, 2021
@yarikoptic yarikoptic deleted the enh--version branch April 29, 2021 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-if-ok OP considers this work done, and requests review/merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

datalad extension-command --version to provide version of the extension, not of datalad
2 participants