Dvc: version: detect and show the way DVC was installed

Created on 26 Oct 2019  路  9Comments  路  Source: iterative/dvc

The way the dvc version command works:

$ dvc version

DVC version: 0.41.3+f36162
Python version: 3.7.1
Platform: Linux-4.15.0-50-generic-x86_64-with-debian-buster-sid
Binary: False
Cache: reflink - False, hardlink - True, symlink - True
Filesystem type (cache directory): ('ext4', '/dev/sdb3')
Filesystem type (workspace): ('ext4', '/dev/sdb3')

It outputs only Binary: False or Binary: True depending on how DVC was installed. Which is not granular enough.

See also docs: https://dvc.org/doc/command-reference/version

We can try and use the logic behind the update message (def _get_package_manager(self) from the updater.py) to show in the dvc version output how exactly DVC was installed - pip, conda, brew, package, etc. It'll help to debug faster, potentially can help users when they need to upgrade.

Almost all the logic required should be available already in the before mentioned updater.py.

enhancement feature request good first issue hacktoberfest help wanted p2-medium

Most helpful comment

Would like to work on the issue . Seems like it was not completed during devsprint.

All 9 comments

Related #2611

@shcheklein , there's room for improvement in _get_package_manager method.
Probably using where dvc to look if the path is prefixed by $VIRTUAL_ENV or $CONDA_ENV_PATH to know if it was installed under a virtual environment.

Also, I don't know if it is possible to modify the setup.py or something before building it with fpm build. This would be helpful because instead of guessing which was the installation method, it would be a lookup for a variable under the main namespace or something.
Sort of like we pin_version on setup.py, but pin_package?

For the record, to implement this, one would need to take output of _get_package_manager https://github.com/iterative/dvc/blob/0.66.3/dvc/updater.py#L185 and use it in https://github.com/iterative/dvc/blob/0.66.1/dvc/command/version.py#L39

Package manager: {package_manager}

Also, some fixes to tests/func/test_version.py would be required.

Can I reserve this issue to be used for today's Devsprints?

@kurianbenoy Sure!

Would like to work on the issue . Seems like it was not completed during devsprint.

Sure @kss682 !

excellent job @kss682 ! thank you :)

Welcome , Thanks to @efiop for helping me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mdekstrand picture mdekstrand  路  43Comments

dmpetrov picture dmpetrov  路  35Comments

gvyshnya picture gvyshnya  路  36Comments

luchoPipe87 picture luchoPipe87  路  69Comments

ChrisHowlin picture ChrisHowlin  路  35Comments