diff options
Diffstat (limited to 'setuptools/config/expand.py')
| -rw-r--r-- | setuptools/config/expand.py | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/setuptools/config/expand.py b/setuptools/config/expand.py index da55d4ee..6ea54969 100644 --- a/setuptools/config/expand.py +++ b/setuptools/config/expand.py @@ -43,6 +43,8 @@ from types import ModuleType from distutils.errors import DistutilsOptionError +from .._path import same_path as _same_path + if TYPE_CHECKING: from setuptools.dist import Distribution # noqa from setuptools.discovery import ConfigDiscovery # noqa @@ -330,25 +332,6 @@ def find_packages( return packages -def _same_path(p1: _Path, p2: _Path) -> bool: - """Differs from os.path.samefile because it does not require paths to exist. - Purely string based (no comparison between i-nodes). - >>> _same_path("a/b", "./a/b") - True - >>> _same_path("a/b", "a/./b") - True - >>> _same_path("a/b", "././a/b") - True - >>> _same_path("a/b", "./a/b/c/..") - True - >>> _same_path("a/b", "../a/b/c") - False - >>> _same_path("a", "a/b") - False - """ - return os.path.normpath(p1) == os.path.normpath(p2) - - def _nest_path(parent: _Path, path: _Path) -> str: path = parent if path in {".", ""} else os.path.join(parent, path) return os.path.normpath(path) |
