B ReO@sdgZddlZddlZddlZddlZddlZddlZddlZddl 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/m0Z0ddl1m2Z2ddl3Z3erpddl4m5Z5e6de6dddZ7ddZ8e9e9dddZ:de9ee9d d!d"Z;de9ee9d d#d$Zd*d+Z?d,d-Z@d.d/ZAeBeCfZDd0d1ZEd2d3ZFd4d5ZGd6d7ZHd8d9ZId:d;ZJdd?ZLd@dAZMdBdCZNdDdEZOdFdGZPdHdIZQe0ejRjSZTGdJddeTZSGdKdLdLe+ZUdS)M DistributionN) strtobool)DEBUG)translate_longopt)iglob)ListOptional TYPE_CHECKING) defaultdict)message_from_file)DistutilsOptionErrorDistutilsSetupError) rfc822_escape) StrictVersion) packaging) ordered_set)unique_everseen)SetuptoolsDeprecationWarning)windows_support) get_unpatched)parse_configuration)Messagez&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versioncCstdtt|S)NzDo not call this function)warningswarnDistDeprecationWarningr)clsr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/dist.py_get_unpatched2s rcCs&t|dd}|dkr"td}||_|S)Nmetadata_versionz2.1)getattrrr )selfmvrrrget_metadata_version7s  r$)contentreturnc CsJ|}t|dkr |dSd|dtd|ddfS)zFReverse RFC-822 escaping by removing leading whitespaces from content.rr N) splitlineslenlstripjointextwrapdedent)r%linesrrrrfc822_unescape?s  r/r)msgfieldr&cCs||}|dkrdS|S)zRead Message header field.UNKNOWNNr)r0r1valuerrr_read_field_from_msgGsr4cCst||}|dkr|St|S)z4Read Message header field and apply rfc822_unescape.N)r4r/)r0r1r3rrr_read_field_unescaped_from_msgOs r5cCs||d}|gkrdS|S)z9Read Message header field and return all results as list.N)get_all)r0r1valuesrrr_read_list_from_msgWs r8)r0r&cCs|}|dkrdS|S)Nr2) get_payloadstrip)r0r3rrr_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 |krt|d |_nd|_t |d |_|jdkr|jtd krt||_t|d|_d |krt|d d|_t|d|_t|d|_|jtdkr4t|d|_t|d|_t|d|_nd|_d|_d|_t|d|_dS)z-Reads the metadata values from a file object.zmetadata-versionnameversionsummaryauthorNz author-emailz home-pagelicensez download-url descriptionz2.1keywords,platform classifierz1.1requiresprovides obsoletesz license-file)r rr r4r<r=rAr? maintainer author_emailmaintainer_emailurlr5r@ download_urllong_descriptionr;splitrBr8 platforms classifiersrFrGrH license_files)r"filer0rrr read_pkg_filefs<              rTcCs"d|krtd|dd}|S)Nr'z1newlines not allowed and will break in the future )rrreplace)valrrr single_lines  rXc s|}fdd}|dt||d||d||dt||d|d}x.|D]&\}}t||d }|d k rh|||qhWt| }|d ||j r|d |j x |j D]} |d d | qWd |} | r|d| x|D]} |d| qW|d||d||d||d|t|drv|d|j|jr|d|j|jrx|jD]} |d| qW|d|jpgd|d S)z0Write the PKG-INFO format data to a file object.csd||fdS)Nz%s: %s )write)keyr3)rSrr write_fieldsz#write_pkg_file..write_fieldzMetadata-VersionNameVersionZSummaryz Home-page))ZAuthorr?)z Author-emailrJ)Z MaintainerrI)zMaintainer-emailrKNZLicensez Download-URLz Project-URLz%s, %srCZKeywordsPlatform ClassifierRequiresProvides Obsoletespython_requireszRequires-PythonzDescription-Content-TypezProvides-Extraz License-Filez %s )r$strget_name get_versionrXget_descriptionget_urlr!r get_licenserM project_urlsitemsr+ get_keywords get_platforms _write_listget_classifiers get_requires get_provides get_obsoleteshasattrrclong_description_content_typeprovides_extrasrRrYget_long_description) r"rSr=r[Zoptional_fieldsr1attrZattr_valr@ project_urlrBrDextrar)rSrwrite_pkg_filesH          rzc Cs`ytjd|}|jrtWn<ttttfk rZ}ztd||f|Wdd}~XYnXdS)Nzx=z4%r must be importable 'module:attrs' string (got %r)) pkg_resources EntryPointparseextrasAssertionError TypeError ValueErrorAttributeErrorr )distrwr3eperrrcheck_importables rc Csjy(t|ttfstd||ks&tWn<ttttfk rd}ztd||f|Wdd}~XYnXdS)z"Verify that value is a string listz%%r must be a list of strings (got %r)N) isinstancelisttuplerr+rrrr )rrwr3rrrrassert_string_lists rcCsh|}t|||xR|D]J}||s4tdd||d\}}}|r||krtjd||qWdS)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)rhas_contents_forr rpartition distutilslogr)rrwr3Z ns_packagesnspparentsepchildrrr check_nsps     rc CsPyttt|Wn2tttfk rJ}ztd|Wdd}~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 itertoolsstarmap _check_extrarkrrrr )rrwr3rrrr check_extras s rcCs<|d\}}}|r*t|r*td|tt|dS)N:zInvalid environment marker: ) partitionr{invalid_markerr rparse_requirements)ryreqsr<rmarkerrrrrs rcCs&t||kr"d}t|j||ddS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))rwr3N)boolr format)rrwr3tmplrrr assert_bools rcCs,|st|dtdSt|ddS)Nz is ignored.z is invalid.)rrrr )rrwr3rrrinvalid_unless_false$src Csly(tt|t|ttfr&tdWn>ttfk rf}zd}t|j ||d|Wdd}~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})rwerrorN) rr{rrdictsetrrr r)rrwr3rrrrrcheck_requirements+s rc CsXytj|WnBtjjtfk rR}zd}t|j||d|Wdd}~XYnXdS)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error})rwrN)r specifiers SpecifierSetInvalidSpecifierrr r)rrwr3rrrrrcheck_specifier9s rc CsBytj|Wn,tk r<}zt||Wdd}~XYnXdS)z)Verify that entry_points map is parseableN)r{r| parse_maprr )rrwr3rrrrcheck_entry_pointsDsrcCst|tstddS)Nztest_suite must be a string)rrdr )rrwr3rrrcheck_test_suiteLs rcCs^t|tstd|x@|D]4\}}t|tsDtd||t|d||q"WdS)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)rrr rrkrdr)rrwr3kvrrrcheck_package_dataQs  rcCs,x&|D]}td|stjd|qWdS)Nz \w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrrr)rrwr3pkgnamerrrcheck_packages`s   rc@s~eZdZdZddeejdddddZdZdd Z dUd d Z d d Z e ddZ e ddZddZddZe ddZddZddZddZe ddZdVd d!Zd"d#Zd$d%Zd&d'ZdWd(d)ZdXd+d,Zd-d.Zd/d0Ze d1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"d;d<Z#d=d>Z$d?d@Z%dAdBZ&dCdDZ'dEdFZ(dGdHZ)dIdJZ*dKdLZ+dMdNZ,dOdPZ-dQdRZ.dSdTZ/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)NrrrrrzDistribution.cCsdS)NrrrrrrrcCsdS)Nrrrrrrr)rtrjru license_filerRNcCsl|rd|ksd|krdStt|d}tjj|}|dk rh|dshtt|d|_ ||_ dS)Nr<r=zPKG-INFO) r{ safe_namerdlower working_setby_keyget has_metadata safe_version_version _patched_dist)r"attrsrZrrrrpatch_missing_pkg_infosz#Distribution.patch_missing_pkg_infocstd}|si_|pi}g_|dd_||dg_|dg_x$t dD]}t  |j dqbWt fdd|D|jjj_dS)N package_datasrc_rootdependency_linkssetup_requireszdistutils.setup_keywordscs i|]\}}|jkr||qSr)_DISTUTILS_UNSUPPORTED_METADATA).0rr)r"rr sz)Distribution.__init__..)rsr dist_filespoprrrrr{iter_entry_pointsvars setdefaultr< _Distribution__init__rk_set_metadata_defaults_normalize_version_validate_versionmetadatar=_finalize_requires)r"rZhave_package_datarr)r"rrs&    zDistribution.__init__cCs8x2|jD]$\}}t|j||||q WdS)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)rrkrrrr)r"roptiondefaultrrrrsz#Distribution._set_metadata_defaultscCsPt|tjs|dkr|Sttj|}||krLd}t|j ft |S|S)Nz)Normalizing '{version}' to '{normalized}') r setuptoolssicrdrr=r]rrrlocals)r= normalizedrrrrrszDistribution._normalize_versionc Csbt|tjrt|}|dk r^ytj|Wn0tjjtfk r\t d|t |SX|S)NzThe 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.) rnumbersNumberrdrr=r]InvalidVersionrrrrr)r=rrrrs  zDistribution._validate_versioncCsjt|ddr|j|j_t|ddrVx2|jD]$}|dd}|r.|jj|q.W|| dS)z Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. rcNextras_requirerr) r!rcrrkeysrOruadd_convert_extras_requirements"_move_install_requirements_markers)r"ryrrrrs   zDistribution._finalize_requirescCspt|ddpi}tt|_xP|D]D\}}|j|x0t|D]"}||}|j|||qBWq$WdS)z Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. rN) r!r r_tmp_extras_requirerkr{r _suffix_forappend)r"Z spec_ext_reqssectionrrsuffixrrrrs   z)Distribution._convert_extras_requirementscCs|jrdt|jSdS)ze For a requirement, return the 'extras_require' suffix for that requirement. rr)rrd)reqrrrr!szDistribution._suffix_forcsdd}tddpd}tt|}t||}t||}ttt|_ x&|D]}j dt|j  |qRWt fddj D_dS) zv Move requirements in `install_requires` that are using environment markers `extras_require`. cSs|j S)N)r)rrrr is_simple_req3szFDistribution._move_install_requirements_markers..is_simple_reqinstall_requiresNrrc3s,|]$\}}|ddtj|DfVqdS)cSsg|] }t|qSr)rd)rrrrr ?szMDistribution._move_install_requirements_markers...N)map _clean_req)rrr)r"rr ?szBDistribution._move_install_requirements_markers..)r!rr{rfilterr filterfalserrdrrrrrrkr)r"rZspec_inst_reqsZ inst_reqsZ simple_reqsZ complex_reqsrr)r"rr)s     z/Distribution._move_install_requirements_markerscCs d|_|S)zP Given a Requirement, remove environment markers and return it. N)r)r"rrrrrCszDistribution._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] }|dstj|r|VqqdS)~N)sortedrendswithospathisfile)rpatternrrrrrfsz0Distribution._expand_patterns..r)rrrrr]s zDistribution._expand_patternsc Csddlm}tjtjkrgnddddddd d d d d ddg }t|}|dkrR|}tr`|d|}t |_ x|D]}t j |dd(}tr|dj ft||WdQRXxt|D]h}||}||} xN|D]F} | dks| |krq||| } || |} || |} || f| | <qWqW|qrWd|jkrDdSx|jdD]\} \} } |j| } | r~t|  } n| dkrt| } yt|| p| | Wn.tk r}zt||Wdd}~XYnXqTWdS)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-dataprefixz exec-prefixhomeuserrootNz"Distribution.parse_config_files():zutf-8)encodingz reading {filename}__name__global)verbosedry_run) configparserrsysr base_prefix frozensetfind_config_filesrannouncerd optionxformioopenrr read_filesectionsoptionsget_option_dictrwarn_dash_deprecationmake_option_lowercasercommand_optionsrk negative_optrsetattrrr )r" filenamesrignore_optionsparserfilenamereaderrropt_dictoptrWsrcaliasrrrr_parse_config_filesmsd              z Distribution._parse_config_filescCsd|dkr |S|dd}tjj|}|dsF|dkrF||krF|Sd|kr`td||f|S)N)zoptions.extras_requirezoptions.data_files-_rrzrUsage of dash-separated '%s' will not be supported in future versions. Please use the underscore name '%s' instead)rVrcommand__all___setuptools_commands startswithrr)r"r!rZunderscore_optcommandsrrrrs   z"Distribution.warn_dash_deprecationcCs4ytd}t|dStjk r.gSXdS)Nrzdistutils.commands)r{get_distributionr get_entry_mapDistributionNotFound)r"rrrrr)s  z!Distribution._setuptools_commandscCs4|dks|r|S|}td|||f|S)NrzlUsage of uppercase key '%s' in '%s' will be deprecated in future versions. Please use lowercase '%s' instead)islowerrrr)r"r!rZ lowercase_optrrrrsz"Distribution.make_option_lowercasec Csd|}|dkr||}tr,|d|x0|D]"\}\}}tr^|d|||fydd|jD}Wntk rg}YnXy |j}Wntk ri}YnXy|t|t } ||kr| rt |||t | nJ||kr| rt ||t |n,t ||rt |||nt d|||fWq8tk rZ} zt | | Wdd} ~ XYq8Xq8WdS)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|qSr)r)rorrrrsz5Distribution._set_command_options..z1error in %s: command '%s' has no such option '%s')get_command_namerrrrkboolean_optionsrrrrdrrrsr r) r" command_obj option_dict command_namersourcer3 bool_optsneg_opt is_stringrrrr_set_command_optionss:         z!Distribution._set_command_optionsFcCs0|j|dt||j|d||dS)zYParses configuration files from various levels and loads configuration. )r)ignore_option_errorsN)r$rrrr)r"rr;rrrparse_config_filess  zDistribution.parse_config_filescCs<tjjt||jdd}x|D]}tjj|ddq W|S)zResolve pre-setup requirementsT) installerreplace_conflicting)rV)r{rresolverfetch_build_eggr)r"rFZresolved_distsrrrrfetch_build_eggs$s zDistribution.fetch_build_eggscCsTd}dd}t|}t|j|}tdd|}xt||dD] }||q@WdS)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|ddS)Norderr)r!)hookrrrby_order8sz/Distribution.finalize_options..by_ordercSs|S)N)load)rrrrr=rz/Distribution.finalize_options..)rZN)r{rrr_removedrr)r"grouprDZdefinedfilteredZloadedrrrrfinalize_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<)rremovedrrrrFAs zDistribution._removedcCsNxHtdD]:}t||jd}|dk r |j|jd|||j|q WdS)Nzdistutils.setup_keywords)r=)r{rr!r<requirer@rE)r"rr3rrr_finalize_setup_keywordsOs z%Distribution._finalize_setup_keywordsc Csvtjtjd}tj|srt|t|tj|d}t|d$}| d| d| dWdQRX|S)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. ) rrr+curdirexistsmkdirrZ hide_filerrY)r"Z egg_cache_dirZreadme_txt_filenamefrrrget_egg_cache_dirVs    zDistribution.get_egg_cache_dircCsddlm}|||S)z Fetch an egg needed for buildingr)r@)Zsetuptools.installerr@)r"rr@rrrr@is zDistribution.fetch_build_eggcCs`||jkr|j|Std|}x:|D]&}|j|jd||j|<}|SWt||SdS)z(Pluggable version of get_command_class()zdistutils.commands)r=N)cmdclassr{rrKr@rErget_command_class)r"r'ZepsrrSrrrrTos    zDistribution.get_command_classcCs>x2tdD]$}|j|jkr |}||j|j<q Wt|S)Nzdistutils.commands)r{rr<rSr?rprint_commands)r"rrSrrrrU|s  zDistribution.print_commandscCs>x2tdD]$}|j|jkr |}||j|j<q Wt|S)Nzdistutils.commands)r{rr<rSr?rget_command_list)r"rrSrrrrVs  zDistribution.get_command_listcKsDx>|D]2\}}t|d|d}|r0||q |||q WdS)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. Z _include_N)rkr! _include_misc)r"rrrincluderrrrXs  zDistribution.includecsfd|jr&fdd|jD|_|jrDfdd|jD|_|jrbfdd|jD|_dS)z9Remove packages, modules, and extensions in named packagercs"g|]}|kr|s|qSr)r*)rp)packagepfxrrrsz0Distribution.exclude_package..cs"g|]}|kr|s|qSr)r*)rrY)rZr[rrrscs&g|]}|jkr|js|qSr)r<r*)rrY)rZr[rrrsN)packages py_modules ext_modules)r"rZr)rZr[rexclude_packages zDistribution.exclude_packagecCs4|d}x&|D]}||ks(||rdSqWdS)z.)rsequencer r!rr)r"r<r3oldrr)r3r _exclude_miscs   zDistribution._exclude_miscc st|tstd||fyt||Wn0tk rX}ztd||Wdd}~XYnXdkrpt|||n:ttst|dn"fdd|D}t|||dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)z %s: No such distribution settingNz4: this setting cannot be changed via include/excludecsg|]}|kr|qSrr)rra)rcrrrsz.Distribution._include_misc..)rrbr r!rr)r"r<r3rnewr)rcrrWs    zDistribution._include_misccKsDx>|D]2\}}t|d|d}|r0||q |||q WdS)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)rkr!rd)r"rrrexcluderrrrfs  zDistribution.excludecCs,t|tstd|ftt|j|dS)Nz.packages: setting must be a list or tuple (%r))rrbr rrr_)r"r\rrr_exclude_packagess  zDistribution._exclude_packagesc Cs|jj|_|jj|_|d}|d}xB||krh||\}}||=ddl}||d|dd<|d}q(Wt|||}||} t | ddrd|f||d<|dk rgS|S)NraliasesTrZcommand_consumes_argumentsz command lineargs) __class__global_optionsrrshlexrOr_parse_command_optsrTr!) r"rrir'rhr"r#rlnargs cmd_classrrrrms"        z Distribution._parse_command_optsc Csi}x|jD]\}}x|D]\}\}}|dkr8q"|dd}|dkr||}|j}|t|dix<|D]\} } | |kr|| }d}Pq|Wtdn |dkrd}|| |i|<q"WqW|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. z command liner&r%rrNzShouldn't be able to get herer) rrkrVget_command_objrcopyupdater!rr) r"dcmdoptsr!r"rWZcmdobjr8negposrrrget_cmdline_optionss(     z Distribution.get_cmdline_optionsccsx|jp dD] }|Vq Wx|jp$dD] }|Vq&WxH|jp>dD]:}t|trX|\}}n|j}|drt|dd}|Vq@WdS)z@Yield all packages, modules, and extension names in distributionrmoduleNi)r\r]r^rrr<r)r"pkgryextr<Z buildinforrrr`Es      z$Distribution.iter_distribution_namesc Csddl}|jrt||St|jtjs4t||S|jj dkrPt||S|jj}|jj }|j dkrndppd}|jj }t|j d||||_z t||St|j |||||_XdS)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)zutf-8utf8win32r'zutf-8)r  help_commandsrhandle_display_optionsrstdoutr TextIOWrapperrrerrorsrDline_bufferingdetach)r" option_orderr rrnewlinerrrrrWs"    z#Distribution.handle_display_options)N)N)N)NF)0r __module__ __qualname____doc__rrZ OrderedSetrrrrr staticmethodrrrrrrrrrr$rr)rr:r<rArIrFrLrRr@rTrUrVrXr_rrdrWrfrgrmrxr`rrrrrrmsZ2      O .     (c@seZdZdZdS)rzrClass for warning about deprecations in dist in setuptools. Not ignored by default, unlike DeprecationWarning.N)rrrrrrrrr|sr)Vr(rr rrrrZ distutils.logrdistutils.core distutils.cmddistutils.distdistutils.commanddistutils.utilrdistutils.debugrdistutils.fancy_getoptrglobrrr,typingrrr collectionsr emailr distutils.errorsr r rZdistutils.versionrZsetuptools.externrrZ setuptools.extern.more_itertoolsrrrrZsetuptools.commandrZsetuptools.monkeyrZsetuptools.configrr{ email.messager __import__rr$rdr/r4r5r8r;rTrXrzrrrbrrrrrrrrrrrrrcorerrrrrrrs                - >