diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-06-21 11:09:22 +0100 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-06-21 11:37:13 +0100 |
| commit | fd5fcbb1ec200ba2b0c657628a591ce2255998e3 (patch) | |
| tree | e4c20ee26e15647978b9f0102d8d27d11197840a /setuptools/config | |
| parent | fd891afb3020eceab6d8528dfbc0d844865361d4 (diff) | |
| download | python-setuptools-git-fd5fcbb1ec200ba2b0c657628a591ce2255998e3.tar.gz | |
build_meta: Allow dist-info and egg-info to coexist
PEP 517 does not care if other directories/files are left behind in the
`metadata_directory`, as long as a `.dist_info` directory is produced at
the root. We can leave the `.egg-info` directory behind, so this way
we don't have to run it again when listing files from `build_py`.
Diffstat (limited to 'setuptools/config')
| -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) |
