Repository: iterative/dvc

Issue:
Snapcraft
Provide a snap package

https://snapcraft.io

I can be assigned if needed

- related to #2760


Discussion:
I just registered `https://snapcraft.io/dvc` just in case :)
Thanks, @casperdcl !

By the way, what do you think about #2760 ?
@casperdcl I remember installing skype from snap many years ago, and that is about the only time i've heard about it or used it :) Not quite sure I understand the purpose of creating a package for it, could you elaborate? I'm a bit worried about creating the package for it, because it might result in a situation we have with our AUR package, where no one was using it, so it just got abandoned.
@efiop snap is now bundled with the newest ubuntu distros so it easier to install a lot of packages, though I have to agree I don't see many users actually downloading it from there at is is more designed for casual linux users and `dvc` is kind of niche software (unlike skype / spotify etc.) 
@efiop 

`snap install dvc` would differ from `apt install python3-pip && pip3 install dvc` in these ways:

- would not rely on system python/conda/libffi/lib*.so etc (the snap would bundle its own dependencies, https://snapcraft.io/docs/python-apps)
- would update automatically on-the-fly (same as apps on your phone set to auto-update)
- `dvc` would be running in a somewhat sandboxed env which may make it more likely for security-conscious users to install

For example, https://snapcraft.io/tqdm surprisingly has about 170 users despite the fact that

1. the vast majority of users don't know about its CLI usage, and
2. snap python packages are not `import`able in any scripts, which is the main use of `tqdm`
@n3hrox @casperdcl Thanks for clarifying guys! So can it be considered a replacement for our deb and rpm packages that we already have? Or should we think about it as a more of an addition? I've also seen some mentions about `homebrew` for `linux`, which is, I guess, a similar thing, right? Maybe less newbie frendly, but still, kinda an idea of a package manager for all linux-es?
@efiop yes I think so. I prefer `snap install` over `apt install` when available. Note that the Ubuntu Software Centre installs packages via `snap` too, so `dvc` would show up there...

![image](https://user-images.githubusercontent.com/10780059/68609826-4401a300-04ae-11ea-8ee7-aae02933da15.png)

Oh, nice! I agree, this would be nice to have. :slightly_smiling_face: 
Ah I'll either need admin access to this repo or an admin needs to add it via https://build.snapcraft.io/select-repositories
Actually nvm turns out a few months ago travis finally caught up https://blog.travis-ci.com/2019-06-21-snaps-support-travis-ci so don't think we need the repo linked
@casperdcl I've accepted the request for 
snapchat
snapcraft, does it work now?
I'll submit a PR at some point.

Srry don't have snapchat :D

Resolving patch:
diff --git a/dvc/updater.py b/dvc/updater.py
--- a/dvc/updater.py
+++ b/dvc/updater.py
@@ -48,7 +48,7 @@ def _with_lock(self, func, action):
             logger.debug(msg.format(self.lock.lockfile, action))
 
     def check(self):
-        if os.getenv("CI") or env2bool("DVC_TEST"):
+        if os.getenv("CI") or env2bool("DVC_TEST") or PKG == "snap":
             return
 
         self._with_lock(self._check, "checking")


Test patch: