0A7h8dgZddlZddlZddlZddlZddlZddlZddlZddl Zddl Zddl Zddl m Z ddlmZddlmZddlmZddlZddlZddlmZddlmZmZmZmZdd lmZdd lm Z dd l!m"Z"dd l#m$Z$m%Z%dd l m&Z&ddl'm(Z(ddl'm)Z)ddl*m+Z+m,Z,ddl-Z-ddl.Z-ddl-m/Z/ddl0m1Z1ddl2m3Z3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:ddl9m;Z;ddl9mZ>ddl?m@Z@mAZAerddlBmCZCeDdeDddZEd eFd!eFfd"ZGd#d$d%eFd!eeFfd&ZHd#d$d%eFd!eeFfd'ZId#d$d%eFd!eeeFfd(ZJd#d$d!eeFfd)ZKd*ZLd+ZMd,ZNeOePfZQd-ZRd.ZSd/ZTd0ZUd1ZVd2ZWd3ZXd4ZYd5ZZd6Z[d7Z\d8Z]d9Z^d:Z_e1ejjZbGd;debZaGd<d=eAZcy)> DistributionN) strtobool)DEBUG)translate_longopt)iglob)suppress)ListOptionalSet TYPE_CHECKING)Path) defaultdict)message_from_file)DistutilsOptionErrorDistutilsSetupError) rfc822_escape) packaging) ordered_set)unique_everseen partition)windows_support) get_unpatched)setupcfg pyprojecttoml)ConfigDiscoveryversion)_reqs) _entry_points)_normalization)metadata)InformationOnlySetuptoolsDeprecationWarning)Messagez&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versionc\t|dd}|tjd}||_|S)Nmetadata_version2.1)getattrrVersionr')selfmvs 1/usr/lib/python3/dist-packages/setuptools/dist.pyget_metadata_versionr.6s1 )4 0B z __U # " Icontentreturnc |j}t|dk(r|djSdj|djt j dj|ddfS)zFReverse RFC-822 escaping by removing leading whitespaces from content.rr N) splitlineslenlstripjointextwrapdedent)r0liness r-rfc822_unescaper;>sc    E 5zQQx  99eAhoo'599M)NO PPr/msgr%fieldc||}|dk(ry|S)zRead Message header field.UNKNOWNNr<r=values r-_read_field_from_msgrCFs JE  Lr/c8t||}||St|S)z4Read Message header field and apply rfc822_unescape.)rCr;rAs r-_read_field_unescaped_from_msgrENs# e ,E } 5 !!r/c6|j|d}|gk(ry|S)z9Read Message header field and return all results as list.N)get_all)r<r=valuess r-_read_list_from_msgrIVs! [[ %F | Mr/cR|jj}|dk(s|sy|S)Nr?) get_payloadstrip)r<rBs r-_read_payload_from_msgrM^s) OO  # # %E  Lr/ct|}tj|d|_t |d|_t |d|_t |d|_t |d|_d|_t |d|_ d|_ t |d|_ t |d |_ t|d |_t|d |_|j2|jtjd k\rt!||_t |d|_d |vr t |d j#d|_t'|d|_t'|d|_|jtjdk(r4t'|d|_t'|d|_t'|d|_nd|_d|_d|_t'|d|_y)z-Reads the metadata values from a file object.zmetadata-versionnamersummaryauthorNz author-emailz home-pagez download-urllicense descriptionr(keywords,platform classifierz1.1requiresprovides obsoletesz license-file)rrr*r'rCrOrSrQ maintainer author_emailmaintainer_emailurl download_urlrErRlong_descriptionrMsplitrTrI platforms classifiersrXrYrZ license_files)r+filer<s r- read_pkg_filerfes D !C#OOC0B,CDD$S&1DI'Y7DL+C;D&sH5DKDO,S.AD D#C5DH,S.AD1#yADL:3 ND $)>)>'// C*!7s ;+C;DS,S*=CCCH (j9DN*3 =D  66+C< +C< ,S+>  ,S.ADr/cd|vr:d}tjd||jjdd}|S)zF Quick and dirty validation for Summary pypa/setuptools#1390. r3zBnewlines are not allowed in `summary` and will break in the futurezInvalid config.r)r$emitrLra)valr<s r- single_linerjsD s{S$))*;SAiik%a( Jr/c4|j}fd}|dt||d|j|d|j|j }|r|dt |d}|D]\}}t ||d}|||| |j} | r|dt| |jjD]} |d d | zd j|j} | r |d | |jxsg} | D] } |d |  |jd|j|jd|j!|jd|j#|jd|j%t'|dr|d|j(|j*r|d|j*|j,r#t/|j,D] }|d| |jd|j0xsg|j3}|r8j5d|z|j7dsj5dyyy)z0Write the PKG-INFO format data to a file object.c4j|d|dy)Nz: r3)write)keyrBres r- write_fieldz#write_pkg_file..write_fields e,-r/zMetadata-VersionNamer*Summary))z Home-pager^)z Download-URLr_)AuthorrQ)z Author-emailr\) Maintainerr[)zMaintainer-emailr]NLicensez Project-URLz%s, %srUKeywordsPlatform ClassifierRequiresProvides Obsoletespython_requireszRequires-PythonzDescription-Content-TypezProvides-Extraz License-Filez %sr3)r.strget_name get_versionget_descriptionrjr) get_licenser project_urlsitemsr7 get_keywords get_platforms _write_listget_classifiers get_requires get_provides get_obsoleteshasattrr{long_description_content_typeprovides_extrassortedrdget_long_descriptionrmendswith)r+rerrorPoptional_fieldsr=attrattr_valrR project_urlrTrbrVextrar`s ` r-write_pkg_filers'')G."CL1 ( 4++-.""$GI{734O') t4t,   x ()  GI}W56((..0; M8k#9:;xx))+,HJ)""$*I*J)* T<)=)=)?@ T:t'8'8':;T:t'8'8':;T;(:(:(<=t&'%t';';< )).0R0RS D001 1E (% 0 1 T>4+=+=+CD002 6,,-((. JJt /r/c tj|dd}|jrJy#ttt t f$r}t|d|d|d}~wwxYw)N)rBrOgroupz/ must be importable 'module:attrs' string (got ))r" EntryPointextras TypeError ValueErrorAttributeErrorAssertionErrorr)distrrBepes r-check_importablersZ  u4t D99}9 z>> B!FJE R  s&)AAAc t|ttfsJdj||k7sJy#tt t tf$r}t|d|d|d}~wwxYw)z"Verify that value is a string listz must be a list of strings (got rN) isinstancelisttupler7rrrrrrrrBrs r-assert_string_listrsd %$///wwu~&&& z>> B!7;U C  s.1A! AA!c|}t||||D]x}|j|stdd|zz|jd\}}}|r%||vr!tj j d||tjdddzy ) z(Verify that namespace packages are validz1Distribution contains no modules or packages for znamespace package %r.z^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyz/The namespace_packages parameter is deprecated.z 2! &   s14A AAc|jd\}}} t|t tj|y#tjj$rd|d|d}t |dwxYw)N:zInvalid environment marker: z (r) r _check_markerrmarkers InvalidMarkerrrrparse)rreqsrOrmarkerr<s r-rr*su,D#v1f T     * *1,VHBuiqA!#&D01s A3A4ch|sytjj|}|jyN)rrMarkerevaluate)rms r-rr4s'   (AJJLr/c\t||k7rd}t|j||y)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))rrBN)boolrformat)rrrBtmpls r- assert_boolr;s0 E{eA!$++4u+"EFFr/cT|stj|dyt|d)Nz is ignored.z is invalid.)DistDeprecationWarningrhrrrrBs r-invalid_unless_falserBs/ ##tfL$9: l3 44r/c ttj|t|tt fr t dy#t tf$r$}d}t|j|||d}~wwxYw)z9Verify that install_requires is a valid requirements listzUnordered types are not allowedzm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}rerrorN) rrrrdictsetrrrrrrrBrrs r-check_requirementsrJsv R U[[  edC[ )=> > * z "R O "$++4u+"EFEQ Rs?AA5A00A5c tjj|y#tjjtf$r$}d}t |j |||d}~wwxYw)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}rN)r specifiers SpecifierSetInvalidSpecifierrrrrs r-check_specifierrXscR))%0  1 1> BR W "$++4u+"EFEQ Rs"#A)A$$A)cj tj|y#t$r}t||d}~wwxYw)z)Verify that entry_points map is parseableN)r load Exceptionrrs r-check_entry_pointsrcs2,5! ,!!$!+,s 2 -2c:t|ts tdy)Nztest_suite must be a string)rr|rrs r-check_test_suiterks eS !!"?@@ "r/ct|tstdj||j D]L\}}t|t stdj||t |dj||Ny)z@Verify that value is a dictionary of package names to glob listszT{!r} must be a dictionary mapping package names to lists of string wildcard patternsz,keys of {!r} dict must be strings (got {!r})zvalues of {!r} dictN)rrrrrr|r)rrrBkvs r-check_package_datarps eT "! ''-vd|   H1!S!%>EEdAN  4!6!=!=d!CQG Hr/c|D]9}tjd|rtjj d|;y)Nz \w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrrr)rrrBpkgnames r-check_packagesrs9xx0 MM  8 r/czeZdZdZdeej dddZdZdZ d0dZ d Z d Z e d Ze d Zd ZdZe dZdZdZdZe dZd0dZdZdZdZd0dZdZd1dZdZdZe dZ dZ!dZ"d Z#d!Z$d"Z%d#Z&d$Z'd%Z(d&Z)d'Z*d(Z+d)Z,d*Z-d+Z.d,Z/d-Z0d.Z1fd/Z2xZ3S)2raG Distribution with support for tests and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'install_requires' -- a string or sequence of strings specifying project versions that the distribution requires when installed, in the format used by 'pkg_resources.require()'. They will be installed automatically when the package is installed. If you wish to use packages that are not available in PyPI, or want to give your users an alternate download location, you can add a 'find_links' option to the '[easy_install]' section of your project's 'setup.cfg' file, and then setuptools will scan the listed web pages for links that satisfy the requirements. 'extras_require' -- a dictionary mapping names of optional "extras" to the additional requirement(s) that using those extras incurs. For example, this:: extras_require = dict(reST = ["docutils>=0.3", "reSTedit"]) indicates that the distribution can optionally provide an extra capability called "reST", but it can only be used if docutils and reSTedit are installed. If the user installs your package using EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. cyrr@r@r/r-zDistribution.r/cyrr@r@r/r-rzDistribution.rr/cyrr@r@r/r-rzDistribution.rr/)rrr license_filerdNc~|rd|vsd|vrytjt|dj}t t j 5t j|}|>|jds-tjt|d|_ ||_ dddy#1swYyxYw)NrOrzPKG-INFO) r! safe_namer|lowerrr"PackageNotFoundError distribution read_text safe_version_version _patched_dist)r+attrsrOrs r-patch_missing_pkg_infoz#Distribution.patch_missing_pkg_infos e+y/E ''E&M(:;AAC h33 4 *((.Dz(B . ; ;Ci@P}|j dd}|s|jjj|@t|ddr|js|j|_ |j|jy)z Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. r{Nextras_requirerrinstall_requires) r)r{r"rr2keysraraddrr3_convert_extras_requirements"_move_install_requirements_markers)r+rs r-rzDistribution._finalize_requires<s 4*D 1,0,@,@DMM ) 4)4 0(,(A(A(XTEXEXD %,,113 = C(+MM1155e<  = 4+T 24;V;V*.*?*?D ' ))+ //1r/cbt|ddxsi}ttj}t|d||_|j D]`\}}|j|t j|D]4}|j|}|j||zj|6by)z Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. r2Nr) r)rrrrrrr _suffix_forappend)r+ spec_ext_reqstmpsectionrrsuffixs r-r6z)Distribution._convert_extras_requirementsVs  &6=C +001#*41F#L '--/ EJGQ  $ $W -[[^ E))!,((6)9:AA!D E Er/cN|jrdt|jzSdS)ze For a requirement, return the 'extras_require' suffix for that requirement. rr)rr|reqs r-r9zDistribution._suffix_forfs" ), sS_$::r/cd}tddxsd}ttj|}t ||}t j ||}ttt|_ |D]6}jdt|jzj|8tfdjjD_y)zv Move requirements in `install_requires` that are using environment markers `extras_require`. c|j SrrrAs r- is_simple_reqzFDistribution._move_install_requirements_markers..is_simple_reqxszz> !r/r3Nr@rc 3K|]B\}}|ttjdtj|DfDyw)c32K|]}t|ywr)r|).0r>s r- zLDistribution._move_install_requirements_markers...s"Ka3q6"KsN)rrfromkeysmap _clean_req)rIrrr+s r-rJzBDistribution._move_install_requirements_markers..sC# 1T]]"K3t3J"KKL M# sAA )r)rrrfilterr filterfalserLr|r3rrr:rrr2)r+rFspec_inst_reqs inst_reqs simple_reqs complex_reqsr>s` r-r7z/Distribution._move_install_requirements_markersns "!'94@FB^45 ]I6  ,,]IF $Sk%: ; DA  $ $S3qxx=%8 9 @ @ C D"# 00668#  r/cd|_|S)zP Given a Requirement, remove environment markers and return it. NrE)r+rBs r-rMzDistribution._clean_reqs  r/c|jj}|r|ng}|jj}|r||vr|j|||d}t t |j ||j_y)z>> list(Distribution._expand_patterns(['LICENSE'])) ['LICENSE'] >>> list(Distribution._expand_patterns(['setup.cfg', 'LIC*'])) ['setup.cfg', 'LICENSE'] c3K|]O}tt|D]6}|jds#tjj |r|8Qyw)~N)rrrospathisfile)rIpatternr]s r-rJz0Distribution._expand_patterns..sQ uW~. ==%"''..*>   sAAr@)rWs r-rVzDistribution._expand_patternss #  r/c :ddlm}tjtjk(rgngd}t |}||j }tr|jd|}t|_ |D]}tj|d5}tr)|jdjd it|j|ddd|j!D]r}|j#|}|j%|} |D]I} | d k(s| |vr |j'|| } |j)| |} |j+| |} || f| | <Kt|j-d |j.vry|j.d j1D]S\} \} } |j2j'| } | r t5|  } n| d vr t5| } t7|| xs| | Uy#1swY$xYw#t8$r}t;||d}~wwxYw) z Adapted from distutils.dist.Distribution.parse_config_files, this method provides the same functionality in subtly-improved ways. r) ConfigParser) z install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-dataprefixz exec-prefixhomeuserrootNz"Distribution.parse_config_files():utf-8encodingz reading {filename}__name__global)verbosedry_runr@) configparserrasysrb base_prefix frozensetfind_config_filesrannouncer| optionxformioopenrlocals read_filesectionsoptionsget_option_dictr warn_dash_deprecationmake_option_lowercaser command_optionsr negative_optrsetattrrr)r+ filenamesraignore_optionsparserfilenamereaderr=ryopt_dictoptrisrcaliasrs r-_parse_config_filesz Distribution._parse_config_filess . zzS__,  (#>2  ..0I  MM> ? ! HG4 )MM"?"8"?"?"K&("KL  ( )"??, 4 ..1//8"4Cj(C>,A  **Wc2C44S'BC44S'BC%-sOHSM4 4 OO ) , 4// /  $33H=CCE 5OC#s%%))#.E#C.(..n 5elsC0 57 ) )H 5*1-14 5s%AG3H3G= H HHc@|dvr|S|jdd}ttjtj j |j}|jds |dk7r||vr|Sd|vr tjdd|d|d d d |S) N)zoptions.extras_requirezoptions.data_files-_ryr"zInvalid dash-separated optionsz) Usage of dash-separated zZ will not be supported in future versions. Please use the underscore name z instead. !userguide/declarative_config.htmlr)rr-) replacerrchainrcommand__all___setuptools_commands startswithr$rh)r+rr=underscore_optcommandss r-r{z"Distribution.warn_dash_deprecations   JS#. OO!!))))+  ""9-:%x'! ! #: ( - -0)),0::H9KL=& r/c tjdjjS#tj$rgcYSwxYw)Nr%)r"rr namesr)r+s r-rz!Distribution._setuptools_commands$s> ((6CCII I,, I s(+AAc |dk7s|jr|S|j}tjdd|d|d|ddd |S) Nr"zInvalid uppercase configurationz$ Usage of uppercase key z in zL will not be supported in future versions. Please use lowercase z instead. rr)r)islowerrr$rh)r+rr= lowercase_opts r-r|z"Distribution.make_option_lowercase+si j CKKMJ $)) -$$'7$wk:33@2CD  9" r/c |j}||j|}tr|jd|z|j D]\}\}}tr|jd|d|d|d |j Dcgc] }t |}} |j} t|t} || vr| rt|| |t| nL||vr| rt||t|n/t||rt|||ntd|d|d |d ycc}w#t$rg}YwxYw#t$ri} YwxYw#t$r} t| | d} ~ wwxYw) a Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). 'command_obj' must be a Command instance. If 'option_dict' is not supplied, uses the standard option dictionary for this command (from 'self.command_options'). (Adopted from distutils.dist.Distribution._set_command_options) Nz# setting options for '%s' command:z z = z (from rz error in z : command 'z' has no such option 'r$)get_command_namerzrrrrboolean_optionsrrr~rr|rrrrr) r+ command_obj option_dict command_namer!sourcerBo bool_optsneg_opt is_stringrs r-_set_command_optionsz!Distribution._set_command_options=ss#335  ..|N:NOy(YK51AB[&1K7.!<9+ 5X!   "    5*1-14 5sO9D.D)D. D?)A=E)D.. D<;D<? E  E  E* E%%E*cg}t|jxstjd}|-t d|}t |d}t |d}||fS|j r|g}||fS)z/Add default file and split between INI and TOMLzpyproject.tomlc2t|jdk(S)Nz.toml)r r?)fs r-rz8Distribution._get_project_config_files..psQ'(Ar/rr)r rr\curdirrrexists)r+r tomlfilesstandard_project_metadatapartss r-_get_project_config_filesz&Distribution._get_project_config_filesks} $()C"))EU$V!  A9MEU1XIU1XI)##' - - /23I)##r/c|j|\}}|j|tj||j||D]}t j ||||j|jy)zXParses configuration files from various levels and loads configuration. )r)ignore_option_errorsN) rrrparse_configurationr}rapply_configurationrrX)r+rrinifilesrrs r-parse_config_fileszDistribution.parse_config_filesws#<R S T ! $$&r/c ddlm}|||S)zResolve pre-setup requirementsr)_fetch_build_eggs)setuptools.installerr)r+rXrs r-fetch_build_eggszDistribution.fetch_build_eggss: x00r/cd}d}tj|}tj|j|}t d|}t ||D] }|| y)z Allow plugins to apply arbitrary operations to the distribution. Each hook may optionally define a 'order' to influence the order of execution. Smaller numbers go first and the default is 0. z(setuptools.finalize_distribution_optionsct|ddS)Norderr)r))hooks r-by_orderz/Distribution.finalize_options..by_orders4!, ,r/rc"|jSr)r)rs r-rz/Distribution.finalize_options..s qvvxr/)rnN)r"r rrO_removedrLr)r+rrdefinedfilteredloadedrs r-finalize_optionszDistribution.finalize_optionss`; -''e4((@'2X. B tH r/c$dh}|j|vS)z When removing an entry point, if metadata is loaded from an older version of Setuptools, that removed entry point will attempt to be loaded and will fail. See #2765 for more details. 2to3_doctests)rO)rremoveds r-rzDistribution._removeds  ww'!!r/ctjdD]>}t||jd}||j ||j|@y)Nrr)r"r r)rOr)r+rrBs r-_finalize_setup_keywordsz%Distribution._finalize_setup_keywordssM''.HI 0BD"''40E  $/ 0r/ctjjtjd}tjj |stj |t j|tjj|d}t|d5}|jd|jd|jdddd|S|S#1swY|SxYw)Nz.eggsz README.txtwzcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. zAThis directory caches those eggs to prevent repeated downloads. z/However, it is safe to delete this directory. ) r\r]r7rrmkdirr hide_filerurm)r+ egg_cache_dirreadme_txt_filenamers r-get_egg_cache_dirzDistribution.get_egg_cache_dirs RYY8 ww~~m, HH] #  % %m 4"$'',,}l"K )3/ M1J.KL M} Ms $4C$$C.c ddlm}|||S)z Fetch an egg needed for buildingr)fetch_build_egg)rr)r+rBrs r-rzDistribution.fetch_build_eggs8tS))r/c||jvr|j|Stjd|}|D]$}|jx|j|<}|cStj ||S)z(Pluggable version of get_command_class()distutils.commands)rrO)cmdclassr"r rr get_command_class)r+repsrrs r-rzDistribution.get_command_classst dmm #==) )##*>WM BB02 9DMM' "XO B!224A Ar/ctjdD]D}|j|jvs|j }||j|j<Ft j |SNrr)r"r rOrrr print_commandsr+rrs r-rzDistribution.print_commandss]''.BC 2Bwwdmm+779)1 bgg& 2++D11r/ctjdD]D}|j|jvs|j }||j|j<Ft j |Sr)r"r rOrrr get_command_listrs r-rzDistribution.get_command_lists]''.BC 2Bwwdmm+779)1 bgg& 2--d33r/c |jD]2\}}t|d|zd}|r ||!|j||4y)aAdd items to distribution that are named in keyword arguments For example, 'dist.include(py_modules=["x"])' would add 'x' to the distribution's 'py_modules' attribute, if it was not already there. Currently, this method only supports inclusion for attributes that are lists or tuples. If you need to add support for adding to other attributes in this or a subclass, you can add an '_include_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})' will try to call 'dist._include_foo({"bar":"baz"})', which can then handle whatever special inclusion logic is needed. _include_N)rr) _include_misc)r+rrrincludes r-rzDistribution.includesIKKM )DAqdK!OT:G ""1a(  )r/c|dz}|jr7|jDcgc]}||k7s |j|r|c}|_|jr7|jDcgc]}||k7s |j|r|c}|_|jrJ|jDcgc].}|j|k7r|jj|s|0c}|_yycc}wcc}wcc}w)z9Remove packages, modules, and extensions in named packagerN)packagesr py_modules ext_modulesrOr+packagepfxps r-exclude_packagezDistribution.exclude_packagesm ====ALcARDM ????a7l1<->s-C D     s' C#C#C## C(.C(C(&3C-ch|dz}|jD]}||k(s|j|syy)zBEJ  X$%C ?:c8#<%MM  D$# K$U9J K L  X%&H4&OPVW W X!Ls# A3 B &B 3 B<B  BcNt|tst|d|d t||}|t |||yt|tst|dz|Dcgc] }||vs| }}t ||||zy#t$r}td|z|d}~wwxYwcc}w)zAHandle 'include()' for list/tuple attrs without a special handlerz: setting must be a list (rrNrr)r+rOrBrrrnews r-rzDistribution._include_misc,s%*%4QV&WX X X$%C ; D$ &C*%MM %*=DT_4=C= D$c * X%&H4&OPVW W X>s# B! B"+B" B BBc |jD]2\}}t|d|zd}|r ||!|j||4y)aRemove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules, and extensions are also excluded. Currently, this method only supports exclusion from attributes that are lists or tuples. If you need to add support for excluding from other attributes in this or a subclass, you can add an '_exclude_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})' will try to call 'dist._exclude_foo({"bar":"baz"})', which can then handle whatever special exclusion logic is needed. _exclude_N)rr)r)r+rrrexcludes r-rzDistribution.exclude?sI KKM )DAqdK!OT:G ""1a(  )r/ct|tstd|dtt |j |y)Nz+packages: setting must be a list or tuple (r)rrrrrLr)r+rs r-_exclude_packageszDistribution._exclude_packagesVs6(H-%DLN  S%%x 01r/c|jj|_|jj|_|d}|jd}||vr.||\}}||=ddl}|j |d|dd|d}||vr.t j|||}|j|} t| ddrd|f|j|d<|gS|S)NraliasesTrcommand_consumes_arguments command lineargs) __class__global_optionsr~rzshlexrar _parse_command_optsrr)) r+rrrrrrrnargs cmd_classs r-rz Distribution._parse_command_opts]s"nn;; NN77q'&&y1  )JC {{5$/D!H1gG  11$E**73 9:D A5CU4KD  )& 1   r/c i}|jjD]\}}|jD]\}\}}|dk7r|jdd}|dk(ru|j|}|jj }|j t|di|jD]\} } | |k(s | }d}ntd|dk(rd}||j|i|<|S) ahReturn a '{cmd: {opt:val}}' map of all command-line options Option names are all long, but do not include the leading '--', and contain dashes rather than underscores. If the option doesn't take an argument (e.g. '--quiet'), the 'val' is 'None'. Note that options provided by config files are intentionally excluded. rrrrr~NzShouldn't be able to get herer) r}rrget_command_objr~copyupdater)rr ) r+dcmdoptsrrricmdobjrnegposs r-get_cmdline_optionsz Distribution.get_cmdline_optionsxs --335 1IC#'::< 1Zc3.(kk#s+!8!11#6F"//446GNN76>2#FG$+MMONS#:"%C"&C! N --LMMAXC-0 S"%c*+ 1 10r/c#K|jxsdD]}||jxsdD]}||jxsdD]>}t|tr|\}}n |j }|j dr|dd}|@yw)z@Yield all packages, modules, and extension names in distributionr@moduleNi)rrrrrrOr)r+pkgrextrO buildinfos r-rz$Distribution.iter_distribution_namess==&B CI oo+ FL ##)r C#u%"%ixx}}X&CRyJ sBBcFddl}|jrtj||St |j t jstj||S|j jjdvrtj||S|j j}|j jd tj|||j j|S#|j j|wxYw)zIf there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. rN)rfutf8rfrg) rn help_commandsr handle_display_optionsrstdoutrt TextIOWrapperrhr reconfigure)r+ option_orderrnrhs r-rz#Distribution.handle_display_optionss     77lK K#**b&6&67 77lK K ::   $ $ &*; ; 77lK K::&& 0 6 77lK JJ " "H " 5CJJ " "H " 5s DD cD|jt| |yr)rsuper run_command)r+rrs r-r"zDistribution.run_commands  G$r/r)NF)4ri __module__ __qualname____doc__rrrrrrr rr staticmethodrrrr6r9r7rMrXrVrr{rr|rrrrrrrrrrrrrrrrrrrrrrrr" __classcell__)rs@r-rrsV1h*6&11$% '#M *'"R +Q024E ;; 6 &    M5^ D$,5\ $'"1 $ " "0 &* B24),*M"+&).26$L$68%%r/ceZdZdZy)rzrClass for warning about deprecations in dist in setuptools. Not ignored by default, unlike DeprecationWarning.N)rir#r$r%r@r/r-rrsFr/r)drrtrnrr\r. distutils.logrdistutils.core distutils.cmddistutils.distdistutils.commanddistutils.utilrdistutils.debugrdistutils.fancy_getoptrglobrrr8 contextlibrtypingr r r r pathlibr collectionsremailrdistutils.errorsrrrsetuptools.externrr setuptools.extern.more_itertoolsrrr%setuptools.commandrsetuptools.monkeyrsetuptools.configrrsetuptools.discoveryrsetuptools.extern.packagingrrrr r! _importlibr"warningsr#r$ email.messager% __import__r.r|r;rCrErIrMrfrjrrrrrrrrrrrrrrrrrrcorerr rr@r/r-rDs   $!455##F(')G&+50/ C% 34 01QSQSQi " "#"(3-"YsxS 7J hsm(BV DN $;  : G5 RR,A Hinn99: E %=E %PF9Fr/