dvc: 0.24.3 -> 2.9.3

This commit is contained in:
Fabian Affolter 2022-01-15 17:34:43 +01:00
parent 688cbf9696
commit 15087b8272
2 changed files with 74 additions and 48 deletions

View File

@ -1,5 +1,5 @@
{ lib
, python3Packages
, python3
, fetchFromGitHub
, enableGoogle ? false
, enableAWS ? false
@ -7,59 +7,88 @@
, enableSSH ? false
}:
with python3Packages;
buildPythonApplication rec {
python3.pkgs.buildPythonApplication rec {
pname = "dvc";
version = "0.24.3";
version = "2.9.3";
format = "setuptools";
# PyPi only has wheel
src = fetchFromGitHub {
owner = "iterative";
repo = "dvc";
repo = pname;
rev = version;
sha256 = "1wqq4i23hppilp20fx5a5nj93xwf3wwwr2f8aasvn6jkv2l22vpl";
hash = "sha256-nRlgo7Wjs7RgTUxoMYQh5YEsqiJtdWH2ex79rhXagAQ=";
};
propagatedBuildInputs = [
ply
configparser
zc_lockfile
future
nativeBuildInputs = with python3.pkgs; [
setuptools-scm
setuptools-scm-git-archive
];
propagatedBuildInputs = with python3.pkgs; [
appdirs
aiohttp-retry
colorama
configobj
networkx
pyyaml
GitPython
setuptools
nanotime
pyasn1
schema
jsonpath_rw
requests
grandalf
asciimatics
configobj
dictdiffer
diskcache
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;
dpath
flatten-dict
flufl_lock
funcy
grandalf
nanotime
networkx
pathspec
ply
psutil
pydot
pygtrie
pyparsing
python-benedict
requests
rich
ruamel-yaml
scmrepo
shortuuid
shtab
tabulate
toml
tqdm
typing-extensions
voluptuous
zc_lockfile
] ++ lib.optional enableGoogle [
google-cloud-storage
] ++ lib.optional enableAWS [
boto3
] ++ lib.optional enableAzure [
azure-storage-blob
] ++ lib.optional enableSSH [
paramiko
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
] ++ lib.optionals (pythonOlder "3.9") [
importlib-resources
];
patches = [ ./dvc-daemon.patch ];
postPatch = ''
substituteInPlace dvc/daemon.py --subst-var-by dvc "$out/bin/dcv"
substituteInPlace setup.cfg \
--replace "grandalf==0.6" "grandalf>=0.6"
substituteInPlace dvc/daemon.py \
--subst-var-by dvc "$out/bin/dcv"
'';
# Tests require access to real cloud services
doCheck = false;
meta = with lib; {
description = "Version Control System for Machine Learning Projects";
license = licenses.asl20;
homepage = "https://dvc.org";
maintainers = with maintainers; [ cmcdragonkai ];
license = licenses.asl20;
maintainers = with maintainers; [ cmcdragonkai fab ];
};
}

View File

@ -1,21 +1,18 @@
diff --git a/dvc/daemon.py b/dvc/daemon.py
index 1d67a37..7ce6fde 100644
index 9854a0e1..fefdd613 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
@@ -103,11 +103,8 @@ def daemon(args):
logger.debug("skipping launching a new daemon.")
return
- 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))
- env["PYTHONPATH"] = os.path.dirname(os.path.dirname(file_path))
+ cmd = [ "@dvc@" , "daemon", "-q"] + args
+ env = None
env[DVC_DAEMON] = "1"
logger.debug("Trying to spawn '{}' with env '{}'".format(cmd, env))
_spawn(cmd, env)