zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
U
G=®dã@s’dZddlZddlZddlZddlZddlZddlZddl    m
Z
ddl m Z ddl mZddlmZddlmZmZdd    lmZmZddlZdd
lmZdd lmZdd lmZdd lmZe Z!dddddddgZ"eràe" #d¡ej$j%Z%dZ&dZ'dgZ(Gdd„dƒZ)Gdd„de)ƒZ*e)j+Z,er&e*j+Z-dd„Z.dd„Z/ej0j/je/_e 1ej0j2¡Z3Gdd„de3ƒZ2d d!„Z4ej5fd"d#„Z6Gd$d%„d%e7ƒZ8e 9¡dS)&z@Extensions to the 'distutils' for large or complex distributionséN)ÚDistutilsOptionError)Ú convert_path©Ú fnmatchcaseé)ÚSetuptoolsDeprecationWarning)ÚPY3Ú string_types)ÚfilterÚmap)Ú    Extension)Ú Distribution)ÚRequire)ÚmonkeyÚsetupr ÚCommandr rrÚ find_packagesÚfind_namespace_packagesTz lib2to3.fixesc@sBeZdZdZeddd„ƒZedd„ƒZed    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)ÚclsÚwhereÚexcludeÚincluderrúJD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/__init__.pyÚfind7s
 ýzPackageFinder.findc cs tj|ddD]Œ\}}}|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)    ÚosÚwalkÚpathÚjoinÚrelpathÚreplaceÚsepÚ_looks_like_packageÚappend) rrr r!ÚrootÚdirsÚfilesZall_dirsÚdirÚ    full_pathÚrel_pathÚpackagerrr"rNs  z!PackageFinder._find_packages_itercCstj tj |d¡¡S)z%Does a directory look like a package?z __init__.py)r&r(Úisfiler)©r(rrr"r-jsz!PackageFinder._looks_like_packagecs ‡fdd„S)z
        Given a list of patterns, return a callable that will be true only if
        the input matches at least one of the patterns.
        cst‡fdd„ˆDƒƒS)Nc3s|]}tˆ|dVqdS))ÚpatNr)Ú.0r8©Únamerr"Ú    <genexpr>usz@PackageFinder._build_filter.<locals>.<lambda>.<locals>.<genexpr>)Úanyr:©Úpatternsr:r"Ú<lambda>uóz-PackageFinder._build_filter.<locals>.<lambda>rr>rr>r"roszPackageFinder._build_filterN)rrr)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú classmethodr#rÚ staticmethodr-rrrrr"r2s 
 
rc@seZdZedd„ƒZdS)ÚPEP420PackageFindercCsdS)NTrr7rrr"r-ysz'PEP420PackageFinder._looks_like_packageN)rBrCrDrGr-rrrr"rHxsrHcCs>Gdd„dtjjƒ}||ƒ}|jdd|jr:| |j¡dS)Nc@s eZdZdZdd„Zdd„ZdS)z4_install_setup_requires.<locals>.MinimalDistributionzl
        A minimal version of a distribution for supporting the
        fetch_build_eggs interface.
        cs6d}‡fdd„t|ƒtˆƒ@Dƒ}tjj ||¡dS)N)Zdependency_linksÚsetup_requirescsi|]}|ˆ|“qSrr)r9Úk©Úattrsrr"Ú
<dictcomp>ŽsÿzQ_install_setup_requires.<locals>.MinimalDistribution.__init__.<locals>.<dictcomp>)ÚsetÚ    distutilsÚcorer Ú__init__)ÚselfrLZ_inclÚfilteredrrKr"rQŒs
 
þz=_install_setup_requires.<locals>.MinimalDistribution.__init__cSsdS)zl
            Disable finalize_options to avoid building the working set.
            Ref #2158.
            Nr)rRrrr"Úfinalize_options”szE_install_setup_requires.<locals>.MinimalDistribution.finalize_optionsN)rBrCrDrErQrTrrrr"ÚMinimalDistribution‡srUT)Zignore_option_errors)rOrPr Úparse_config_filesrIZfetch_build_eggs)rLrUÚdistrrr"Ú_install_setup_requires„s
 rXcKst|ƒtjjf|ŽS©N)rXrOrPrrKrrr"r¢sc@s:eZdZejZdZdd„Zd dd„Zdd„Zd d
d „Z    dS)rFcKst ||¡t|ƒ |¡dS)zj
        Construct the command for dist, updating
        vars(self) with any keyword parameters.
        N)Ú_CommandrQÚvarsÚupdate)rRrWÚkwrrr"rQ³s zCommand.__init__NcCsBt||ƒ}|dkr"t|||ƒ|St|tƒs>td|||fƒ‚|S)Nz'%s' must be a %s (got `%s`))ÚgetattrÚsetattrÚ
isinstancer    r)rRÚoptionÚwhatÚdefaultÚvalrrr"Ú_ensure_stringlike»s
 
ÿzCommand._ensure_stringlikecCspt||ƒ}|dkrdSt|tƒr6t||t d|¡ƒn6t|tƒrTtdd„|Dƒƒ}nd}|sltd||fƒ‚dS)zîEnsure 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|tƒVqdSrY)r`r    )r9Úvrrr"r<Òsz-Command.ensure_string_list.<locals>.<genexpr>Fz''%s' must be a list of strings (got %r))    r^r`r    r_ÚreÚsplitrÚallr)rRrardÚokrrr"Úensure_string_listÅs
 
 
ÿÿzCommand.ensure_string_listrcKs t |||¡}t|ƒ |¡|SrY)rZÚreinitialize_commandr[r\)rRÚcommandÚreinit_subcommandsr]Úcmdrrr"rlÚszCommand.reinitialize_command)N)r)
rBrCrDrZrEZcommand_consumes_argumentsrQrerkrlrrrr"r®s 
 
cCs&dd„tj|ddDƒ}ttjj|ƒS)z%
    Find all files under 'path'
    css,|]$\}}}|D]}tj ||¡VqqdSrY)r&r(r))r9Úbaser0r1Úfilerrr"r<äsþz#_find_all_simple.<locals>.<genexpr>Tr$)r&r'r
r(r6)r(Úresultsrrr"Ú_find_all_simpleàs þrscCs6t|ƒ}|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)    rsr&ÚcurdirÚ    functoolsÚpartialr(r*r r)r2r1Zmake_relrrr"Úfindallìs
 
 
rxc@seZdZdZdS)Úsicz;Treat this string as-is (https://en.wikipedia.org/wiki/Sic)N)rBrCrDrErrrr"ryøsry):rEr&rvZsetuptools.distutils_patchÚ
setuptoolsÚdistutils.corerOÚdistutils.filelistrgÚdistutils.errorsrÚdistutils.utilrÚfnmatchrZ_deprecation_warningrZsetuptools.extern.sixrr    Zsetuptools.extern.six.movesr
r Zsetuptools.versionZsetuptools.extensionr Zsetuptools.distr Zsetuptools.dependsrÚrÚtypeÚ __metaclass__Ú__all__r.ÚversionÚ __version__Zbootstrap_install_fromZrun_2to3_on_doctestsZlib2to3_fixer_packagesrrHr#rrrXrrPZ get_unpatchedrrZrsrurxÚstrryZ    patch_allrrrr"Ú<module>s\        ý
F 2