mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-06 15:28:28 +01:00
Pre-requisite for removing fs.path_info and switching to regular strings as paths in filesystems. With new filesystems we no longer need the zoo of different dependency and output types, as most of them are now just handled by the underlying filesystem. Though deps/outs are still due for a refactor in other aspects.
35 lines
944 B
Python
35 lines
944 B
Python
from typing import Type
|
|
|
|
from dvc.exceptions import DvcException
|
|
from dvc.output import Output
|
|
|
|
|
|
class DependencyDoesNotExistError(DvcException):
|
|
def __init__(self, path):
|
|
msg = f"dependency '{path}' does not exist"
|
|
super().__init__(msg)
|
|
|
|
|
|
class DependencyIsNotFileOrDirError(DvcException):
|
|
def __init__(self, path):
|
|
msg = f"dependency '{path}' is not a file or directory"
|
|
super().__init__(msg)
|
|
|
|
|
|
class DependencyIsStageFileError(DvcException):
|
|
def __init__(self, path):
|
|
super().__init__(f"DVC file '{path}' cannot be a dependency.")
|
|
|
|
|
|
class Dependency(Output):
|
|
IS_DEPENDENCY = True
|
|
|
|
DoesNotExistError = DependencyDoesNotExistError # type: Type[DvcException]
|
|
IsNotFileOrDirError = (
|
|
DependencyIsNotFileOrDirError
|
|
) # type: Type[DvcException]
|
|
IsStageFileError = DependencyIsStageFileError # type: Type[DvcException]
|
|
|
|
def update(self, rev=None):
|
|
pass
|