python (3.11.7)

(root)/
lib/
python3.11/
site-packages/
setuptools/
config/
__pycache__/
expand.cpython-311.pyc

*e?(dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZmZmZmZmZmZmZmZmZmZmZmZddlmZdd	lmZdd
l m!Z!ddl"m#Z$erdd
l%m&Z&ddl'm(Z(ddl)m*Z*ej+Z,ee-ej.fZ/edZ0eddZ1GddZ2	d@dee-dee/dee-fdZ3d@dee-e4ee/fde-fdZ5dee/dee/fdZ6dee4e/fde-fdZ7de/de-fdZ8		dAd e-d!eee-e-fdee/fd"Z9d#e-d$ee/de
fd%Z:d&e
d#e-defd'Z;d#e-d!eee-e-fde/dee/ee-e-ffd(Z<		dAd)e-d!eee-e-fdee/defd*Z=		dAd+ee-e-fd!eee-e-fdee/dee-effd,Z>dddd-d.eee-e-fdee/dee-fd/Z?d0e/d1e/de-fd2Z@d3eeeee-eAfe-fde-fd4ZBd5eCdeCfd6ZD	d@d7eeEeCfdee/deee-ee-ffd8ZFdBd:e-dee-eCffd;ZGGd<d=ZHGd>d?ee0e1fZIdS)CaiUtility functions to expand configuration directives or special values
(such glob patterns).

We can split the process of interpreting configuration files into 2 steps:

1. The parsing the file contents from strings to value objects
   that can be understand by Python (for example a string with a comma
   separated list of keywords into an actual Python list of strings).

2. The expansion (or post-processing) of these values according to the
   semantics ``setuptools`` assign to them (for example a configuration field
   with the ``file:`` directive should be expanded from a list of file paths to
   a single string with the contents of those files concatenated)

This module focus on the second step, and therefore allow sharing the expansion
functions among several configuration file formats.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.
N)iglob)ConfigParser)
ModuleSpec)chain)
TYPE_CHECKINGCallableDictIterableIteratorListMappingOptionalTupleTypeVarUnioncast)Path)
ModuleType)DistutilsOptionError)	same_path)Distribution)ConfigDiscovery)DistributionMetadata_K_VT)	covariantcdeZdZdZdedefdZdeee	j
e	j
ffdZdZdS)	StaticModulez>Proxy to a module object that avoids executing arbitrary code.namespecctjtj|j}t
|t|`	dSN)
astparsepathlibrorigin
read_bytesvarsupdatelocalsself)r,r r!modules    Z/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/site-packages/setuptools/config/expand.py__init__zStaticModule.__init__BsP7<44??AABBT

&((###IIIreturnc#K|jjD]gttjrfdjDEd{V6ttjrjrjjfVhdS)Nc3*K|]
}|jfVdSr#value).0target	statements  r.	<genexpr>z1StaticModule._find_assignments.<locals>.<genexpr>Js*VV&VY_5VVVVVVr0)	r-body
isinstancer$Assigntargets	AnnAssignr5r7)r,r8s @r._find_assignmentszStaticModule._find_assignmentsGs)	:	:I)SZ00
:VVVVIDUVVVVVVVVVVVIs}55
:)/
: '9999		:	:r0c	tfd|DS#t$r}t|jd|d}~wwxYw)zHAttempt to load an attribute "statically", via :func:`ast.literal_eval`.c3K|]@\}}t|tjr!|jk*tj|VAdSr#)r;r$Nameidliteral_eval)r6r7r5attrs   r.r9z+StaticModule.__getattr__.<locals>.<genexpr>Qsa!FEfch//5;I4E4E ''4E4E4E4Er0z has no attribute N)nextr?	ExceptionAttributeErrorr )r,rEes ` r.__getattr__zStaticModule.__getattr__Ns	P%)%;%;%=%=

	P	P	P DI!G!G!G!GHHaO	Ps,0
AAAN)
__name__
__module____qualname____doc__strrr/rrr$ASTr?rJr0r.rr?s~HHS

:8E#'372B,C#D::::	P	P	P	P	Pr0rpatternsroot_dirr1c
hd}g}ptj|D]tfd|Dr{tjtj}|tfdt|dDtj	
tjd}|||S)aExpand the list of glob patterns, but preserving relative paths.

    :param list[str] patterns: List of glob patterns
    :param str root_dir: Path to which globs should be relative
                         (current directory by default)
    :rtype: list
    >*{}?[]c3 K|]}|vV	dSr#rQ)r6charr5s  r.r9z glob_relative.<locals>.<genexpr>js'99tu}999999r0c3K|]B}tj|tjdVCdS)/N)ospathrelpathreplacesepr6r`rSs  r.r9z glob_relative.<locals>.<genexpr>msY*>*>h//77DD*>*>*>*>*>*>r0T)	recursiver^)
r_getcwdanyr`abspathjoinextendsortedrrarbrcappend)rRrSglob_charactersexpanded_values	glob_pathr`r5s `    @r.
glob_relativerpZs!544OO&29;;H
)
)999999999
	)Xu(E(EFFI""6*>*>*>*>!)t<<<*>*>*>$>$>
?
?
?
?7??5(33;;BFCHHD""4((((r0	filepathscddlm}tjptjfd||D}dfdt|DS)zReturn the content of the files concatenated using ``
`` as str

    This function is sandboxed and won't reach anything outside ``root_dir``

    (By default ``root_dir`` is the current directory).
    r)always_iterablec3XK|]$}tj|V%dSr#)r_r`rirds  r.r9zread_files.<locals>.<genexpr>s3VV4"',,x..VVVVVVr0
c3VK|]#}t|t|V$dSr#)
_assert_local
_read_filerds  r.r9zread_files.<locals>.<genexpr>sOx((4r0) setuptools.extern.more_itertoolsrsr_r`rhrfri_filter_existing_files)rqrSrs
_filepathss `  r.
read_filesr|ysA@@@@@wx629;;77HVVVV??9;U;UVVVJ99*:66r0c#K|D]>}tj|r|V&tjd|d?dS)NzFile z cannot be found)r_r`isfilewarningswarn)rqr`s  r.rzrzs_<<
7>>$	<JJJJM:$:::;;;;	<<r0filepathctj|d5}|cdddS#1swxYwYdS)Nzutf-8)encoding)ioopenread)rfs  r.rxrxs	G	,	,	,vvxxs8<<cttj|ttj|jvrd|d|d}t|dS)NzCannot access z (or anything outside )T)rr_r`rhparentsr)rrSmsgs   r.rwrwsgBGOOH%%&&d27??83L3L.M.M.UUUNxNNNNN"3'''4r0	attr_descpackage_dirc|ptj}|d}|}d|}|pd}t
|||\}}}t||}	tt|||S#t$r#t||}	t|	|cYSwxYw)aReads the value of an attribute from a module.

    This function will try to read the attributed statically first
    (via :func:`ast.literal_eval`), and only evaluate the module if it fails.

    Examples:
        read_attr("package.attr")
        read_attr("package.module.attr")

    :param str attr_desc: Dot-separated string describing how to reach the
        attribute (see examples above)
    :param dict[str, str] package_dir: Mapping of package names to their
        location in disk (represented by paths relative to ``root_dir``).
    :param str root_dir: Path to directory containing all the packages in
        ``package_dir`` (current directory by default).
    :rtype: str
    .r/)r_rfstripsplitpopri_find_module
_find_specgetattrrrG
_load_spec)
rrrS
attrs_path	attr_namemodule_name_parent_pathr`r!r-s
          r.	read_attrrs,&29;;H""((--J  I((:&&K+K&2;X&V&V#L$k4((D*|K66	BBB***D+..vy)))))*sB..*CCrmodule_pathctj||}|ptj|}|t	||Sr#)	importlibutilspec_from_file_location	find_specModuleNotFoundError)rrr!s   r.rrsK>11+{KKD89>++K88D|!+...Kr0r!ct|d|}|tjvrtj|Stj|}|tj|<|j||S)NrK)rsysmodulesrrmodule_from_specloaderexec_module)r!rr r-s    r.rrsi4[11Ds{{4  
^
,
,T
2
2FCKKF###Mr0c|}|d}|r|d|vr||d}|dd}t|dkr/tj||d}|d}n|}d|g|dd}n*d|vr&tj||d}tjj|g|dR}t
|dtj|dft|d	}	td
|	Dd}
||
|fS)a0Given a module (that could normally be imported by ``module_name``
    after the build is complete), find the path to the parent directory where
    it is contained and the canonical name that could be used to import it
    considering the ``package_dir`` in the build configuration and ``root_dir``
    rrr^Nz.pyz__init__.pyz.*c3XK|]%}tj|!|V&dSr#)r_r`r~)r6xs  r.r9z_find_module.<locals>.<genexpr>s5CCa1B1BCCCCCCCr0)	rrsplitlenr_r`rirrrF)rrrSparent_pathmodule_partscustom_pathparts
parent_module
path_start
candidatesrs           r.rrsoK$$S))L
B?k))%l1o6K&&sA..E5zzA~~ gll8U1X>> %a

 +
((M#EL4D#EFFKK
;

',,xRAAKkCK,=,=c,B,BCCCJ			RW\\*mDDE
  JCC:CCCTJJK[00r0qualified_class_namec
|ptj}|d}||dzd}|d|}t|||\}}}t	t|||}	t
|	|S)z@Given a qualified class name, return the associated class objectrrN)r_rfrfindrrrr)
rrrSidx
class_namepkg_namerr`rr-s
          r.
resolve_classrs&29;;H

$
$S
)
)C%cAgii0J#DSD)H&28[(&S&S#L$

;55{
C
CF6:&&&r0valuescHfd|DS)zGiven a dictionary mapping command names to strings for qualified class
    names, apply :func:`resolve_class` to the dict values.
    c:i|]\}}|t|SrQ)r)r6kvrrSs   r.
<dictcomp>zcmdclass.<locals>.<dictcomp>s+RRR41aA}QX66RRRr0)items)rrrSs ``r.cmdclassrs,SRRRR6<<>>RRRRr0)
namespacesfill_package_dirrSrc
ddlm}ddlm}m}|rddlm}nddlm}|ptj}|	ddg}g}	|in|}t|||
t
d	kr9t
fd
d|fDr|
d
d
D]}
t||
}|j|fi|}|	||rX|d|
ks?tj||s||||
|	S)aWorks similarly to :func:`setuptools.find_packages`, but with all
    arguments given as keyword arguments. Moreover, ``where`` can be given
    as a list (the results will be simply concatenated).

    When the additional keyword argument ``namespaces`` is ``True``, it will
    behave like :func:`setuptools.find_namespace_packages`` (i.e. include
    implicit namespaces as per :pep:`420`).

    The ``where`` argument will be considered relative to ``root_dir`` (or the current
    working directory when ``root_dir`` is not given).

    If the ``fill_package_dir`` argument is passed, this function will consider it as a
    similar data structure to the ``package_dir`` configuration parameter add fill-in
    any missing package location.

    :rtype: list
    r)construct_package_dir)unique_everseenrs)PEP420PackageFinder)
PackageFinderwhererNrc3FK|]}td|VdS)rN)
_same_path)r6rsearchs  r.r9z find_packages.<locals>.<genexpr>=s4VVJvay!$<$< <VVVVVVr0r)setuptools.discoveryrryrrsrrr_curdirrlistrall
setdefault
_nest_pathfindrjgetr`samefiler*)rrrSkwargsrrrsrrpackagesr`package_pathpkgsrs             @r.
find_packagesrs0;:::::QQQQQQQQ7MMMMMMM666666$29HJJw&&EH-5rr;K
////%"8"899
:
:F
6{{aCVVVVsHoVVVVV##Bq	222GG!(D11!}!,99&99	G  $$,,wh77
-
##$9$9$$E$EFFFOr0parentr`c|dvr|ntj||}tj|S)N>rr)r_r`rinormpath)rr`s  r.rrMs;Y&&66BGLL,F,FD
7D!!!r0r5cBt|r
|}ttttt
f|}t
|ts>t|dr)dtt|}nd|z}|S)z`When getting the version directly from an attribute,
    it should be normalised to string.
    __iter__rz%s)
callablerr
rrOintr;hasattrrimapr4s r.versionrRs%S/*E22EeS!!!5*%%	!HHSe__--EE5LELr0package_datac>d|vr|d|d<|S)NrUr)r)rs r.canonic_package_datards+
l'++C00Rr0
data_filescrt|tr|Sfd|DS)zFor compatibility with ``setup.py``, ``data_files`` should be a list
    of pairs instead of a dict.

    This function also expands glob patterns.
    c:g|]\}}|t|fSrQ)rp)r6destrRrSs   r.
<listcomp>z&canonic_data_files.<locals>.<listcomp>us<D(
}Xx001r0)r;rr)rrSs `r.canonic_data_filesrjsT*d##(..00r0entry-pointstextctdd}t|_|||d|D}||jd|S)a?Given the contents of entry-points file,
    process it into a 2-level dictionary (``dict[str, dict[str, str]]``).
    The first level keys are entry-point groups, the second level keys are
    entry-point names, and the second level values are references to objects
    (that correspond to the entry-point value).
    N)=)default_section
delimiterscXi|]'\}}|t|(SrQ)dictr)r6rrs   r.rz entry_points.<locals>.<dictcomp>s,
<
<
<TQaaggii
<
<
<r0)rrOoptionxformread_stringrrr)rtext_sourceparsergroupss    r.entry_pointsr{sk$6
B
B
BFF
t[)))
<
<V\\^^
<
<
<F
JJv%t,,,Mr0cteZdZdZddZdZdZdZdee	e	ffd	Z
edee	e	ffd
ZdS)
EnsurePackagesDiscoveredaSome expand functions require all the packages to already be discovered before
    they run, e.g. :func:`read_attr`, :func:`resolve_class`, :func:`cmdclass`.

    Therefore in some cases we will need to run autodiscovery during the evaluation of
    the configuration. However, it is better to postpone calling package discovery as
    much as possible, because some parameters can influence it (e.g. ``package_dir``),
    and those might not have been processed yet.
    distributionrc"||_d|_dS)NF)_dist_called)r,rs  r.r/z!EnsurePackagesDiscovered.__init__s!
r0c\|js$d|_|jddSdS)zBTrigger the automatic package discovery, if it is still necessary.TF)r N)rrset_defaultsr,s r.__call__z!EnsurePackagesDiscovered.__call__s<|	0DLJ###/////	0	0r0c|Sr#rQrs r.	__enter__z"EnsurePackagesDiscovered.__enter__sr0cT|jr |jjdSdSr#)rrranalyse_name)r,	_exc_type
_exc_value
_tracebacks    r.__exit__z!EnsurePackagesDiscovered.__exit__s3<	3J#0022222	3	3r0r1c:||jj}|in|Sr#)rr)r,pkg_dirs  r._get_package_dirz)EnsurePackagesDiscovered._get_package_dirs%*(_rr'1r0c*t|jS)zCProxy to ``package_dir`` that may trigger auto-discovery when used.)LazyMappingProxyrrs r.rz$EnsurePackagesDiscovered.package_dirs  5666r0N)rr)
rKrLrMrNr/r	rrr
rOrpropertyrrQr0r.rrs0003332'#s("32222
7WS#X.777X777r0rceZdZdZdegeeefffdZdeeeffdZ	dedefdZ
defdZde
efd	Zd
S)raMapping proxy that delays resolving the target object, until really needed.

    >>> def obtain_mapping():
    ...     print("Running expensive function!")
    ...     return {"key": "value", "other key": "other value"}
    >>> mapping = LazyMappingProxy(obtain_mapping)
    >>> mapping["key"]
    Running expensive function!
    'value'
    >>> mapping["other key"]
    'other value'
    obtain_mapping_valuec"||_d|_dSr#)_obtain_value)r,rs  r.r/zLazyMappingProxy.__init__s+15r0r1cP|j||_|jSr#)rrrs r._targetzLazyMappingProxy._targets!;,,..DK{r0keyc6||Sr#)r)r,rs  r.__getitem__zLazyMappingProxy.__getitem__s||~~c""r0cDt|Sr#)rrrs r.__len__zLazyMappingProxy.__len__s4<<>>"""r0cDt|Sr#)iterrrs r.rzLazyMappingProxy.__iter__sDLLNN###r0N)rKrLrMrNrr
rrr/rr!rr#rrrQr0r.rrs6Xb'"b&/6I-J6666R
#r#b#########$(2,$$$$$$r0rr#)NN)r)JrNr$rrr_r&rrglobrconfigparserrimportlib.machineryr	itertoolsrtypingrrr	r
rrr
rrrrrrtypesrdistutils.errorsr_pathrrsetuptools.distrrrdistutils.distr
from_iterable
chain_iterrOPathLike_Pathrrrrpbytesr|rzrxrwrrrrrrrrrrrrrrrrrrQr0r.<module>r5s&


								



%%%%%%******



























111111++++++4,,,,,,444444333333

 

c2;WT]]WTT"""PPPPPPPP8:>sm'/	#Y>%UHUO ;<PS$<huo<(5/<<<<ue|,
ES04 $#*#*#*'#s(+,#*uo#*#*#*#*LChuo*Zcj11#+GCH,=#>1JO1
5(3-$%1111H04 $
'
'
''#s(+,
'uo
'	
'
'
'
'$04 $SScNS'#s(+,SuoS
#x-	SSSS15 $	333tCH~.3uo	3
#Y
3333l"u"E"c""""
58E#s(O#<cABs$t@DdDj!-5e_	%T#Y
 "s4T	?#7#7#7#7#7#7#7#7L$$$$$wr2v$$$$$r0