mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-18 23:10:14 +01:00
Speeds up `time dvc` from 1.2 seconds to <0.2 seconds. Signed-off-by: Ruslan Kuprieiev <[email protected]>
24 lines
782 B
Python
24 lines
782 B
Python
import os
|
|
|
|
from dvc.command.common.base import CmdBase
|
|
from dvc.logger import Logger
|
|
from dvc.exceptions import DvcException
|
|
|
|
|
|
class CmdRun(CmdBase):
|
|
def run(self):
|
|
try:
|
|
self.project.run(cmd=' '.join(self.args.command),
|
|
outs=self.args.outs,
|
|
outs_no_cache=self.args.outs_no_cache,
|
|
metrics_no_cache=self.args.metrics_no_cache,
|
|
deps=self.args.deps,
|
|
fname=self.args.file,
|
|
cwd=self.args.cwd,
|
|
no_exec=self.args.no_exec)
|
|
except DvcException as ex:
|
|
self.project.logger.error('Failed to run command', ex)
|
|
return 1
|
|
|
|
return 0
|