Dvc: Make completion scripts part of the debian package

Created on 24 Jun 2019  路  16Comments  路  Source: iterative/dvc

Step 1
I installed dvc on my Ubuntu 16.04 machine with the following commands:

sudo wget https://dvc.org/deb/dvc.list -O /etc/apt/sources.list.d/dvc.list
sudo apt-get update
sudo apt-get install dvc

Step 2
To enable bash completion I downloaded completion script to /etc/bash_completion.d directory as described in https://dvc.org/doc/user-guide/autocomplete

It would be nice if completion script would be automatically installed with Debian package so step 2 wouldn't be required.

enhancement good first issue help wanted p3-nice-to-have

Most helpful comment

@shcheklein @Naba7 We can definitely start by including the ones we have already into our packages. After #2069 is solved, the new release will simply include the updated scripts automatically.

All 16 comments

Thanks for the request @nik123 ! To do that we would simply need to add our completion scripts when building deb(and probably rpm) packages in https://github.com/iterative/dvc/blob/master/scripts/build_posix.sh#L43 . Most likely they should simply be copied to appropriate subdirectories in $BUILD_DIR. E.g. usr/share/zsh/site-functions/_dvc.

Also we might want to take a look at osx pkg and homebrew/homebrew-cask formulas in https://github.com/iterative/homebrew-dvc

Can I take this up?

@Naba7 I would say it somewhat depends on this https://github.com/iterative/dvc/issues/2069 - it's pretty outdated and we should update it first. But yes, you can take it, sure!

@shcheklein @Naba7 We can definitely start by including the ones we have already into our packages. After #2069 is solved, the new release will simply include the updated scripts automatically.

After #2069 is solved, the new release will simply include the updated scripts automatically.

So is this issue still valid?

@jorgeorpinel Yes, still valid.

I'm not sure if it really was fixed. I have just installed latest version of dvc (0.60.1) on my machine (Ubuntu 18.04) via apt-get and there is now dvc.bash in /etc/bash_completion.d folder and command completion doesn't work on my machine.

@nik123 We didn't add it to the package yet. We've just improved the scripts themselves. Now we need to include those scripts into our packages by copying them to a proper location in $BUILD_DIR in scripts/build_posix.sh. Btw please feel free to ping us if you would be willing to contribute a PR for that :)

@efiop I'd like to implement it. May I?

Sure, @nik123 ! Please, ping us if you need any help on this one :)

@mroutis actually I have one question: contributing guide states that tests should be added for the changes. However I'm not sure if there are any tests for build script and if I should add any tests for changes which resolve this issue.

@nik123 I guess that in this case, a "manual" check should be enough.

@nik123 , @pared is right, I've submitted a change to our contribution guide to clarify that part https://github.com/iterative/dvc.org/pull/665 . Thanks :slightly_smiling_face:

Keeping this open until zsh completion is also added.

@nik123 Thank you for the PR! 0.61.2 with completion scripts is out :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

analystanand picture analystanand  路  3Comments

dnabanita7 picture dnabanita7  路  3Comments

dmpetrov picture dmpetrov  路  3Comments

prihoda picture prihoda  路  3Comments

ghost picture ghost  路  3Comments