Re@sdZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl ZddlmZddlmZmZddlmZd d lmZd d d ddddgZejjZdZdZdgZGdddeZGdddeZ ej!Z"ej#j$Z$ej%ej#j&Z'Gddde'Z&ddZ(ej)ddZ*ej+dS)z@Extensions to the 'distutils' for large or complex distributionsN) convert_path) fnmatchcase)filtermap) Extension) DistributionFeature)Require)monkeysetuprrCommandrr find_packagesTz lib2to3.fixesc@sgeZdZdZedfd ddZeddZedd Zed d Z d S) PackageFinderzI Generate a list of all Python packages found within a directory .*cCs7t|jt||jdd||j|S)a Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of package names to exclude; '*' can be used as a wildcard in the names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). 'include' is a sequence of package names to include. If it's specified, only the named packages will be included. If it's not specified, all found packages will be included. 'include' can contain shell style wildcard patterns just like 'exclude'. Zez_setupz *__pycache__)list_find_packages_iterr _build_filter)clswhereexcludeincluder/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/__init__.pyfind's  zPackageFinder.findc csxtj|ddD]\}}}|dd}g|dds% z!PackageFinder._find_packages_itercCstjjtjj|dS)z%Does a directory look like a package?z __init__.py)rrisfiler )rrrrr$Zsz!PackageFinder._looks_like_packagecsfddS)z Given a list of patterns, return a callable that will be true only if the input matches at least one of the patterns. cstfddDS)Nc3s!|]}td|VqdS)patN)r).0r.)namerr esz@PackageFinder._build_filter....)any)r0)patterns)r0resz-PackageFinder._build_filter..r)r3r)r3rr_szPackageFinder._build_filterN)r) __name__ __module__ __qualname____doc__ classmethodrr staticmethodr$rrrrrr"s rc@s"eZdZeddZdS)PEP420PackageFindercCsdS)NTr)rrrrr$isz'PEP420PackageFinder._looks_like_packageN)r5r6r7r:r$rrrrr;hs r;c@s:eZdZejZdZddZdddZdS)r FcKs'tj||t|j|dS)zj Construct the command for dist, updating vars(self) with any keyword parameters. N)_Command__init__varsupdate)selfdistkwrrrr=zszCommand.__init__rcKs,tj|||}t|j||S)N)r<reinitialize_commandr>r?)r@commandreinit_subcommandsrBcmdrrrrCszCommand.reinitialize_commandN)r5r6r7r<r8Zcommand_consumes_argumentsr=rCrrrrr us   cCs5ddtj|ddD}ttjj|S)z% Find all files under 'path' css:|]0\}}}|D]}tjj||VqqdS)N)rrr )r/baser'r(filerrrr1s z#_find_all_simple..rT)rrrrr-)rresultsrrr_find_all_simples rJcCsOt|}|tjkrEtjtjjd|}t||}t|S)z Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. start) rJrcurdir functoolspartialrr!rr)r)r(Zmake_relrrrfindalls  rO),r8rrMdistutils.core distutilsdistutils.filelistdistutils.utilrfnmatchrZsetuptools.extern.six.movesrrZsetuptools.version setuptoolsZsetuptools.extensionrZsetuptools.distrrZsetuptools.dependsr r __all__version __version__Zbootstrap_install_fromZrun_2to3_on_doctestsZlib2to3_fixer_packagesobjectrr;rrcorer Z get_unpatchedr r<rJrLrOZ patch_allrrrrs6        F