MCPcopy
hub / github.com/treeverse/dvc / relpath

Function relpath

dvc/utils/__init__.py:222–230  ·  view source on GitHub ↗
(path, start=os.curdir)

Source from the content-addressed store, hash-verified

220
221
222def relpath(path, start=os.curdir):
223 path = os.path.abspath(os.fspath(path))
224 start = os.path.abspath(os.fspath(start))
225
226 # Windows path on different drive than curdir doesn't have relpath
227 if os.name == "nt" and not os.path.commonprefix([start, path]):
228 return path
229
230 return os.path.relpath(path, start)
231
232
233def as_posix(path: str) -> str:

Callers 15

_to_relpathMethod · 0.90
__init__Method · 0.90
__init__Method · 0.90
_change_dirnameFunction · 0.90
check_dvcfile_pathFunction · 0.90
__repr__Method · 0.90
relpathMethod · 0.90
dumpMethod · 0.90
make_relpathFunction · 0.90
__init__Method · 0.90
runMethod · 0.90
_log_exceptionsFunction · 0.90

Calls 3

abspathMethod · 0.80
fspathMethod · 0.45
relpathMethod · 0.45