github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/internal/tiltfile/api/os/path.py (about) 1 def abspath(path: str) -> str: 2 """Return a normalized, absolute version of the path, relative to the current working directory. 3 4 Args: 5 path: A filesystem path 6 """ 7 pass 8 9 def relpath(targpath: str, basepath: str='') -> str: 10 """Return the path of `targpath` relative to `basepath` (by default, relative to CWD). 11 On success, the returned path will always be relative to `basepath`, even if `basepath` 12 and `targpath` share no elements. An error is raised if `targpath` can't be made relative to `basepath`. 13 14 e.g. for the Tiltfile at `/code/Tiltfile`: 15 16 * `relpath('/code/foo/bar')` --> `foo/bar` 17 * `relpath('/code/foo/bar', '/code/foo')` --> `bar` 18 * `relpath('/code/foo', '/code/baz')` --> `../foo` 19 * `relpath('/code/foo', 'other/path')` --> error 20 21 Args: 22 targpath: Filesystem path to be made relative 23 basepath: Filesystem path (defaults to the current working directory) 24 """ 25 pass 26 27 def basename(path: str) -> str: 28 """Return the basename of the path. 29 30 Args: 31 path: A filesystem path 32 """ 33 pass 34 35 def dirname(path: str) -> str: 36 """Return the directory name of the path. 37 38 Args: 39 path: A filesystem path 40 """ 41 pass 42 43 def exists(path: str) -> bool: 44 """Checks if a file or directory exists at the specified path. 45 46 Returns false if this is a broken symlink, or if the user doesn't have permission 47 to stat the file at this path. 48 49 On Tilt v0.18.3 and below, watches the path, and reloads the Tiltfile if the contents change. 50 51 On Tilt v0.18.4 and up, does no watching. 52 53 Args: 54 path: A filesystem path 55 """ 56 pass 57 58 def join(path, *paths: str) -> str: 59 """Join one or more path components with the OS-specific file separator. 60 61 Args: 62 path: A filesystem path component 63 paths: A variable list of components to join 64 """ 65 pass 66 67 def realpath(path: str) -> str: 68 """Return the canonical path of the specified filename, eliminating any symbolic links encountered in the path (if they are supported by the operating system). 69 70 Args: 71 path: A filesystem path 72 """ 73 pass