Skip to content

Commit

Permalink
[WIP] Attempt to fix problem with cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Dec 21, 2021
1 parent fb3dc26 commit 72904ab
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions setuptools/config/expand.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from glob import iglob
from itertools import chain
from configparser import ConfigParser
from pathlib import Path

from distutils.errors import DistutilsOptionError

Expand Down Expand Up @@ -243,29 +242,22 @@ def find_packages(*, namespaces=False, root_dir=None, **kwargs):
where = kwargs.pop('where', ['.'])
if isinstance(where, str):
where = [where]
target = [_nest_url_style_path(root_dir, path) for path in where]
target = [_nest_path(root_dir, path) for path in where]
from distutils import log
log.warn(f"find_packages cwd={os.getcwd()!r} root_dir={root_dir!r}")
for p in target:
log.warn(f"find_packages where={p!r} {kwargs!r}")
return list(chain_iter(PackageFinder.find(x, **kwargs) for x in target))


def _nest_url_style_path(parent, path):
def _nest_path(parent, path):
from distutils import log

log.warn(f"_nest_url_style_path parent={parent!r} path={path!r}")
log.warn(f"_nest_path parent={parent!r} path={path!r}"
f" norm={os.path.normpath(path)!r}")

path = parent if path == "." else os.path.join(parent, path)
return _url_style_path(path)


def _url_style_path(path):
from distutils import log

parts = Path(os.path.normpath(path)).parts
log.warn(f"_url_style_path parts={parts!r}")
return "/".join(parts) or "."
return os.path.normpath(path)


def version(value):
Expand Down

0 comments on commit 72904ab

Please sign in to comment.