MCPcopy Index your code
hub / github.com/github/spec-kit / _display_project_path

Function _display_project_path

src/specify_cli/_utils.py:296–306  ·  view source on GitHub ↗

Return a stable POSIX-style display path for paths under a project.

(project_root: Path, path: str | Path)

Source from the content-addressed store, hash-verified

294
295
296def _display_project_path(project_root: Path, path: str | Path) -> str:
297 """Return a stable POSIX-style display path for paths under a project."""
298 path_obj = Path(path)
299 try:
300 rel_path = path_obj.relative_to(project_root) if path_obj.is_absolute() else path_obj
301 except ValueError:
302 try:
303 rel_path = path_obj.resolve().relative_to(project_root.resolve())
304 except (OSError, ValueError):
305 return path_obj.as_posix()
306 return rel_path.as_posix()
307
308
309def version_satisfies(current: str, required: str) -> bool:

Callers 1

Calls 1

resolveMethod · 0.45

Tested by

no test coverage detected