mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-04 23:09:44 +01:00
* test: clean flake8 config root clutter * test: pre-commit: add isort Compatible with black (see https://github.com/timothycrosley/isort/issues/694) * lint: reorder imports * lint: more complex imports * lint: fix deepsource * config: isort: add first party dvc * tests: restyled: add isort * temp commit to revert before merge * Revert "temp commit to revert before merge" This reverts commit 11db0fd8e95fe891597cbb9bf804480909b19e24.
28 lines
711 B
Python
28 lines
711 B
Python
import argparse
|
|
import logging
|
|
|
|
from dvc.command.base import CmdBaseNoRepo, append_doc_link
|
|
from dvc.utils import relpath
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class CmdRoot(CmdBaseNoRepo):
|
|
def run(self):
|
|
from dvc.repo import Repo
|
|
|
|
logger.info(relpath(Repo.find_root()))
|
|
return 0
|
|
|
|
|
|
def add_parser(subparsers, parent_parser):
|
|
ROOT_HELP = "Return the relative path to the root of the DVC project."
|
|
root_parser = subparsers.add_parser(
|
|
"root",
|
|
parents=[parent_parser],
|
|
description=append_doc_link(ROOT_HELP, "root"),
|
|
help=ROOT_HELP,
|
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
)
|
|
root_parser.set_defaults(func=CmdRoot)
|