Return a stable POSIX-style display path for paths under a project.
(project_root: Path, path: str | Path)
| 294 | |
| 295 | |
| 296 | def _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 | |
| 309 | def version_satisfies(current: str, required: str) -> bool: |
no test coverage detected