mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-12-04 23:10:46 +01:00
dvc: optimize imports to speedup startup time
Speeds up `time dvc` from 1.2 seconds to <0.2 seconds. Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import os
|
||||
import networkx
|
||||
|
||||
from dvc.exceptions import DvcException
|
||||
from dvc.command.common.base import CmdBase
|
||||
from dvc.project import NotDvcFileError
|
||||
|
||||
|
||||
class CmdPipelineShow(CmdBase):
|
||||
def _show(self, target, commands, outs):
|
||||
import networkx
|
||||
from dvc.project import NotDvcFileError
|
||||
|
||||
G = self.project.graph()[0]
|
||||
stages = networkx.get_node_attributes(G, 'stage')
|
||||
node = os.path.relpath(os.path.abspath(target), self.project.root_dir)
|
||||
|
||||
Reference in New Issue
Block a user