U l a@sdZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZddlmZmZdd lmZmZddlZdd lmZdd lmZdd lmZdd lmZeZ dddddddgZ!ere!"dej#j$Z$dZ%dZ&dgZ'GdddZ(Gddde(Z)e(j*Z+ere)j*Z,ddZ-ddZ.ej/j.je._e0ej/j1Z2Gddde2Z1d d!Z3ej4fd"d#Z5Gd$d%d%e6Z7e8dS)&z@Extensions to the 'distutils' for large or complex distributionsN)DistutilsOptionError) convert_path fnmatchcase)SetuptoolsDeprecationWarning)PY3 string_types)filtermap) Extension) Distribution)Require)monkeysetupr Commandr rr find_packagesfind_namespace_packagesTz lib2to3.fixesc@sBeZdZdZedddZeddZed d Zed d Z d S) PackageFinderzI Generate a list of all Python packages found within a directory .*cCs&t|t||jd||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'. ez_setup *__pycache__)rr)list_find_packages_iterr _build_filter)clswhereexcludeincluderrTC:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-wx4infiz\setuptools\__init__.pyfind3s  zPackageFinder.findc cstj|ddD]\}}}|dd}g|dd<|D]d}tj||} tj| |} | tjjd} d|ks4|| sxq4|| r|| s| V||q4qdS)zy All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. T followlinksNr) oswalkpathjoinrelpathreplacesep_looks_like_packageappend) rrr r!rootdirsfilesZall_dirsdir full_pathrel_pathpackagerrr"rJs  z!PackageFinder._find_packages_itercCstjtj|dS)z%Does a directory look like a package?z __init__.py)r&r(isfiler)r(rrr"r-fsz!PackageFinder._looks_like_packagecs fddS)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|]}t|dVqdS))patNr).0r8namerr" qsz@PackageFinder._build_filter....)anyr:patternsr:r"qz-PackageFinder._build_filter..rr>rr>r"rkszPackageFinder._build_filterN)rrr) __name__ __module__ __qualname____doc__ classmethodr#r staticmethodr-rrrrr"r.s   rc@seZdZeddZdS)PEP420PackageFindercCsdS)NTrr7rrr"r-usz'PEP420PackageFinder._looks_like_packageN)rBrCrDrGr-rrrr"rHtsrHcCs@tjtdd|D}|jdd|jr<||jdS)Ncss"|]\}}|dkr||fVqdS))Zdependency_linkssetup_requiresNr)r9kvrrr"r<sz*_install_setup_requires..T)Zignore_option_errors) distutilscorer dictitemsparse_config_filesrIZfetch_build_eggs)attrsdistrrr"_install_setup_requiress   rScKst|tjjf|SN)rSrLrMr)rQrrr"rsc@s:eZdZejZdZddZd ddZddZd d d Z dS)rFcKst||t||dS)zj Construct the command for dist, updating vars(self) with any keyword parameters. N)_Command__init__varsupdate)selfrRkwrrr"rVs zCommand.__init__NcCsBt||}|dkr"t||||St|ts>td|||f|S)Nz'%s' must be a %s (got `%s`))getattrsetattr isinstancer r)rYoptionwhatdefaultvalrrr"_ensure_stringlikes   zCommand._ensure_stringlikecCspt||}|dkrdSt|tr6t||td|n6t|trTtdd|D}nd}|sltd||fdS)zEnsure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. Nz,\s*|\s+css|]}t|tVqdSrT)r]r )r9rKrrr"r<sz-Command.ensure_string_list..Fz''%s' must be a list of strings (got %r)) r[r]r r\resplitrallr)rYr^raokrrr"ensure_string_lists   zCommand.ensure_string_listrcKs t|||}t|||SrT)rUreinitialize_commandrWrX)rYcommandreinit_subcommandsrZcmdrrr"rhszCommand.reinitialize_command)N)r) rBrCrDrUrEZcommand_consumes_argumentsrVrbrgrhrrrr"rs  cCs&ddtj|ddD}ttjj|S)z% Find all files under 'path' css,|]$\}}}|D]}tj||VqqdSrT)r&r(r))r9baser0r1filerrr"r<sz#_find_all_simple..Tr$)r&r'r r(r6)r(resultsrrr"_find_all_simples rocCs6t|}|tjkr.tjtjj|d}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) ror&curdir functoolspartialr(r*r r)r2r1Zmake_relrrr"findalls   rtc@seZdZdZdS)sicz;Treat this string as-is (https://en.wikipedia.org/wiki/Sic)N)rBrCrDrErrrr"rusru)9rEr&rrdistutils.corerLdistutils.filelistrcdistutils.errorsrdistutils.utilrfnmatchrZ_deprecation_warningrZsetuptools.extern.sixrr Zsetuptools.extern.six.movesr r Zsetuptools.version setuptoolsZsetuptools.extensionr Zsetuptools.distr Zsetuptools.dependsrrtype __metaclass____all__r.version __version__Zbootstrap_install_fromZrun_2to3_on_doctestsZlib2to3_fixer_packagesrrHr#rrrSrrMZ get_unpatchedrrUrorqrtstrruZ patch_allrrrr"sZ         F  2