mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-21 23:08:59 +01:00
refactor: rename dvc.command to dvc.commands
This commit is contained in:
committed by
Saugat Pachhai
parent
1b3e1251e6
commit
446516d788
@@ -1,7 +1,7 @@
|
||||
import json
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.ls import CmdList
|
||||
from dvc.commands.ls import CmdList
|
||||
|
||||
|
||||
def _test_cli(mocker, *args):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from dvc.command.ls.ls_colors import LsColors
|
||||
from dvc.commands.ls.ls_colors import LsColors
|
||||
|
||||
|
||||
def colorize(ls_colors):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import logging
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.add import CmdAdd
|
||||
from dvc.commands.add import CmdAdd
|
||||
|
||||
|
||||
def test_add(mocker, dvc):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.checkout import CmdCheckout, log_changes
|
||||
from dvc.commands.checkout import CmdCheckout, log_changes
|
||||
|
||||
|
||||
def test_checkout(tmp_dir, dvc, mocker):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from dvc.cli import DvcParserError, parse_args
|
||||
from dvc.command.config import CmdConfig
|
||||
from dvc.commands.config import CmdConfig
|
||||
|
||||
|
||||
def test_config_formatter():
|
||||
|
||||
@@ -2,7 +2,7 @@ import networkx as nx
|
||||
import pytest
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.dag import CmdDAG, _build, _show_ascii, _show_dot
|
||||
from dvc.commands.dag import CmdDAG, _build, _show_ascii, _show_dot
|
||||
|
||||
|
||||
@pytest.mark.parametrize("fmt", [None, "--dot"])
|
||||
@@ -17,7 +17,7 @@ def test_dag(tmp_dir, dvc, mocker, fmt):
|
||||
|
||||
cmd = cli_args.func(cli_args)
|
||||
|
||||
mocker.patch("dvc.command.dag._build", return_value=dvc.index.graph)
|
||||
mocker.patch("dvc.commands.dag._build", return_value=dvc.index.graph)
|
||||
|
||||
assert cmd.run() == 0
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.data_sync import CmdDataFetch, CmdDataPull, CmdDataPush
|
||||
from dvc.commands.data_sync import CmdDataFetch, CmdDataPull, CmdDataPush
|
||||
|
||||
|
||||
def test_fetch(mocker):
|
||||
|
||||
@@ -4,7 +4,7 @@ import os
|
||||
import pytest
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.diff import _digest, _show_markdown
|
||||
from dvc.commands.diff import _digest, _show_markdown
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -197,7 +197,7 @@ def test_diff_show_markdown_and_hash(mocker, show_hash):
|
||||
|
||||
diff = {}
|
||||
show_hash = show_hash if show_hash else False
|
||||
mock_show_markdown = mocker.patch("dvc.command.diff._show_markdown")
|
||||
mock_show_markdown = mocker.patch("dvc.commands.diff._show_markdown")
|
||||
mocker.patch("dvc.repo.Repo.diff", return_value=diff.copy())
|
||||
|
||||
assert 0 == cmd.run()
|
||||
|
||||
@@ -5,17 +5,17 @@ from datetime import datetime
|
||||
import pytest
|
||||
|
||||
from dvc.cli import DvcParserError, parse_args
|
||||
from dvc.command.experiments.apply import CmdExperimentsApply
|
||||
from dvc.command.experiments.branch import CmdExperimentsBranch
|
||||
from dvc.command.experiments.diff import CmdExperimentsDiff
|
||||
from dvc.command.experiments.gc import CmdExperimentsGC
|
||||
from dvc.command.experiments.init import CmdExperimentsInit
|
||||
from dvc.command.experiments.ls import CmdExperimentsList
|
||||
from dvc.command.experiments.pull import CmdExperimentsPull
|
||||
from dvc.command.experiments.push import CmdExperimentsPush
|
||||
from dvc.command.experiments.remove import CmdExperimentsRemove
|
||||
from dvc.command.experiments.run import CmdExperimentsRun
|
||||
from dvc.command.experiments.show import CmdExperimentsShow, show_experiments
|
||||
from dvc.commands.experiments.apply import CmdExperimentsApply
|
||||
from dvc.commands.experiments.branch import CmdExperimentsBranch
|
||||
from dvc.commands.experiments.diff import CmdExperimentsDiff
|
||||
from dvc.commands.experiments.gc import CmdExperimentsGC
|
||||
from dvc.commands.experiments.init import CmdExperimentsInit
|
||||
from dvc.commands.experiments.ls import CmdExperimentsList
|
||||
from dvc.commands.experiments.pull import CmdExperimentsPull
|
||||
from dvc.commands.experiments.push import CmdExperimentsPush
|
||||
from dvc.commands.experiments.remove import CmdExperimentsRemove
|
||||
from dvc.commands.experiments.run import CmdExperimentsRun
|
||||
from dvc.commands.experiments.show import CmdExperimentsShow, show_experiments
|
||||
from dvc.exceptions import InvalidArgumentError
|
||||
from dvc.repo import Repo
|
||||
from dvc.stage import PipelineStage
|
||||
@@ -784,7 +784,7 @@ def test_show_experiments_pcp(tmp_dir, mocker):
|
||||
},
|
||||
}
|
||||
experiments_table = mocker.patch(
|
||||
"dvc.command.experiments.show.experiments_table"
|
||||
"dvc.commands.experiments.show.experiments_table"
|
||||
)
|
||||
td = experiments_table.return_value
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.get import CmdGet
|
||||
from dvc.commands.get import CmdGet
|
||||
|
||||
|
||||
def test_get(mocker):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.get_url import CmdGetUrl
|
||||
from dvc.commands.get_url import CmdGetUrl
|
||||
|
||||
|
||||
def test_get_url(mocker):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.git_hook import CmdPostCheckout, CmdPreCommit, CmdPrePush
|
||||
from dvc.commands.git_hook import CmdPostCheckout, CmdPreCommit, CmdPrePush
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.imp import CmdImport
|
||||
from dvc.commands.imp import CmdImport
|
||||
|
||||
|
||||
def test_import(mocker):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import logging
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.imp_url import CmdImportUrl
|
||||
from dvc.commands.imp_url import CmdImportUrl
|
||||
from dvc.exceptions import DvcException
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.live import CmdLiveDiff, CmdLiveShow
|
||||
from dvc.commands.live import CmdLiveDiff, CmdLiveShow
|
||||
|
||||
|
||||
def test_live_diff(dvc, mocker):
|
||||
|
||||
@@ -5,7 +5,7 @@ import pytest
|
||||
from mock import call
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.machine import (
|
||||
from dvc.commands.machine import (
|
||||
CmdMachineAdd,
|
||||
CmdMachineCreate,
|
||||
CmdMachineDestroy,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import json
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.metrics import CmdMetricsDiff, CmdMetricsShow
|
||||
from dvc.commands.metrics import CmdMetricsDiff, CmdMetricsShow
|
||||
|
||||
|
||||
def test_metrics_diff(dvc, mocker, capsys):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.params import CmdParamsDiff
|
||||
from dvc.commands.params import CmdParamsDiff
|
||||
|
||||
|
||||
def test_params_diff(dvc, mocker):
|
||||
|
||||
@@ -6,7 +6,7 @@ from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.plots import CmdPlotsDiff, CmdPlotsShow
|
||||
from dvc.commands.plots import CmdPlotsDiff, CmdPlotsShow
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -290,7 +290,7 @@ def test_plots_diff_json(dvc, mocker, capsys):
|
||||
mocker.patch("dvc.render.utils.match_renderers", return_value=renderers)
|
||||
render_mock = mocker.patch("dvc.render.utils.render")
|
||||
|
||||
show_json_mock = mocker.patch("dvc.command.plots._show_json")
|
||||
show_json_mock = mocker.patch("dvc.commands.plots._show_json")
|
||||
|
||||
assert cmd.run() == 0
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.repro import CmdRepro
|
||||
from dvc.commands.repro import CmdRepro
|
||||
|
||||
default_arguments = {
|
||||
"all_pipelines": False,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.run import CmdRun
|
||||
from dvc.commands.run import CmdRun
|
||||
from tests.utils.asserts import called_once_with_subset
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.stage import CmdStageAdd
|
||||
from dvc.commands.stage import CmdStageAdd
|
||||
from tests.utils.asserts import called_once_with_subset
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import json
|
||||
import pytest
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.status import CmdDataStatus
|
||||
from dvc.commands.status import CmdDataStatus
|
||||
|
||||
|
||||
def test_cloud_status(tmp_dir, dvc, mocker):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from dvc.cli import parse_args
|
||||
from dvc.command.update import CmdUpdate
|
||||
from dvc.commands.update import CmdUpdate
|
||||
|
||||
|
||||
def test_update(dvc, mocker):
|
||||
|
||||
Reference in New Issue
Block a user