summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/version-management/dvc
diff options
context:
space:
mode:
authorRoger Qiu <roger.qiu@polyhack.io>2019-01-24 15:44:34 +1100
committerRoger Qiu <roger@formbay.com.au>2019-10-28 13:07:58 +1100
commit3c3ac19c43ef1b8b7459f9da1d0d5bd8fcc42fda (patch)
treec26a8524b479d856a69b9c6d369f2cecd62e0813 /pkgs/applications/version-management/dvc
parentbae9fd59a945357f7712a63c0a09b72d4ed44e6e (diff)
dvc: init at 0.24.3
Diffstat (limited to 'pkgs/applications/version-management/dvc')
-rw-r--r--pkgs/applications/version-management/dvc/default.nix65
-rw-r--r--pkgs/applications/version-management/dvc/dvc-daemon.patch21
2 files changed, 86 insertions, 0 deletions
diff --git a/pkgs/applications/version-management/dvc/default.nix b/pkgs/applications/version-management/dvc/default.nix
new file mode 100644
index 000000000000..fe10551771cf
--- /dev/null
+++ b/pkgs/applications/version-management/dvc/default.nix
@@ -0,0 +1,65 @@
+{ lib
+, python3Packages
+, fetchFromGitHub
+, enableGoogle ? false
+, enableAWS ? false
+, enableAzure ? false
+, enableSSH ? false
+}:
+
+with python3Packages;
+buildPythonApplication rec {
+ pname = "dvc";
+ version = "0.24.3";
+
+ # PyPi only has wheel
+ src = fetchFromGitHub {
+ owner = "iterative";
+ repo = "dvc";
+ rev = version;
+ sha256 = "1wqq4i23hppilp20fx5a5nj93xwf3wwwr2f8aasvn6jkv2l22vpl";
+ };
+
+ propagatedBuildInputs = [
+ ply
+ configparser
+ zc_lockfile
+ future
+ colorama
+ configobj
+ networkx
+ pyyaml
+ GitPython
+ setuptools
+ nanotime
+ pyasn1
+ schema
+ jsonpath_rw
+ requests
+ grandalf
+ asciimatics
+ distro
+ appdirs
+ ]
+ ++ lib.optional enableGoogle google_cloud_storage
+ ++ lib.optional enableAWS boto3
+ ++ lib.optional enableAzure azure-storage-blob
+ ++ lib.optional enableSSH paramiko;
+
+ # tests require access to real cloud services
+ # nix build tests have to be isolated and run locally
+ doCheck = false;
+
+ patches = [ ./dvc-daemon.patch ];
+
+ postPatch = ''
+ substituteInPlace dvc/daemon.py --subst-var-by dvc "$out/bin/dcv"
+ '';
+
+ meta = with lib; {
+ description = "Version Control System for Machine Learning Projects";
+ license = licenses.asl20;
+ homepage = https://dvc.org;
+ maintainers = with maintainers; [ cmcdragonkai ];
+ };
+}
diff --git a/pkgs/applications/version-management/dvc/dvc-daemon.patch b/pkgs/applications/version-management/dvc/dvc-daemon.patch
new file mode 100644
index 000000000000..5c2d363b17f1
--- /dev/null
+++ b/pkgs/applications/version-management/dvc/dvc-daemon.patch
@@ -0,0 +1,21 @@
+diff --git a/dvc/daemon.py b/dvc/daemon.py
+index 1d67a37..7ce6fde 100644
+--- a/dvc/daemon.py
++++ b/dvc/daemon.py
+@@ -67,14 +67,8 @@ def daemon(args):
+ Args:
+ args (list): list of arguments to append to `dvc daemon` command.
+ """
+- cmd = [sys.executable]
+- if not is_binary():
+- cmd += ['-m', 'dvc']
+- cmd += ['daemon', '-q'] + args
+-
+- env = fix_env()
+- file_path = os.path.abspath(inspect.stack()[0][1])
+- env['PYTHONPATH'] = os.path.dirname(os.path.dirname(file_path))
++ cmd = [ "@dvc@" , "daemon", "-q"] + args
++ env = None
+
+ logger.debug("Trying to spawn '{}' with env '{}'".format(cmd, env))
+