관리-도구
편집 파일: dist.cpython-39.pyc
a �������fK�����������������������@���s���d�gZ�ddlZddlZddlZddlZddlZddlZddlZddl Zddl ZddlZddlm Z �ddlmZ�ddlmZ�ddlmZ�ddlZddlmZ�ddlmZ�dd lmZmZ�dd lmZ�ddlmZ�ddlm Z �dd lm!Z!�ddl"m#Z#�ddl$Z$ddl$m%Z%�ddl&m'Z'�ddl(m)Z)�ddl*Z*e+d��e+d��dd��Z,dd��Z-dd��Z.dd��Z/dd��Z0e1e2fZ3dd ��Z4d!d"��Z5d#d$��Z6d%d&��Z7d'd(��Z8d)d*��Z9d+d,��Z:d-d.��Z;d/d0��Z<d1d2��Z=d3d4��Z>d5d6��Z?e'ej@jA�ZBG�d7d���d�eB�ZAG�d8d9��d9e#�ZCd<d:d;�ZDdS�)=�Distribution�����N)� strtobool)�DEBUG��translate_longopt)�iglob)�defaultdict)�message_from_file)�DistutilsOptionError�DistutilsSetupError)� rfc822_escape)� StrictVersion)� packaging)�ordered_set����)�SetuptoolsDeprecationWarning)�windows_support)� get_unpatched)�parse_configurationz&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versionc�����������������C���s���t��dt��t|��S�)NzDo not call this function)�warnings�warn�DistDeprecationWarningr���)�cls��r����3/usr/lib/python3.9/site-packages/setuptools/dist.py�_get_unpatched*���s����r���c�����������������C���s����t�|�dd��}|d�u�r�|�js |�jr*td�}nd|�jd�usT|�jd�usTt�|�dd��d�usT|�jr^td�}n0|�js||�js||�j s||�j s||�jr�td�}ntd�}||�_|S�)N�metadata_versionz2.1�python_requires�1.2�1.1z1.0) �getattr�long_description_content_type�provides_extrasr ���� maintainer�maintainer_email�project_urls�provides�requires� obsoletes�classifiers�download_urlr���)�self�mvr���r���r����get_metadata_version/���s*���� ��� �� r-���c��������������������s*��t�|�����fdd�}��fdd�}t��d��|�_|d�|�_|d�|�_|d�|�_|d �|�_d |�_|d�|�_d |�_ |d�|�_ |d �|�_d��v�r�|d�|�_nd |�_|d�|�_ |d�|�_d��v�r�|d��d�|�_|d�|�_|d�|�_|�jtd�k�r |d�|�_|d�|�_|d�|�_nd |�_d |�_d |�_|d�|�_d S�)z-Reads the metadata values from a file object.c��������������������s�����|��}|dkrd�S�|S�)NZUNKNOWNr���)�name�value��msgr���r����_read_fieldI���s����z"read_pkg_file.<locals>._read_fieldc��������������������s�������|�d��}|g�krd�S�|S��N)Zget_all)r.����valuesr0���r���r���� _read_listO���s����z!read_pkg_file.<locals>._read_listzmetadata-versionr.����versionZsummary�authorNzauthor-emailz home-page�licensezdownload-url�description�keywords�,�platformZ classifierr���r'���r&���r(���zlicense-file)r ���r ���r���r.���r6���r9���r7���r#����author_emailr$����urlr8���r*���Zlong_description�splitr:���Z platformsr)���r'���r&���r(���� license_files)r+����filer2���r5���r���r0���r���� read_pkg_fileE���s<���� rB���c�����������������C���s"���d|�v�rt��d��|��dd�}�|�S�)N� z1newlines not allowed and will break in the future� )r���r����replace)�valr���r���r����single_line|���s���� rG���c����������� ���������s��|�����}��fdd�}|dt|���|d|������|d|������|dt|�������|d|������|td�k�r�|d |������|d |�� ����n.d}|D�]$\}}t |�|�}|dur�|||��q�|d |������|�jr�|d|�j��|�j ���D�]}|dd|���q�t|�����} |d| ��d�|�����} | �r(|d| ��|td�k�rR|����D�]}|d|���q>n|����d|������|����d|������|����d|������|����d|������|����d|������t|�d��r�|d|�j��|�j�r�|d|�j��|�j�r�|�jD�]}|d|���q�|����d|�j�p g���dS�)z5Write the PKG-INFO format data to a file object. c��������������������s�������d|�|f���d�S�)Nz%s: %s )�write)�keyr/����rA���r���r����write_field����s����z#write_pkg_file.<locals>.write_fieldzMetadata-Version�Name�VersionZSummaryz Home-pager����Author�Author-email))rN���r7���)rO���r=���)Z Maintainerr#���)zMaintainer-emailr$���NZLicensezDownload-URLzProject-URLz%s, %sZDescriptionr;���ZKeywordsZPlatformZ ClassifierZRequiresZProvidesZ Obsoletesr���zRequires-PythonzDescription-Content-TypezProvides-ExtrazLicense-File)r-����strZget_nameZget_versionrG���Zget_descriptionZget_urlr ���Zget_contactZget_contact_emailr ���Zget_licenser*���r%����itemsr���Zget_long_description�joinZget_keywordsZ get_platformsZ_write_listZget_classifiersZget_requiresZget_providesZ get_obsoletes�hasattrr���r!���r"���r@���) r+���rA���r6���rK���Zoptional_fieldsZfield�attrZattr_valZproject_urlZ long_descr:���r<����extrar���rJ���r����write_pkg_file����sX���� � rV���c�����������������C���sb���zt�j�d|��}|jrJ��W�n>�ttttfy\�}�ztd||f��|�W�Y�d�}~n d�}~0�0�d�S�)Nzx=z4%r must be importable 'module:attrs' string (got %r)) � pkg_resources� EntryPoint�parse�extras� TypeError� ValueError�AttributeError�AssertionErrorr���)�distrT���r/����ep�er���r���r����check_importable����s�������rb���c�����������������C���sl���z(t�|ttf�sJ��d�|�|ks&J��W�n>�ttttfyf�}�ztd||f��|�W�Y�d}~n d}~0�0�dS�)z"Verify that value is a string list��z%%r must be a list of strings (got %r)N) � isinstance�list�tuplerR���r[���r\���r]���r^���r����r_���rT���r/���ra���r���r���r����assert_string_list����s���� ��rh���c�����������������C���sd���|}t�|�||��|D�]J}|��|�s2tdd|����|�d�\}}}|r||vrtj�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)rh����has_contents_forr���� rpartition� distutils�logr���)r_���rT���r/���Zns_packagesZnsp�parent�sep�childr���r���r���� check_nsp����s���� ���rq���c�������������� ���C���sR���zt�t�t|������W�n4�tttfyL�}�ztd�|�W�Y�d}~n d}~0�0�dS�)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) re���� itertools�starmap�_check_extrarQ���r[���r\���r]���r���rg���r���r���r����check_extras����s������ru���c�����������������C���s<���|���d�\}}}|r*t�|�r*td|���tt�|���d�S�)N�:zInvalid environment marker: )� partitionrW���Zinvalid_markerr���re����parse_requirements)rU���Zreqsr.���ro����markerr���r���r���rt��� ��s����rt���c�����������������C���s&���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}))rT���r/���N)�boolr����format)r_���rT���r/����tmplr���r���r����assert_bool��s����r}���c�������������� ���C���sn���z(t�t�|���t|ttf�r&td��W�n@�ttfyh�}�z$d}t|j ||d��|�W�Y�d}~n d}~0�0�dS�)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}�rT����errorN) re���rW���rx���rd����dict�setr[���r\���r���r{����r_���rT���r/���r���r|���r���r���r����check_requirements��s�������r����c�������������� ���C���sV���zt�j�|��W�n@�t�jjyP�}�z$d}t|j||d��|�W�Y�d}~n d}~0�0�dS�)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}r~���N)r���Z specifiersZSpecifierSetZInvalidSpecifierr���r{���r����r���r���r����check_specifier'��s�������r����c�������������� ���C���sD���zt�j�|��W�n.�ty>�}�zt|�|�W�Y�d}~n d}~0�0�dS�)z)Verify that entry_points map is parseableN)rW���rX���Z parse_mapr\���r���rg���r���r���r����check_entry_points5��s����r����c�����������������C���s���t�|t�std��d�S�)Nztest_suite must be a string)rd���rP���r���)r_���rT���r/���r���r���r����check_test_suite=��s���� r����c�����������������C���sZ���t�|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)rd���r����r���r{���rQ���rP���rh���)r_���rT���r/����k�vr���r���r����check_package_dataB��s���� �� ��r����c�����������������C���s(���|D�]}t��d|�stj�d|��qd�S�)Nz\w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)�re�matchrl���rm���r���)r_���rT���r/���Zpkgnamer���r���r����check_packagesQ��s�����r����c�������������������@���sV��e�Zd�ZdZdeejdd��dd��d�ZdZdd��Z dLd d �Z edd���Zed d���Z dd��Zdd��Zedd���Zdd��Zdd��Zdd��Zedd���ZdMdd�ZdNdd �ZdOd"d#�Zd$d%��Zd&d'��Zd(d)��Zd*d+��Zd,d-��Zd.d/��Zd0d1��Zd2d3��Zd4d5��Z d6d7��Z!d8d9��Z"d:d;��Z#d<d=��Z$d>d?��Z%d@dA��Z&dBdC��Z'dDdE��Z(dFdG��Z)dHdI��Z*dJdK��Z+dS�)Pr���aG��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. Nc�������������������C���s���d�S�r3���r���r���r���r���r����<lambda>��������zDistribution.<lambda>c�������������������C���s���d�S�r3���r���r���r���r���r���r�������r����)r!���r%���r"����license_filer@���c�����������������C���sl���|rd|vsd|vrd�S�t��t|d������}t�jj�|�}|d�urh|�d�sht��t|d���|_ ||�_ d�S�)Nr.���r6���zPKG-INFO)rW���Z safe_namerP����lower�working_setZby_key�getZhas_metadataZsafe_versionZ_version� _patched_dist)r+����attrsrI���r_���r���r���r����patch_missing_pkg_info���s����z#Distribution.patch_missing_pkg_infoc��������������������s��t���d�}|si���_|pi�}g���_|�dd����_���|��|�dg����_|�dg����_t� d�D�]}t ����|jd���q`t �����fdd�|���D������j���D�]J\}}��jj|fD�]}||v�r�||�}�q�q�|r�|��nd�}t��j||��q���������jj����j_������d�S�)N�package_data�src_root�dependency_links�setup_requires�distutils.setup_keywordsc��������������������s ���i�|�]\}}|��j�vr||�qS�r���)�_DISTUTILS_UNSUPPORTED_METADATA��.0r����r�����r+���r���r���� <dictcomp>���s��� �z)Distribution.__init__.<locals>.<dictcomp>)rS���r����Z dist_files�popr����r����r����r����rW����iter_entry_points�vars� setdefaultr.���� _Distribution�__init__rQ���r�����metadata�__dict__�setattr�_normalize_version�_validate_versionr6����_finalize_requires)r+���r����Zhave_package_datar`����option�default�sourcer/���r���r����r���r�������s2���� ��zDistribution.__init__c�����������������C���sT���t�|�tj�s|�d�u�r|�S�ttj�|���}|�|krPd}t�|j f�i�t ������|S�|�S�)Nz)Normalizing '{version}' to '{normalized}')rd���� setuptools�sicrP���r���r6���rM���r���r���r{����locals)r6���Z normalizedr|���r���r���r���r�������s����zDistribution._normalize_versionc�������������� ���C���sd���t�|�tj�rt|��}�|�d�ur`ztj�|���W�n2�tjjtfy^���t � d|����t�|���Y�S�0�|�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.) rd����numbers�NumberrP���r���r6���rM���ZInvalidVersionr[���r���r���r����r����)r6���r���r���r���r�������s������zDistribution._validate_versionc�����������������C���sf���t�|�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`. r���N�extras_requirerv���r���) r ���r���r����r�����keysr?���r"����add�_convert_extras_requirements�"_move_install_requirements_markers)r+���rU���r���r���r���r�������s���� zDistribution._finalize_requiresc�����������������C���sh���t�|�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���re����_tmp_extras_requirerQ���rW���rx����_suffix_for�append)r+���Z spec_ext_reqs�sectionr�����r�suffixr���r���r���r�������s���� z)Distribution._convert_extras_requirementsc�����������������C���s���|�j�rdt|�j���S�dS�)ze For a requirement, return the 'extras_require' suffix for that requirement. rv���rc���)ry���rP�����reqr���r���r���r������s����zDistribution._suffix_forc��������������������s����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`. c�����������������S���s���|�j��S�r3����ry���r����r���r���r���� is_simple_req��s����zFDistribution._move_install_requirements_markers.<locals>.is_simple_req�install_requiresNr���rv���c�����������������3���s,���|�]$\}}|d�d��t���j|�D��fV��qdS�)c�����������������S���s���g�|�]}t�|��qS�r���)rP���)r����r����r���r���r���� <listcomp>*��r����zMDistribution._move_install_requirements_markers.<locals>.<genexpr>.<listcomp>N)�map� _clean_reqr����r����r���r���� <genexpr>)��s����zBDistribution._move_install_requirements_markers.<locals>.<genexpr>)r ���re���rW���rx����filterrr����filterfalser����rP���r����r����ry���r����r����rQ���r����)r+���r����Zspec_inst_reqsZ inst_reqsZsimple_reqsZcomplex_reqsr����r���r����r���r������s���� �z/Distribution._move_install_requirements_markersc�����������������C���s ���d|_�|S�)zP Given a Requirement, remove environment markers and return it. Nr����)r+���r����r���r���r���r����.��s����zDistribution._clean_reqc�����������������C���s`���|�j�j}|r|ng�}|�j�j}|r2||vr2|�|��|du�rF|du�rFd}tt|��|���|�j�_dS�)z<Compute names of all license files which should be included.N)zLICEN[CS]E*zCOPYING*zNOTICE*zAUTHORS*)r����r@���r����r����re����unique_everseen�_expand_patterns)r+���r@����patternsr����r���r���r����_finalize_license_files5��s���� �z$Distribution._finalize_license_filesc�����������������C���s���dd��|�D��S�)Nc�����������������s���s6���|�].}t�|�D�] }|�d��stj�|�r|V��qqdS�)�~N)r����endswith�os�path�isfile)r�����patternr����r���r���r���r����I��s ��� �z0Distribution._expand_patterns.<locals>.<genexpr>r���)r����r���r���r���r����G��s�����zDistribution._expand_patternsc�����������������C���s���ddl�m}�tjtjkrg�ng�d�}t|�}|du�r<|����}trJ|��d��|��}t |_ |D�]�}tj|dd��6}tr�|��dj f�i�t������|�|��W�d����n1�s�0����Y��|���D�]X}|�|�}|��|�} |D�]:} | d ks�| |v�r�q�|�|| �}| �d d�} ||f| | <�q�q�|����qZd|�jv�r.dS�|�jd����D�]�\} \}}|�j�| �} | �rft|��}n| d v��rxt|�}zt|�| �p�| |��W�n0�t�y��}�zt|�|�W�Y�d}~n d}~0�0��q<dS�)z� Adapted from distutils.dist.Distribution.parse_config_files, this method provides the same functionality in subtly-improved ways. r���)�ConfigParser) zinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-data�prefixzexec-prefix�home�user�rootNz"Distribution.parse_config_files():�utf-8)�encodingz reading {filename}�__name__�-�_�global)�verbose�dry_run)Zconfigparserr�����sysr�����base_prefix� frozensetZfind_config_filesr����announcerP���Zoptionxform�io�openr{���r����Z read_fileZsections�options�get_option_dictr����rE���r�����command_optionsrQ����negative_optr���r����r\���r ���)r+���� filenamesr����Zignore_options�parser�filename�readerr����r����Zopt_dict�optrF����src�aliasra���r���r���r����_parse_config_filesR��sH���� ( z Distribution._parse_config_filesc�����������������C���s\��|����}|du�r|��|�}tr,|��d|���|���D��] \}\}}trZ|��d|||f���zdd��|jD��}W�n�ty����g�}Y�n0�z |j}W�n�ty����i�}Y�n0�z|t|t �} ||v�r�| r�t |||�t|����nJ||v�r�| r�t ||t|���n,t||��rt |||��nt d|||f���W�q4�t�yT�} �zt | �| �W�Y�d} ~ q4d} ~ 0�0�q4dS�)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)c�����������������S���s���g�|�]}t�|��qS�r���r���)r�����or���r���r���r�������s����z5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')Zget_command_namer����r���r����rQ���Zboolean_optionsr]���r����rd���rP���r����r���rS���r ���r\���)r+���Zcommand_objZoption_dictZcommand_namer����r����r/���Z bool_opts�neg_optZ is_stringra���r���r���r����_set_command_options���sF���� �� ��z!Distribution._set_command_optionsFc�����������������C���s0���|�j�|d��t|�|�j|d��|�����|�����dS�)zYParses configuration files from various levels and loads configuration. )r����)�ignore_option_errorsN)r����r���r����r����r����)r+���r����r����r���r���r����parse_config_files���s�����zDistribution.parse_config_filesc�����������������C���s8���t�jjt��|�|�jdd�}|D�]}t�jj|dd��q|S�)zResolve pre-setup requirementsT)� installerZreplace_conflicting)rE���)rW���r�����resolverx����fetch_build_eggr����)r+���r'���Zresolved_distsr_���r���r���r����fetch_build_eggs���s�����zDistribution.fetch_build_eggsc�����������������C���s>���d}dd��}t�dd��t�|��}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_optionsc�����������������S���s���t�|�dd�S�)N�orderr���)r ���)�hookr���r���r����by_order���s����z/Distribution.finalize_options.<locals>.by_orderc�����������������S���s���|�����S�r3���)�load)ra���r���r���r���r�������r����z/Distribution.finalize_options.<locals>.<lambda>)rI���N)r����rW���r�����sorted)r+����groupr�����epsr`���r���r���r����finalize_options���s ����zDistribution.finalize_optionsc�����������������C���sJ���t��d�D�]:}t|�|jd��}|d�ur |j|�jd��|���|�|j|��q d�S�)Nr�����r����)rW���r����r ���r.����requirer����r����)r+���r`���r/���r���r���r����_finalize_setup_keywords���s ����z%Distribution._finalize_setup_keywordsc�����������������C���s*���t�|�dd��r dd��|�jD��|�_ng�|�_d�S�)N�convert_2to3_doctestsc�����������������S���s���g�|�]}t�j�|��qS�r���)r����r�����abspath�r�����pr���r���r���r�������s����z8Distribution._finalize_2to3_doctests.<locals>.<listcomp>)r ���r��r����r���r���r����_finalize_2to3_doctests���s ����� z$Distribution._finalize_2to3_doctestsc�����������������C���s����t�j�t�jd�}t�j�|�s�t��|��t�|��t�j�|d�}t|d��.}|� d��|� d��|� d��W�d�����n1�s|0����Y��|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. ) r����r����rR����curdir�exists�mkdirr���Z hide_filer����rH���)r+���Z egg_cache_dirZreadme_txt_filename�fr���r���r����get_egg_cache_dir���s���� (zDistribution.get_egg_cache_dirc�����������������C���s���ddl�m}�||�|�S�)z Fetch an egg needed for buildingr���)r����)Zsetuptools.installerr����)r+���r����r����r���r���r���r���� ��s����zDistribution.fetch_build_eggc�����������������C���s\���||�j�v�r|�j�|�S�t�d|�}|D�]*}|j|�jd��|����|�j�|<�}|��S�t�|�|�S�)z(Pluggable version of get_command_class()�distutils.commandsr��N)�cmdclassrW���r����r��r����r����r�����get_command_class)r+����commandr��r`���r��r���r���r���r����s���� zDistribution.get_command_classc�����������������C���s:���t��d�D�]$}|j|�jvr |���}||�j|j<�q t�|��S��Nr��)rW���r����r.���r��r����r�����print_commands�r+���r`���r��r���r���r���r����s ����zDistribution.print_commandsc�����������������C���s:���t��d�D�]$}|j|�jvr |���}||�j|j<�q t�|��S�r��)rW���r����r.���r��r����r�����get_command_listr��r���r���r���r��#��s ����zDistribution.get_command_listc�����������������K���s@���|����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)rQ���r ���� _include_misc)r+���r����r����r�����includer���r���r���r��+��s ���� zDistribution.includec��������������������sf�����d��|�j�r&���fdd�|�j�D��|�_�|�jrD���fdd�|�jD��|�_|�jrb���fdd�|�jD��|�_dS�)z9Remove packages, modules, and extensions in named packageri���c��������������������s"���g�|�]}|��kr|����s|�qS�r����� startswithr ����package�pfxr���r���r����F��s����z0Distribution.exclude_package.<locals>.<listcomp>c��������������������s"���g�|�]}|��kr|����s|�qS�r���r��r ��r��r���r���r����L��s����c��������������������s&���g�|�]}|j���kr|j����s|�qS�r���)r.���r��r ��r��r���r���r����R��s����N)�packages� py_modules�ext_modules)r+���r��r���r��r����exclude_packageA��s�������zDistribution.exclude_packagec�����������������C���s2���|d�}|�����D�]}||ks&|�|�r�dS�qdS�)z<Return true if 'exclude_package(package)' would do somethingri���TN)�iter_distribution_namesr��)r+���r��r ��r ��r���r���r���rj���W��s����zDistribution.has_contents_forc�������������� ������s����t���t�std|��f���zt|�|�}W�n2�tyZ�}�ztd|��|�W�Y�d}~n d}~0�0�|dur|t�|t�s|t|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/excludec��������������������s���g�|�]}|��vr|�qS�r���r����r�����item�r/���r���r���r����q��r����z.Distribution._exclude_misc.<locals>.<listcomp>�rd����sequencer���r ���r]���r����)r+���r.���r/����oldra���r���r*��r���� _exclude_misc`��s$���� ����zDistribution._exclude_miscc�������������� ������s����t�|t�std||f���zt|�|���W�n2�tyZ�}�ztd|��|�W�Y�d}~n d}~0�0���du�rrt|�||��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'��c��������������������s���g�|�]}|��vr|�qS�r���r���r(���r-��r���r���r�������r����z.Distribution._include_misc.<locals>.<listcomp>r+��)r+���r.���r/���ra����newr���r/��r���r��s��s(���� ��� �zDistribution._include_miscc�����������������K���s@���|����D�]2\}}t|�d|�d�}|r.||��q|��||��qdS�)a��Remove 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)rQ���r ���r.��)r+���r����r����r�����excluder���r���r���r1�����s ���� zDistribution.excludec�����������������C���s,���t�|t�std|f���tt|�j|���d�S�)Nz.packages: setting must be a list or tuple (%r))rd���r,��r���re���r����r$��)r+���r!��r���r���r����_exclude_packages���s ���� �zDistribution._exclude_packagesc����������� ������C���s����|�j�j|�_|�j�j|�_|d�}|��d�}||v�rf||�\}}||=�dd�l}|�|d�|d�d�<�|d�}q&t�|�||�}|��|�} t | dd��r�d|f|��|�d<�|d�ur�g�S�|S�)Nr����aliasesTr���Zcommand_consumes_arguments�command line�args) � __class__Zglobal_optionsr����r�����shlexr?���r�����_parse_command_optsr��r ���) r+���r����r5��r��r3��r����r����r7���nargsZ cmd_classr���r���r���r8�����s"���� z Distribution._parse_command_optsc�����������������C���s����i�}|�j����D�]�\}}|���D�]�\}\}}|dkr4q|�dd�}|dkr�|��|�}|�j���}|�t|di����|���D�]\} } | |krv| }d}�q�qvtd��n|dkr�d}||� |i��|<�qq|S�) ah��Return 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. r4��r����r����r���r����NzShouldn't be able to get herer���) r����rQ���rE���Zget_command_objr�����copy�updater ���r^���r����)r+����d�cmdZoptsr����r����rF���Zcmdobjr�����neg�posr���r���r����get_cmdline_options���s(���� z Distribution.get_cmdline_optionsc�����������������c���sv���|�j�pdD�] }|V��q |�jpdD�] }|V��q |�jp4dD�]:}t|t�rN|\}}n|j}|�d�rj|dd��}|V��q6dS�)z@Yield all packages, modules, and extension names in distributionr����moduleNi����)r!��r"��r#��rd���rf���r.���r����)r+����pkgrA���extr.���Z buildinfor���r���r���r%�����s���� z$Distribution.iter_distribution_namesc�������������� ���C���s����ddl�}|�jrt�|�|�S�t|jtj�s4t�|�|�S�|jj� ��dv�rPt�|�|�S�|jj}|jj }|jdkrndppd}|jj}t�|j� ��d|||�|_z(t�|�|�W�t�|j� ��||||�|_S�t�|j� ��||||�|_0�dS�)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. r���N)r�����utf8�win32rC���r����)r����Z help_commandsr�����handle_display_optionsrd����stdoutr����� TextIOWrapperr����r�����errorsr<����line_buffering�detach)r+���Zoption_orderr����r����rI���newlinerJ��r���r���r���rF�����s2�����������z#Distribution.handle_display_options)N)N)N)NF),r����� __module__�__qualname__�__doc__r����r���Z OrderedSetr����r����r����r�����staticmethodr����r����r����r����r����r����r����r����r����r����r����r����r����r��r��r��r��r����r��r��r��r��r$��rj���r.��r��r1��r2��r8��r@��r%��rF��r���r���r���r���r���]��s\���4� " B / (c�������������������@���s���e�Zd�ZdZdS�)r���zrClass for warning about deprecations in dist in setuptools. Not ignored by default, unlike DeprecationWarning.N)r����rM��rN��rO��r���r���r���r���r�����s���r���c�����������������c���sd���t���}|j}|du�r8t�|j|��D�]}||��|V��q"n(|�D�]"}||�}||vr<||��|V��q<dS�)zHList unique elements, preserving order. Remember all elements ever seen.N)r����r����rr���r�����__contains__)�iterablerI����seenZseen_add�elementr����r���r���r���r����$��s���� r����)N)E�__all__r����r����r����r����r���r����Z distutils.logrl���Zdistutils.coreZ distutils.cmdZdistutils.distZdistutils.utilr���Zdistutils.debugr���Zdistutils.fancy_getoptr����globr���rr����collectionsr���Zemailr ���Zdistutils.errorsr ���r���r���Zdistutils.versionr ���Zsetuptools.externr���r���rc���r���r����r���Zsetuptools.monkeyr���Zsetuptools.configr���rW���� __import__r���r-���rB���rG���rV���rf���re���r,��rb���rh���rq���ru���rt���r}���r����r����r����r����r����r����Zcorer���r����r���r����r���r���r���r����<module>���sr���7 I �����G