U ë˜ReO¨ã@s²dgZddlZddlZddlZddlZddlZddlZddlZddl Zddl Zddl Zddl Zddl mZddlmZddlmZddlmZddlZddlZddlmZmZmZddlmZdd lmZdd lm Z m!Z!dd l m"Z"dd l#m$Z$dd l%m&Z&ddl%m'Z'ddl(m)Z)ddl*m+Z+ddl,Z,ddl-Z,ddl,m.Z.ddl/m0Z0ddl1m2Z2ddl3Z3e�rpddl4m5Z5e6dƒe6dƒdd„Z7dd„Z8e9e9dœdd„Z:de9ee9d œd!d"„Z;de9ee9d œd#d$„Zd*d+„Z?d,d-„Z@d.d/„ZAeBeCfZDd0d1„ZEd2d3„ZFd4d5„ZGd6d7„ZHd8d9„ZId:d;„ZJdd?„ZLd@dA„ZMdBdC„ZNdDdE„ZOdFdG„ZPdHdI„ZQe0ejRjSƒZTGdJd„deTƒZSGdKdL„dLe+ƒZUdS)MÚ DistributionéN)Ú strtobool)ÚDEBUG©Útranslate_longopt)Úiglob)ÚListÚOptionalÚ TYPE_CHECKING)Ú defaultdict)Úmessage_from_file)ÚDistutilsOptionErrorÚDistutilsSetupError)Ú rfc822_escape)Ú StrictVersion)Ú packaging)Ú ordered_set)Úunique_everseené)ÚSetuptoolsDeprecationWarning)Úwindows_support)Ú get_unpatched)Úparse_configuration)ÚMessagez&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versioncCst dt¡t|ƒS)NzDo not call this function)ÚwarningsÚwarnÚDistDeprecationWarningr)Úcls©rú…/builddir/build/BUILDROOT/alt-python38-setuptools-58.3.0-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/setuptools/dist.pyÚ_get_unpatched2s r cCs&t|ddƒ}|dkr"tdƒ}||_|S)NÚmetadata_versionú2.1)Úgetattrrr!)ÚselfÚmvrrrÚget_metadata_version7s  r&)ÚcontentÚreturnc CsJ| ¡}t|ƒdkr |d ¡Sd |d ¡t d |dd…¡¡f¡S)zFReverse RFC-822 escaping by removing leading whitespaces from content.rrÚ N)Ú splitlinesÚlenÚlstripÚjoinÚtextwrapÚdedent)r'ÚlinesrrrÚrfc822_unescape?s  r1r)ÚmsgÚfieldr(cCs||}|dkrdS|S)zRead Message header field.ÚUNKNOWNNr©r2r3ÚvaluerrrÚ_read_field_from_msgGsr7cCst||ƒ}|dkr|St|ƒS)z4Read Message header field and apply rfc822_unescape.N)r7r1r5rrrÚ_read_field_unescaped_from_msgOs r8cCs| |d¡}|gkrdS|S)z9Read Message header field and return all results as list.N)Úget_all)r2r3ÚvaluesrrrÚ_read_list_from_msgWs r;)r2r(cCs| ¡ ¡}|dkrdS|S)Nr4)Ú get_payloadÚstrip)r2r6rrrÚ_read_payload_from_msg_s r>cCsVt|ƒ}t|dƒ|_t|dƒ|_t|dƒ|_t|dƒ|_t|dƒ|_d|_t|dƒ|_ d|_ t|dƒ|_ t |d ƒ|_ d |krŒt|d ƒ|_nd|_t |d ƒ|_|jdkrÀ|jtd ƒkrÀt|ƒ|_t|dƒ|_d |kræt|d ƒ d¡|_t|dƒ|_t|dƒ|_|jtdƒk�r4t|dƒ|_t|dƒ|_t|dƒ|_nd|_d|_d|_t|dƒ|_dS)z-Reads the metadata values from a file object.zmetadata-versionÚnameÚversionÚsummaryÚauthorNz author-emailz home-pageÚlicensez download-urlÚ descriptionr"Úkeywordsú,ÚplatformÚ classifierz1.1ÚrequiresÚprovidesÚ obsoletesz license-file)r rr!r7r?r@rDrBÚ maintainerÚ author_emailÚmaintainer_emailÚurlr8rCÚ download_urlÚlong_descriptionr>ÚsplitrEr;Ú platformsÚ classifiersrIrJrKÚ license_files)r$Úfiler2rrrÚ read_pkg_filefs<              rWcCs"d|krt d¡| dd¡}|S)Nr)z1newlines not allowed and will break in the futureú )rrÚreplace)ÚvalrrrÚ single_line“s  r[c sÈ| ¡}‡fdd„}|dt|ƒƒ|d| ¡ƒ|d| ¡ƒ|dt| ¡ƒƒ|d| ¡ƒd}|D]&\}}t||d ƒ}|d k rf|||ƒqft|  ¡ƒ}|d |ƒ|j r¶|d |j ƒ|j   ¡D]} |d d | ƒqÀd  | ¡¡} | rð|d| ƒ| ¡D]} |d| ƒqø| ˆd| ¡¡| ˆd| ¡¡| ˆd| ¡¡| ˆd| ¡¡t|dƒ�rh|d|jƒ|j�r||d|jƒ|j�rœ|jD]} |d| ƒ�qŠ| ˆd|j�p®g¡ˆ d| ¡¡d S)z0Write the PKG-INFO format data to a file object.csˆ d||f¡dS)Nz%s: %s )Úwrite)Úkeyr6©rVrrÚ write_field¡sz#write_pkg_file..write_fieldzMetadata-VersionÚNameÚVersionÚSummaryz Home-page))ÚAuthorrB)z Author-emailrM)Ú MaintainerrL)zMaintainer-emailrNNÚLicensez Download-URLz Project-URLz%s, %srFÚKeywordsÚPlatformÚ ClassifierÚRequiresÚProvidesÚ ObsoletesÚpython_requireszRequires-PythonzDescription-Content-TypezProvides-Extraz License-Filez %s )r&ÚstrÚget_nameÚ get_versionr[Úget_descriptionÚget_urlr#rÚ get_licenserPÚ project_urlsÚitemsr-Ú get_keywordsÚ get_platformsÚ _write_listÚget_classifiersÚ get_requiresÚ get_providesÚ get_obsoletesÚhasattrrlÚlong_description_content_typeÚprovides_extrasrUr\Úget_long_description) r$rVr@r_Zoptional_fieldsr3ÚattrZattr_valrCÚ project_urlrErGÚextrarr^rÚwrite_pkg_file�sH              rƒc Cs`ztj d|¡}|jrt‚Wn<ttttfk rZ}ztd||fƒ|‚W5d}~XYnXdS)Nzx=z4%r must be importable 'module:attrs' string (got %r)) Ú pkg_resourcesÚ EntryPointÚparseÚextrasÚAssertionErrorÚ TypeErrorÚ ValueErrorÚAttributeErrorr)Údistr€r6ÚepÚerrrÚcheck_importableÞs ÿþr�c Csjz(t|ttfƒst‚d |¡|ks&t‚Wn<ttttfk rd}ztd||fƒ|‚W5d}~XYnXdS)z"Verify that value is a string listÚz%%r must be a list of strings (got %r)N) Ú isinstanceÚlistÚtuplerˆr-r‰rŠr‹r©rŒr€r6rŽrrrÚassert_string_listès ÿþr•cCsd|}t|||ƒ|D]J}| |¡s2tdd|ƒ‚| d¡\}}}|r||krtj d||¡qdS)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.pyN)r•Úhas_contents_forrÚ rpartitionÚ distutilsÚlogr)rŒr€r6Z ns_packagesÚnspÚparentÚsepÚchildrrrÚ check_nspös   ÿÿ ürŸc CsPztt t| ¡¡ƒWn2tttfk rJ}ztdƒ|‚W5d}~XYnXdS)z+Verify that extras_require mapping is validz‹'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N) r’Ú itertoolsÚstarmapÚ _check_extrartr‰rŠr‹rr”rrrÚ check_extras sÿür£cCs<| d¡\}}}|r*t |¡r*td|ƒ‚tt |¡ƒdS)Nú:zInvalid environment marker: )Ú partitionr„Úinvalid_markerrr’Úparse_requirements)r‚Úreqsr?r�Úmarkerrrrr¢s r¢cCs&t|ƒ|kr"d}t|j||d�ƒ‚dS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))r€r6N)ÚboolrÚformat)rŒr€r6ÚtmplrrrÚ assert_bools r­cCs,|st |›d�t¡dSt|›d�ƒ‚dS)Nz is ignored.z is invalid.)rrrr©rŒr€r6rrrÚinvalid_unless_false$sr¯c Cslz(tt |¡ƒt|ttfƒr&tdƒ‚Wn>ttfk rf}zd}t|j ||d�ƒ|‚W5d}~XYnXdS)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}©r€ÚerrorN) r’r„r§r‘ÚdictÚsetr‰rŠrr«©rŒr€r6r±r¬rrrÚcheck_requirements+s ÿrµc CsXztj |¡WnBtjjtfk rR}zd}t|j||d�ƒ|‚W5d}~XYnXdS)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}r°N)rÚ specifiersÚ SpecifierSetÚInvalidSpecifierr‹rr«r´rrrÚcheck_specifier9s ÿr¹c CsBztj |¡Wn,tk r<}zt|ƒ|‚W5d}~XYnXdS)z)Verify that entry_points map is parseableN)r„r…Ú parse_maprŠrr”rrrÚcheck_entry_pointsDsr»cCst|tƒstdƒ‚dS)Nztest_suite must be a string)r‘rmrr®rrrÚcheck_test_suiteLs r¼cCsZt|tƒstd |¡ƒ‚| ¡D]4\}}t|tƒsBtd ||¡ƒ‚t|d |¡|ƒq dS)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)r‘r²rr«rtrmr•)rŒr€r6ÚkÚvrrrÚcheck_package_dataQs ÿÿ  ÿr¿cCs(|D]}t d|¡stj d|¡qdS)Nz \w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)ÚreÚmatchr™ršr)rŒr€r6ÚpkgnamerrrÚcheck_packages`s  ýrÃc@s~eZdZdZdd„eejdd„dd„dœZdZdd „Z dUd d „Z d d „Z e dd„ƒZ e dd„ƒZdd„Zdd„Ze dd„ƒZdd„Zdd„Zdd„Ze dd„ƒZdVd d!„Zd"d#„Zd$d%„Zd&d'„ZdWd(d)„ZdXd+d,„Zd-d.„Zd/d0„Ze d1d2„ƒZd3d4„Zd5d6„Z d7d8„Z!d9d:„Z"d;d<„Z#d=d>„Z$d?d@„Z%dAdB„Z&dCdD„Z'dEdF„Z(dGdH„Z)dIdJ„Z*dKdL„Z+dMdN„Z,dOdP„Z-dQdR„Z.dSdT„Z/dS)YraG 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. cCsdS©NrrrrrÚ¢ózDistribution.cCsdSrÄrrrrrrÅ¥rÆcCsdSrÄrrrrrrŦrÆ)r}rsr~Ú license_filerUNcCsl|rd|ksd|krdSt t|dƒ¡ ¡}tjj |¡}|dk rh| d¡sht t|dƒ¡|_ ||_ dS)Nr?r@zPKG-INFO) r„Ú safe_namermÚlowerÚ working_setÚby_keyÚgetÚ has_metadataÚ safe_versionÚ_versionÚ _patched_dist)r$Úattrsr]rŒrrrÚpatch_missing_pkg_info«sz#Distribution.patch_missing_pkg_infocsÄtˆdƒ}|siˆ_|pi}gˆ_| dd¡ˆ_ˆ |¡| dg¡ˆ_| dg¡ˆ_t  d¡D]}t ˆƒ  |j d¡q`t  ˆ‡fdd„| ¡Dƒ¡ˆ |¡ˆ ˆ ˆjj¡¡ˆj_ˆ ¡dS)NÚ package_dataÚsrc_rootÚdependency_linksÚsetup_requiresúdistutils.setup_keywordscs i|]\}}|ˆjkr||“qSr)Ú_DISTUTILS_UNSUPPORTED_METADATA©Ú.0r½r¾©r$rrÚ Çs þz)Distribution.__init__..)r|rÓÚ dist_filesÚpoprÔrÒrÕrÖr„Úiter_entry_pointsÚvarsÚ setdefaultr?Ú _DistributionÚ__init__rtÚ_set_metadata_defaultsÚ_normalize_versionÚ_validate_versionÚmetadatar@Ú_finalize_requires)r$rÑZhave_package_datar�rrÛrrã¸s,   þþ  ÿzDistribution.__init__cCs4|j ¡D]$\}}t|jƒ || ||ƒ¡¡q dS)zä Fill-in missing metadata fields not supported by distutils. Some fields may have been set by other tools (e.g. pbr). Those fields (vars(self.metadata)) take precedence to supplied attrs. N)rØrtràrçrárÌ)r$rÑÚoptionÚdefaultrrrräÕsz#Distribution._set_metadata_defaultscCsPt|tjƒs|dkr|Sttj |¡ƒ}||krLd}t |j ft ƒŽ¡|S|S)Nz)Normalizing '{version}' to '{normalized}') r‘Ú setuptoolsÚsicrmrr@rarrr«Úlocals)r@Ú normalizedr¬rrrråßszDistribution._normalize_versionc Csft|tjƒrt|ƒ}|dk rbztj |¡Wn4tjjtfk r`t   d|¡t   |¡YSX|S)Nz¦The version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.) r‘ÚnumbersÚNumberrmrr@raÚInvalidVersionr‰rrrërì)r@rrrræës ýÿzDistribution._validate_versioncCsft|ddƒr|j|j_t|ddƒrR|j ¡D]$}| d¡d}|r,|jj |¡q,| ¡|  ¡dS)z€ Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. rlNÚextras_requirer¤r) r#rlrçròÚkeysrRr~ÚaddÚ_convert_extras_requirementsÚ"_move_install_requirements_markers)r$r‚rrrrèþs   zDistribution._finalize_requirescCsht|ddƒpi}ttƒ|_| ¡D]@\}}|j|t |¡D]"}| |¡}|j|| |¡q>q"dS)z¡ Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. ròN) r#r r’Ú_tmp_extras_requirertr„r§Ú _suffix_forÚappend)r$Z spec_ext_reqsÚsectionr¾ÚrÚsuffixrrrrõs   z)Distribution._convert_extras_requirementscCs|jrdt|jƒSdS)ze For a requirement, return the 'extras_require' suffix for that requirement. r¤r�)r©rm©Úreqrrrrø!szDistribution._suffix_forcs’dd„}tˆddƒpd}tt |¡ƒ}t||ƒ}t ||¡}ttt|ƒƒˆ_ |D]}ˆj dt|j ƒ  |¡qPt ‡fdd„ˆj  ¡Dƒƒˆ_dS) zv Move requirements in `install_requires` that are using environment markers `extras_require`. cSs|j SrÄ©r©rýrrrÚ is_simple_req3szFDistribution._move_install_requirements_markers..is_simple_reqÚinstall_requiresNrr¤c3s,|]$\}}|dd„tˆj|ƒDƒfVqdS)cSsg|] }t|ƒ‘qSr)rm)rÚrûrrrÚ ?szMDistribution._move_install_requirements_markers...N)ÚmapÚ _clean_reqrÙrÛrrÚ >sÿzBDistribution._move_install_requirements_markers..)r#r’r„r§Úfilterr Ú filterfalserrmrr÷r©rùr²rtrò)r$rZspec_inst_reqsZ inst_reqsZ simple_reqsZ complex_reqsrûrrÛrrö)s    þz/Distribution._move_install_requirements_markerscCs d|_|S)zP Given a Requirement, remove environment markers and return it. Nrÿ)r$rþrrrrCszDistribution._clean_reqcCs`|jj}|r|ng}|jj}|r2||kr2| |¡|dkrF|dkrFd}tt| |¡ƒƒ|j_dS)z>> list(Distribution._expand_patterns(['LICENSE'])) ['LICENSE'] >>> list(Distribution._expand_patterns(['setup.cfg', 'LIC*'])) ['setup.cfg', 'LICENSE'] css:|]2}tt|ƒƒD] }| d¡stj |¡r|VqqdS)ú~N)ÚsortedrÚendswithÚosÚpathÚisfile)rÚÚpatternrrrrres  ýz0Distribution._expand_patterns..r)r rrrr]sþzDistribution._expand_patternsc CsÐddlm}tjtjkrgnddddddd d d d d ddg }t|ƒ}|dkrR| ¡}tr`| d¡|ƒ}t |_ |D]¶}t j |dd��(}trœ| dj ftƒŽ¡| |¡W5QRX| ¡D]d}| |¡}| |¡} |D]F} | dksÔ| |krêqÔ| || ¡} | | |¡} | | |¡} || f| | <qÔq¸| ¡qpd|jk�r8dS|jd ¡D]„\} \} } |j | ¡} | �rpt| ƒ } n| dk�r‚t| ƒ} zt|| �p�| | ƒWn.tk �rÆ}zt|ƒ|‚W5d}~XYnX�qFdS)z£ Adapted from distutils.dist.Distribution.parse_config_files, this method provides the same functionality in subtly-improved ways. r)Ú ConfigParserz install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-dataÚprefixz exec-prefixÚhomeÚuserÚrootNz"Distribution.parse_config_files():úutf-8)Úencodingz reading {filename}Ú__name__Úglobal)ÚverboseÚdry_run)Ú configparserrÚsysrÚ base_prefixÚ frozensetÚfind_config_filesrÚannouncermÚ optionxformÚioÚopenr«ríÚ read_fileÚsectionsÚoptionsÚget_option_dictrÌÚwarn_dash_deprecationÚmake_option_lowercaserãÚcommand_optionsrtÚ negative_optrÚsetattrrŠr )r$Ú filenamesrÚignore_optionsÚparserÚfilenameÚreaderrúr(Úopt_dictÚoptrZÚsrcÚaliasrŽrrrÚ_parse_config_filesmsj  ÿóý            z Distribution._parse_config_filescCsd|dkr |S| dd¡}tjj| ¡}| d¡sF|dkrF||krF|Sd|kr`t d||f¡|S)N)zoptions.extras_requirezoptions.data_filesú-Ú_r(rçzrUsage of dash-separated '%s' will not be supported in future versions. Please use the underscore name '%s' instead)rYr™ÚcommandÚ__all__Ú_setuptools_commandsÚ startswithrr)r$r5rúZunderscore_optÚcommandsrrrr*¼s$ ÿþýþÿz"Distribution.warn_dash_deprecationcCs:zt d¡}t| d¡ƒWStjk r4gYSXdS)Nrëúdistutils.commands)r„Úget_distributionr’Ú get_entry_mapÚDistributionNotFound)r$rŒrrrr=Ôs  z!Distribution._setuptools_commandscCs4|dks| ¡r|S| ¡}t d|||f¡|S)NrçzlUsage of uppercase key '%s' in '%s' will be deprecated in future versions. Please use lowercase '%s' instead)ÚislowerrÉrr)r$r5rúZ lowercase_optrrrr+Üsþÿz"Distribution.make_option_lowercasec Cs^| ¡}|dkr| |¡}tr,| d|¡| ¡D�]"\}\}}trZ| d|||f¡zdd„|jDƒ}Wntk r†g}YnXz |j}Wntk rªi}YnXz|t|t ƒ} ||krÜ| rÜt |||t |ƒ ƒnJ||krú| rút ||t |ƒƒn,t ||ƒ�rt |||ƒnt d|||fƒ‚Wq4tk �rV} zt | ƒ| ‚W5d} ~ XYq4Xq4dS)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 %s = %s (from %s)cSsg|] }t|ƒ‘qSrr)rÚÚorrrrÿsz5Distribution._set_command_options..z1error in %s: command '%s' has no such option '%s')Úget_command_namer)rr"rtÚboolean_optionsr‹r-r‘rmr.rr|r rŠ) r$Ú command_objÚ option_dictÚ command_nameréÚsourcer6Ú bool_optsÚneg_optÚ is_stringrŽrrrÚ_set_command_optionsés>         ÿÿz!Distribution._set_command_optionsFcCs0|j|d�t||j|d�| ¡| ¡dS)zYParses configuration files from various levels and loads configuration. )r/)Úignore_option_errorsN)r8rr,rèr )r$r/rPrrrÚparse_config_filess ÿzDistribution.parse_config_filescCs8tjjt |¡|jdd�}|D]}tjj|dd�q|S)zResolve pre-setup requirementsT)Ú installerÚreplace_conflicting)rY)r„rÊÚresolver§Úfetch_build_eggrô)r$rIZresolved_distsrŒrrrÚfetch_build_eggs$sýzDistribution.fetch_build_eggscCsPd}dd„}t |¡}t |j|¡}tdd„|ƒ}t||d�D] }||ƒq>dS)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_optionscSs t|ddƒS)NÚorderr)r#)ÚhookrrrÚby_order8sz/Distribution.finalize_options..by_ordercSs| ¡SrÄ)Úload)rŽrrrrÅ=rÆz/Distribution.finalize_options..)r]N)r„rßr rÚ_removedrr )r$ÚgrouprYZdefinedÚfilteredZloadedr�rrrÚfinalize_options/s zDistribution.finalize_optionscCsdh}|j|kS)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. Z 2to3_doctests)r?)r�Úremovedrrrr[As þzDistribution._removedcCsJt d¡D]:}t||jdƒ}|dk r |j|jd�| ¡||j|ƒq dS)NrשrR)r„rßr#r?ÚrequirerUrZ)r$r�r6rrrÚ_finalize_setup_keywordsOs z%Distribution._finalize_setup_keywordsc Csvtj tjd¡}tj |¡srt |¡t |¡tj |d¡}t|dƒ�$}|  d¡|  d¡|  d¡W5QRX|S)Nz.eggsz README.txtÚwzcThis 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. ) rrr-ÚcurdirÚexistsÚmkdirrZ hide_filer%r\)r$Z egg_cache_dirZreadme_txt_filenameÚfrrrÚget_egg_cache_dirVs    ÿÿzDistribution.get_egg_cache_dircCsddlm}|||ƒS)z Fetch an egg needed for buildingr)rU)Zsetuptools.installerrU)r$rþrUrrrrUis zDistribution.fetch_build_eggcCs\||jkr|j|St d|¡}|D]*}|j|jd�| ¡|j|<}|St ||¡S)z(Pluggable version of get_command_class()r@r`N)Úcmdclassr„rßrarUrZrâÚget_command_class)r$r;Zepsr�rirrrrjos   zDistribution.get_command_classcCs:t d¡D]$}|j|jkr | ¡}||j|j<q t |¡S©Nr@)r„rßr?rirTrâÚprint_commands©r$r�rirrrrl|s  zDistribution.print_commandscCs:t d¡D]$}|j|jkr | ¡}||j|j<q t |¡Srk)r„rßr?rirTrâÚget_command_listrmrrrrn„s  zDistribution.get_command_listcKs@| ¡D]2\}}t|d|dƒ}|r.||ƒq| ||¡qdS)aôAdd 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. Z _include_N)rtr#Ú _include_misc)r$rÑr½r¾ÚincluderrrrpŒs  zDistribution.includecsfˆd‰|jr&‡‡fdd„|jDƒ|_|jrD‡‡fdd„|jDƒ|_|jrb‡‡fdd„|jDƒ|_dS)z9Remove packages, modules, and extensions in named packager–cs"g|]}|ˆkr| ˆ¡s|‘qSr©r>©rÚÚp©ÚpackageÚpfxrrr§s z0Distribution.exclude_package..cs"g|]}|ˆkr| ˆ¡s|‘qSrrqrrrtrrr¬s cs&g|]}|jˆkr|j ˆ¡s|‘qSr)r?r>rrrtrrr±s þN)ÚpackagesÚ py_modulesÚ ext_modules)r$rurrtrÚexclude_package¢s ÿ ÿ þzDistribution.exclude_packagecCs2|d}| ¡D]}||ks&| |¡rdSqdS)z)r$rurvrsrrrr—·s zDistribution.has_contents_forc sœtˆtƒstd|ˆfƒ‚zt||ƒ}Wn0tk rX}ztd|ƒ|‚W5d}~XYnX|dk rzt|tƒszt|dƒ‚n|r˜t||‡fdd„|DƒƒdS)zAHandle 'exclude()' for list/tuple attrs without a special handlerz(%s: setting must be a list or tuple (%r)ú %s: No such distribution settingNú4: this setting cannot be changed via include/excludecsg|]}|ˆkr|‘qSrr©rÚÚitem©r6rrrÏsz.Distribution._exclude_misc..©r‘Úsequencerr#r‹r.)r$r?r6ÚoldrŽrr€rÚ _exclude_miscÀs  ÿ ÿzDistribution._exclude_miscc s®t|tƒstd||fƒ‚zt||ƒ‰Wn0tk rX}ztd|ƒ|‚W5d}~XYnXˆdkrpt|||ƒn:tˆtƒsˆt|dƒ‚n"‡fdd„|Dƒ}t||ˆ|ƒdS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)r|Nr}csg|]}|ˆkr|‘qSrrr~©rƒrrrász.Distribution._include_misc..r�)r$r?r6rŽÚnewrr…rroÑs   ÿzDistribution._include_misccKs@| ¡D]2\}}t|d|dƒ}|r.||ƒq| ||¡qdS)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. Z _exclude_N)rtr#r„)r$rÑr½r¾Úexcluderrrr‡äs  zDistribution.excludecCs,t|tƒstd|fƒ‚tt|j|ƒƒdS)Nz.packages: setting must be a list or tuple (%r))r‘r‚rr’rrz)r$rwrrrÚ_exclude_packagesûs  ÿzDistribution._exclude_packagesc Cs¬|jj|_|jj|_|d}| d¡}||krf||\}}||=ddl}| |d¡|dd…<|d}q&t |||¡}| |¡} t | ddƒr¨d|f| |¡d<|dk r¨gS|S)NrÚaliasesTrZcommand_consumes_argumentsú command lineÚargs) Ú __class__Úglobal_optionsr-r)ÚshlexrRrâÚ_parse_command_optsrjr#) r$r1r‹r;r‰r6r7rŽÚnargsÚ cmd_classrrrr�s"       z Distribution._parse_command_optsc CsÂi}|j ¡D]®\}}| ¡D]œ\}\}}|dkr4q| dd¡}|dkrž| |¡}|j ¡}| t|diƒ¡| ¡D]\} } | |krv| }d}qªqvtdƒ‚n |dkrªd}||  |i¡|<qq|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. rŠr:r9rr-NzShouldn't be able to get herer) r,rtrYÚget_command_objr-ÚcopyÚupdater#rˆrá) r$ÚdÚcmdÚoptsr5r6rZZcmdobjrMÚnegÚposrrrÚget_cmdline_optionss(     z Distribution.get_cmdline_optionsccsv|jpdD] }|Vq |jpdD] }|Vq |jp4dD]:}t|tƒrN|\}}n|j}| d¡rj|dd…}|Vq6dS)z@Yield all packages, modules, and extension names in distributionrÚmoduleNiúÿÿÿ)rwrxryr‘r“r?r )r$Úpkgr›Úextr?Z buildinforrrr{Es    z$Distribution.iter_distribution_namesc CsÆddl}|jrt ||¡St|jtjƒs4t ||¡S|jj  ¡dkrPt ||¡S|jj}|jj }|j dkrndppd}|jj }t |j  ¡d|||¡|_zt ||¡W¢St |j  ¡||||¡|_XdS)zÚIf 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)rÚutf8Úwin32r)r)rÚ help_commandsrâÚhandle_display_optionsr‘Ústdoutr$Ú TextIOWrapperrrÉÚerrorsrGÚline_bufferingÚdetach)r$Ú option_orderrrr¤Únewliner¥rrrr¡Ws6   ÿÿz#Distribution.handle_display_options)N)N)N)NF)0rÚ __module__Ú __qualname__Ú__doc__r²rZ OrderedSetrØrÐrÒrãräÚ staticmethodrårærèrõrørörr rr8r*r=r+rOrQrVr^r[rbrhrUrjrlrnrprzr—r„ror‡rˆr�ršr{r¡rrrrrmsf4û       O .     (c@seZdZdZdS)rzrClass for warning about deprecations in dist in setuptools. Not ignored by default, unlike DeprecationWarning.N)rr©rªr«rrrrr|sr)Vr<r$rrÀrrrïZ distutils.logr™Údistutils.coreÚ distutils.cmdÚdistutils.distÚdistutils.commandÚdistutils.utilrÚdistutils.debugrÚdistutils.fancy_getoptrÚglobrr r.Útypingrr r Ú collectionsr Úemailr Údistutils.errorsr rrZdistutils.versionrZsetuptools.externrrZ setuptools.extern.more_itertoolsrr�rrëZsetuptools.commandrZsetuptools.monkeyrZsetuptools.configrr„Ú email.messagerÚ __import__r r&rmr1r7r8r;r>rWr[rƒr“r’r‚r�r•rŸr£r¢r­r¯rµr¹r»r¼r¿rÃÚcorerrârrrrrÚsŒ                - >