Your IP : 3.143.170.30
�
�/�g�����dZddlZddlZddlZddlmZ ddlZn
#e$rdZYnwxYwddlTddl m
Z
mZddlm
Z
mZmZddlmZddlmZejd ��Zd
�ZGd�d��ZGd
�d��Zd�ZdS)z}distutils.dist
Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
�N)�message_from_file)�*)�FancyGetopt�translate_longopt)�
check_environ� strtobool�
rfc822_escape��log)�DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$c���t|t��rn`t|t��sKt|��j}d|�d|�d�}tjt
j|��t|��}|S)Nz
Warning: 'z' should be a list, got type '�')�
isinstance�str�list�type�__name__r�WARN)�value� fieldname�typename�msgs �5/opt/alt/python311/lib64/python3.11/distutils/dist.py�_ensure_listrsu���%���� �
�
��t�
$�
$����;�;�'��O�9�O�O�H�O�O�O������#�����U�����L�c��eZdZdZgd�ZdZgd�Zd�eD��ZddiZd*d �Z d
�Z
d+d�Zd
�Zd*d�Z
d�Zd�Zd�Zd�Zddgfd�Zd�Zd�Zd�Zd�Zd�Zd�Zd,d�Zd*d�Zd-d�Zejfd�Zd �Zd!�Z d"�Z!d#�Z"d$�Z#d%�Z$d&�Z%d'�Z&d(�Z'd)�Z(dS).�Distributiona�The core of the Distutils. Most of the work hiding behind 'setup'
is really done within a Distribution instance, which farms the work out
to the Distutils commands specified on the command line.
Setup scripts will almost never instantiate Distribution directly,
unless the 'setup()' function is totally inadequate to their needs.
However, it is conceivable that a setup script might wish to subclass
Distribution for some specialized purpose, and then pass the subclass
to 'setup()' as the 'distclass' keyword argument. If so, it is
necessary to respect the expectations that 'setup' has of Distribution.
See the code for 'setup()', in core.py, for details.
))�verbose�vzrun verbosely (default)�)�quiet�qz!run quietly (turns verbosity off))zdry-run�nzdon't actually do anything)�help�hzshow detailed help message)zno-user-cfgNz-ignore pydistutils.cfg in your home directoryz�Common commands: (see '--help-commands' for more)
setup.py build will build the package underneath 'build/'
setup.py install will install the package
))z
help-commandsNzlist all available commands)�nameNzprint package name)�version�Vzprint package version)�fullnameNzprint <package name>-<version>)�authorNzprint the author's name)�author-emailNz print the author's email address)�
maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)�contactNz7print the maintainer's name if known, else the author's)z
contact-emailNz@print the maintainer's email address if known, else the author's)�urlNzprint the URL for this package)�licenseNz print the license of the package)�licenceNzalias for --license)�descriptionNzprint the package description)zlong-descriptionNz"print the long package description)� platformsNzprint the list of platforms)�classifiersNzprint the list of classifiers)�keywordsNzprint the list of keywords)�providesNz+print the list of packages/modules provided)�requiresNz+print the list of packages/modules required)� obsoletesNz0print the list of packages/modules made obsoletec�8�g|]}t|d����S�r�r)�.0�xs r�
<listcomp>zDistribution.<listcomp>�s%��M�M�M��-�a��d�3�3�M�M�Mrr!rNc ���d|_d|_d|_|jD]}t ||d���t��|_|jjD]+}d|z}t ||t|j|�����,i|_ d|_
d|_d|_i|_
g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|�r�|�d��}|�S|d=|���D];\}}|� |��}|���D]\} }
d|
f|| <�
�<d|vrN|d|d <|d=d
}tB�tCj"|��n"tFj$�%|dz��|���D]�\}}
tM|jd|z��r"t|jd|z��|
���?tM|j|��rt |j||
���ktM||��rt |||
����d
tO|��z}tCj"|����d|_(|j�0|jD](}
|
�)d��sn|
dkr d|_(n�)|�*��dS)a0Construct a new Distribution instance: initialize all the
attributes of a Distribution, and then use 'attrs' (a dictionary
mapping attribute names to values) to assign some of those
attributes their "real" values. (Any attributes not mentioned in
'attrs' will be assigned to some null value: 0, None, an empty list
or dictionary, etc.) Most importantly, initialize the
'command_obj' attribute to the empty dictionary; this will be
filled in with real command objects by 'parse_command_line()'.
r r�get_N��optionszsetup scriptr0r/z:'licence' distribution option is deprecated; use 'license'�
�set_zUnknown distribution option: %sT�-z
--no-user-cfgF)+r�dry_runr$�display_option_names�setattr�DistributionMetadata�metadata�_METHOD_BASENAMES�getattr�cmdclass�command_packages�script_name�script_args�command_options�
dist_files�packages�package_data�package_dir�
py_modules� libraries�headers�ext_modules�ext_package�include_dirs�
extra_path�scripts�
data_files�password�command_obj�have_run�get�items�get_option_dict�warnings�warn�sys�stderr�write�hasattr�repr�
want_user_cfg�
startswith�finalize_options)�self�attrs�attr�basename�method_namerA�command�cmd_options�opt_dict�opt�valr�key�args r�__init__zDistribution.__init__�si���������� ��-� #� #�D��D�$��"�"�"�"�-�.�.��
��
�7� L� L�H� �8�+�K��D�+�w�t�}�k�'J�'J�K�K�K�K���
�!%���
������ "������
��
���������������������� ��������������
������
��! '�
�i�i� �*�*�G��"��)�$�.5�m�m�o�o�>�>�*�W�k�#�3�3�G�<�<�H�&1�&7�&7�&9�&9�>�>�
��c�)7��(=���
�
�>��E�!�!�#(��#3��i� ��)�$�R���'��M�#�&�&�&�&��J�$�$�S�4�Z�0�0�0�$�k�k�m�m�
'�
'�
��c��4�=�&�3�,�7�7�'�8�G�D�M�6�C�<�8�8��=�=�=�=��T�]�C�0�0�'��D�M�3��4�4�4�4��T�3�'�'�'��D�#�s�+�+�+�+�;�d�3�i�i�G�C��M�#�&�&�&�&�"�����'��'�
�
���~�~�c�*�*���E��/�)�)�).�D�&��E�*�
�������rc�V�|j�|��}|�ix}|j|<|S)z�Get the option dictionary for a given command. If that
command's option dictionary hasn't been created yet, then create it
and return the new dictionary; otherwise, return the existing
option dictionary.
)rPra)rnrs�dicts rrczDistribution.get_option_dict&s6���#�'�'��0�0���<�35�5�D�4�'��0��rr@c��ddlm}|�&t|j�����}|�|�||z��|dz}|s|�|dz��dS|D]�}|j�|��}|�|�|d|zz���:|�|d|zz��||��}|�d��D]}|�|dz|z�����dS)Nr)�pformatz zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:rB)�pprintr~�sortedrP�keys�announcera�split) rn�header�commands�indentr~�cmd_nameru�out�lines r�dump_option_dictszDistribution.dump_option_dicts1sZ��"�"�"�"�"�"����d�2�7�7�9�9�:�:�H����M�M�&�6�/�*�*�*��d�]�F�� ��M�M�&�#:�:�;�;�;��F� �
8�
8�H��+�/�/��9�9�H����
�
�f�?�(�J�K�L�L�L�L��
�
�f�=��H�I�J�J�J��g�h�'�'���I�I�d�O�O�8�8�D��M�M�&�4�-�$�"6�7�7�7�7�8�
8�
8rc� �g}t��tj�tjdj��}tj�|d��}tj�|��r|� |��tj
dkrd}nd}|jrqtj�tj�d��|��}tj�|��r|� |��d}tj�|��r|� |��tr+|�dd �|��z��|S)
a�Find as many configuration files as should be processed for this
platform, and return a list of filenames in the order in which they
should be parsed. The filenames returned are guaranteed to exist
(modulo nasty race conditions).
There are three possible config files: distutils.cfg in the
Distutils installation directory (ie. where the top-level
Distutils __inst__.py file lives), a file in the user's home
directory named .pydistutils.cfg on Unix and pydistutils.cfg
on Windows/Mac; and setup.cfg in the current directory.
The file in the user's home directory can be disabled with the
--no-user-cfg option.
� distutilsz
distutils.cfg�posixz.pydistutils.cfgzpydistutils.cfg�~z setup.cfgzusing config files: %sz, )r�os�path�dirnamerf�modules�__file__�join�isfile�appendr&rk�
expanduserrr�)rn�files�sys_dir�sys_file�
user_filename� user_file�
local_files r�find_config_fileszDistribution.find_config_filesMsF���������'�/�/�#�+�k�":�"C�D�D���7�<�<���9�9��
�7�>�>�(�#�#� #��L�L��"�"�"��7�g���.�M�M�-�M��� (�����R�W�%7�%7��%<�%<�m�L�L�I��w�~�~�i�(�(�
(����Y�'�'�'�!�
�
�7�>�>�*�%�%� %��L�L��$�$�$�� G��M�M�2�T�Y�Y�u�5E�5E�E�F�F�F��rc��ddlm}tjtjkrgd�}ng}t|��}|�|���}tr|�d��|��}|D]�}tr|�d|z��|� |��|�
��D]n}|�|��}|�|��}|D]?} | dkr7| |vr3|�
|| ��}
| �dd��} ||
f|| <�@�o|�����d |jvr�|jd ���D]�\} \}}
|j�
| ��} |r t'||t)|
����n4| d
vrt'|| t)|
����nt'|| |
���z#t*$r}
t-|
���d}
~
wwxYwdSdS)Nr)�ConfigParser)
zinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-data�prefixzexec-prefix�home�user�rootz"Distribution.parse_config_files():z reading %srrD�_�global)rrE)�configparserr�rfr��base_prefix� frozensetr�rr��read�sectionsrArcra�replacerzrPrb�negative_optrGr�
ValueError�DistutilsOptionError)rn� filenamesr��ignore_options�parser�filename�sectionrArurvrw�src�aliasrs r�parse_config_fileszDistribution.parse_config_files}so��-�-�-�-�-�-��:���(�(�(�(�(�N�N� �N�"�>�2�2�����.�.�0�0�I�� @��M�M�>�?�?�?������!� � �H��
9��
�
�n�x�7�8�8�8��K�K��!�!�!�!�?�?�,�,�
8�
8�� �.�.��1�1���/�/��8�8��"�8�8�C��j�(�(�S��-F�-F�$�j�j���5�5��!�k�k�#�s�3�3��)1�3����
�� 8�
�O�O�����
�t�+�+�+�%)�%9�(�%C�%I�%I�%K�%K�
4�
4�!��j�s�C��)�-�-�c�2�2��4��0���e��3���-?�@�@�@�@�� 6�6�6���c�9�S�>�>�:�:�:�:���c�3�/�/�/���!�4�4�4�.�s�3�3�3�����4����,�+�
4�
4s�AG%�%
H�/G>�>Hc�l�|���}g|_t||jz��}|�|j��|�ddi��|�|j|���}|� ��}tj|j��|�
|��rdS|r|�||��}|�dS|�|jr5|�|t#|j��dk|j���dS|jst%d���dS) a�Parse the setup script's command line, taken from the
'script_args' instance attribute (which defaults to 'sys.argv[1:]'
-- see 'setup()' in core.py). This list is first processed for
"global options" -- options that set attributes of the Distribution
instance. Then, it is alternately scanned for Distutils commands
and options for that command. Each new command terminates the
options for the previous command. The allowed options for a
command are determined by the 'user_options' attribute of the
command class -- thus, we have to be able to load command classes
in order to parse the command line. Any error in that 'options'
attribute raises DistutilsGetoptError; any error on the
command-line raises DistutilsArgError. If no Distutils commands
were found on the command line, raises DistutilsArgError. Return
true if command-line was successfully parsed and we should carry
on with executing commands; false if no errors but we shouldn't
execute commands (currently, this only happens if user asks for
help).
r0r/)�args�objectNr��display_optionsr�zno commands suppliedT)�_get_toplevel_optionsr�rr��set_negative_aliasesr��set_aliases�getoptrO�get_option_orderr�
set_verbosityr�handle_display_options�_parse_command_optsr$�
_show_help�len�DistutilsArgError)rn�toplevel_optionsr�r��option_orders r�parse_command_linezDistribution.parse_command_line�sX��. �5�5�7�7����
��-��0D�D�E�E���#�#�D�$5�6�6�6����I�y�1�2�2�2��}�}�$�"2�4�}�@�@���.�.�0�0����$�,�'�'�'��&�&�|�4�4� ��F�� ��+�+�F�D�9�9�D��|���� ��9� ��O�O�F�,/��
�,>�,>�!�,C�%)�]�
�
4�
4�
4�
�F��}� <�#�$:�;�;�;��trc��|jdgzS)z�Return the non-display options recognized at the top level.
This includes options that are recognized *only* at the top
level as well as options recognized for commands.
)zcommand-packages=Nz0list of packages that provide distutils commands)�global_options�rns rr�z"Distribution._get_toplevel_options�s���"�
A�&�� rc��ddlm}|d}t�|��st d|z���|j�|�� |�|��}n!#t$r}t|���d}~wwxYwt||��std|z���t|d��rt|jt��sd}t||z���|j}t|d��r.|���}|�|j��t|d ��r/t|jt��rt)|j��}ng}|�|j|jz|z��|�|��|�|d
d���\}} t| d��r"| jr|�|d|g���dSt|d ��r�t|jt��rjd}
|jD]\\}}}
}t| |�|����r2d
}
t9|��r|���Ftd
|�d|�d�����]|
rdS|�|��}t=| �����D]\}}d|f||<�
|S)a�Parse the command-line options for a single command.
'parser' must be a FancyGetopt instance; 'args' must be the list
of arguments, starting with the current command (whose options
we are about to parse). Returns a new version of 'args' with
the next command at the front of the list; will be the empty
list if there are no more commands on the command line. Returns
None if the user asked for help on this command.
r��Commandzinvalid command name '%s'Nz&command class %s must subclass Command�user_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)r��help_optionsr r$r�zinvalid help function z for help option 'z-': must be a callable object (function, etc.)zcommand line) �
distutils.cmdr��
command_re�match�
SystemExitr�r��get_command_class�DistutilsModuleErrorr��
issubclass�DistutilsClassErrorrirr�rr��copy�updater��fix_help_options�set_option_tabler�r�r�r$r��
get_attr_name�callablerc�varsrb)rnr�r�r�rs� cmd_classrr�r��opts�help_option_found�help_option�short�desc�funcrur&rs rr�z Distribution._parse_command_optssU�� *�)�)�)�)�)��q�'������(�(� D��8�7�B�C�C�C��
���W�%�%�%�
)��.�.�w�7�7�I�I��#� )� )� )�#�C�(�(�(����� )����
�)�W�-�-� F�%�8�9�D�F�F�
F�
� �>�2�2� 7��9�1�4�8�8� 7�>�C�%�c�I�o�6�6�6��(���9�n�-�-� 8�'�,�,�.�.�L���� � 6�7�7�7�
�I�~�.�.� ��9�1�4�8�8� �+�I�,B�C�C�L�L��L� ���� 3� )� 6�!7� ,�!-� .� .� .� �#�#�L�1�1�1��}�}�T�!�"�"�X�.�.���t��4�� � � �T�Y� ��O�O�F�A���O�L�L�L��F��I�~�.�.� ��9�1�4�8�8� ���4=�4J�
3�
3�0��e�T�4��4��!5�!5�k�!B�!B�C�C�3�&'�%���~�~�3�������1�1� $�t�t�[�[�[�2�3�3�3�3�!�
����'�'��0�0��!�$�Z�Z�-�-�/�/� 5� 5�M�T�5�,�e�4�H�T�N�N��s�A,�,
B
�6B�B
c���dD]d}t|j|��}|��t|t��r5d�|�d��D��}t|j||���edS)z�Set final values for all the options on the Distribution
instance, analogous to the .finalize_options() method of Command
objects.
�r4r2Nc�6�g|]}|�����S���strip)r;�elms rr=z1Distribution.finalize_options.<locals>.<listcomp>js ��A�A�A�������A�A�Ar�,)rKrIrrr�rG)rnrprs rrmzDistribution.finalize_options`s|��
.� 4� 4�D��D�M�4�0�0�E��}���%��%�%�
4�A�A����C�0@�0@�A�A�A����
�t�U�3�3�3��
4� 4rr c�h�ddlm}ddlm}|r_|r|���}n|j}|�|��|�|jdz��td��|r>|�|j
��|�d��td��|jD]�}t|t��rt||��r|} n|�|��} t!| d��rJt| jt$��r0|�| jt)| j��z��n|�| j��|�d| jz��td����t||j����d S)
abShow help for the setup script command-line in the form of
several lists of command-line options. 'parser' should be a
FancyGetopt instance; do not expect it to be returned in the
same state, as its option table will be reset to make it
generate the correct help text.
If 'global_options' is true, lists the global options:
--verbose, --dry-run, etc. If 'display_options' is true, lists
the "display-only" options: --name, --version, etc. Finally,
lists per-command help for every command name or command class
in 'commands'.
r�� gen_usager�z
Global options:r@zKInformation display options (just display information, ignore any commands)r�zOptions for '%s' command:N)�distutils.corer�r�r�r�r�r��
print_help�common_usage�printr�r�rrr�r�rir�rr�r�rrN)
rnr�r�r�r�r�r�rArs�klasss
rr�zDistribution._show_helpms��� -�,�,�,�,�,�)�)�)�)�)�)�� ��
.��4�4�6�6����-���#�#�G�,�,�,����d�/�2E�E�F�F�F��"�I�I�I�� ��#�#�D�$8�9�9�9����4�
5�
5�
5�
�"�I�I�I��}� � �G��'�4�(�(�
8�Z���-I�-I�
8�����.�.�w�7�7����~�.�.�
<��u�1�4�8�8�
<��'�'��(:�(8��9K�(L�(L�)M�N�N�N�N��'�'��(:�;�;�;����9�E�N�J�K�K�K��"�I�I�I�I�
�i�i��(�)�)�*�*�*�*�*rc�0�ddlm}|jrB|���t d��t ||j����dSd}i}|jD]
}d||d<�|D]�\}}|r�|�|��r�t|��}t|j
d|z����}|dvr#t d�|����n6|dvr#t d �|����nt |��d}��|S)
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.
rr�r@r r?r�r�)r3r5r6r7rB)r�r��
help_commands�print_commandsr�rNr�rarrKrIr�) rnr�r��any_display_options�is_display_option�optionrvrwrs rr�z#Distribution.handle_display_options�s[�� -�,�,�,�,�,�
�� ����!�!�!��"�I�I�I��)�)�D�,�-�-�.�.�.��1�
�����*� -� -�F�+,��f�Q�i�(�(�&� (� (�J�S�#��
(�(�,�,�S�1�1�
(�'��,�,��:���
�v�c�z�:�:�<�<���3�3�3��#�(�(�5�/�/�*�*�*�*��*�*�*��$�)�)�E�*�*�+�+�+�+��%�L�L�L�&'�#��"�"rc��t|dz��|D]c}|j�|��}|s|�|��} |j}n#t
$rd}YnwxYwtd|||fz���ddS)zZPrint a subset of the list of all commands -- used by
'print_commands()'.
�:�(no description available)z
%-*s %sN)r�rLrar�r1�AttributeError)rnr�r��
max_length�cmdr�r1s r�print_command_listzDistribution.print_command_list�s��� �f�s�l����� A� A�C��M�%�%�c�*�*�E��
4��.�.�s�3�3��
;�#�/����!�
;�
;�
;�:����
;����
�,�*�c�;�!?�?�@�@�@�@� A� As� A�A �A c��ddl}|jj}i}|D]}d||<�g}|j���D],}|�|��s|�|���-d}||zD]$}t|��|krt|��}�%|�|d|��|r't��|�|d|��dSdS)anPrint out a help message listing all available commands with a
description of each. The list is divided into "standard commands"
(listed in distutils.command.__all__) and "extra commands"
(mentioned in self.cmdclass, but not a standard command). The
descriptions come from the command class attribute
'description'.
rNr zStandard commandszExtra commands)
�distutils.commandrs�__all__rLr�rar�r�rr�)rnr��std_commands�is_stdr�extra_commandsrs rr�zDistribution.print_commands�s �� !� � � � �(�0����� � �C��F�3�K�K����=�%�%�'�'� +� +�C��:�:�c�?�?�
+��%�%�c�*�*�*���
� �>�1� &� &�C��3�x�x�*�$�$� ��X�X�
������ 3� *� ,� ,� ,�� 0��G�G�G��#�#�N�$4�$.�
0�
0�
0�
0�
0� 0� 0rc��ddl}|jj}i}|D]}d||<�g}|j���D],}|�|��s|�|���-g}||zD]e}|j�|��}|s|�|��} |j}n#t$rd}YnwxYw|�||f���f|S)a>Get a list of (command, description) tuples.
The list is divided into "standard commands" (listed in
distutils.command.__all__) and "extra commands" (mentioned in
self.cmdclass, but not a standard command). The descriptions come
from the command class attribute 'description'.
rNr r)
rrsrrLr�rar�r�r1r) rnr�r r
rr�rvr�r1s r�get_command_listzDistribution.get_command_list�s�� !� � � � �(�0����� � �C��F�3�K�K����=�%�%�'�'� +� +�C��:�:�c�?�?�
+��%�%�c�*�*�*��
�� �>�1� *� *�C��M�%�%�c�*�*�E��
4��.�.�s�3�3��
;�#�/����!�
;�
;�
;�:����
;�����I�I�s�K�(�)�)�)�)�� s� B(�(B7�6B7c���|j}t|t��sD|�d}d�|�d��D��}d|vr|�dd��||_|S)z9Return a list of packages from which commands are loaded.Nr@c�B�g|]}|dk�|�����S)r@r�)r;�pkgs rr=z5Distribution.get_command_packages.<locals>.<listcomp>!s%��H�H�H�C�c�R�i�i�C�I�I�K�K�i�i�irr�zdistutils.commandr)rMrrr��insert)rn�pkgss r�get_command_packagesz!Distribution.get_command_packagessp���$���$��%�%� )��|���H�H�4�:�:�c�?�?�H�H�H�D�"�$�.�.����A�2�3�3�3�$(�D�!��rc��|j�|��}|r|S|���D]�}|�d|��}|} t|��tj|}n#t$rY�:wxYw t||��}n'#t$rtd|�d|�d|�d����wxYw||j|<|cStd|z���)aoReturn the class that implements the Distutils command named by
'command'. First we check the 'cmdclass' dictionary; if the
command is mentioned there, we fetch the class object from the
dictionary and return it. Otherwise we load the command module
("distutils.command." + command) and fetch the command class from
the module. The loaded class is also stored in 'cmdclass'
to speed future calls to 'get_command_class()'.
Raises DistutilsModuleError if the expected module could not be
found, or if that module does not define the expected class.
�.zinvalid command 'z
' (no class 'z
' in module 'z')zinvalid command '%s')
rLrar�
__import__rfr��ImportErrorrKrr�)rnrsr��pkgname�module_name�
klass_name�modules rr�zDistribution.get_command_class's ���
�!�!�'�*�*��� ��L��0�0�2�2� � �G�%,�W�W�g�g�6�K� �J�
��;�'�'�'���[�1�����
�
�
���
����
:���
�3�3����!�
:�
:�
:�*�*��w�w�
�
�
�K�K�K�9�:�:�:�
:����
&+�D�M�'�"��L�L�L�"�#9�G�#C�D�D�Ds�!A!�!
A.�-A.�2B�$B'c�L�|j�|��}|s�|r�tr|�d|z��|�|��}||��x}|j|<d|j|<|j�|��}|r|�||��|S)aReturn the command object for 'command'. Normally this object
is cached on a previous call to 'get_command_obj()'; if no command
object for 'command' is in the cache, then we either create and
return it (if 'create' is true) or return None.
z<Distribution.get_command_obj(): creating '%s' command objectr)r_rarr�r�r`rP�_set_command_options)rnrs�create�cmd_objr�rAs r�get_command_objzDistribution.get_command_objMs����"�&�&�w�/�/��� <�6� <��
H��
�
�=�?F�G�H�H�H��*�*�7�3�3�E�27�%��+�+�=�G�d�&�w�/�%&�D�M�'�"��*�.�.�w�7�7�G��
<��)�)�'�7�;�;�;��rc
�*�|���}|�|�|��}tr|�d|z��|���D�]2\}\}}tr|�d|�d|�d|�d��� d�|jD��}n#t$rg}YnwxYw |j}n#t$ri}YnwxYw t|t��} ||vr(| r&t|||t|����n`||vr!| rt||t|����n;t||��rt|||��ntd|�d |�d
|�d������#t$r}
t|
���d}
~
wwxYwdS)aySet 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').
Nz# setting options for '%s' command:z z = z (from �)c�,�g|]}t|����Sr�r:)r;�os rr=z5Distribution._set_command_options.<locals>.<listcomp>|s6��C�C�C�!"�/�q�1�1�C�C�Crz error in z: command 'z' has no such option 'r)�get_command_namercrr�rb�boolean_optionsrr�rrrGrrir�r�)rnr_�option_dict�command_namer��sourcer� bool_opts�neg_opt� is_stringrs rrz!Distribution._set_command_optionshs7��#�3�3�5�5�����.�.�|�<�<�K�� P��M�M�?�,�N�O�O�O�)4�):�):�)<�)<� 0� 0�%�V�_�f�e��
B��
�
�
�������9?���A�B�B�B�
�C�C�&1�&A�C�C�C� � ��!�
�
�
�� � � �
����
�%�2����!�
�
�
�����
����
0�&�u�c�2�2� ��W�$�$��$��K����i��>N�>N�:N�O�O�O�O��y�(�(�Y�(��K���5�1A�1A�B�B�B�B��[�&�1�1�:��K���7�7�7�7�.�.�!�6�6�<�<�<����9�:�:�:����
0�
0�
0�*�3�/�/�/�����
0����5 0� 0s=�B!�!B0�/B0�4B<�<C�
C�B!E2�2
F�<F�Frc�n�ddlm}t||��s|}|�|��}n|���}|js|S|���d|_d|j|<|�|��|r-|� ��D]}|�
||���|S)a�Reinitializes a command to the state it was in when first
returned by 'get_command_obj()': ie., initialized but not yet
finalized. This provides the opportunity to sneak option
values in programmatically, overriding or supplementing
user-supplied values from the config files and command line.
You'll have to re-finalize the command object (by calling
'finalize_options()' or 'ensure_finalized()') before using it for
real.
'command' should be a command name (string) or command object. If
'reinit_subcommands' is true, also reinitializes the command's
sub-commands, as declared by the 'sub_commands' class attribute (if
it has one). See the "install" command for an example. Only
reinitializes the sub-commands that actually matter, ie. those
whose test predicates return true.
Returns the reinitialized command object.
rr�)r�r�rr!r&� finalized�initialize_optionsr`r�get_sub_commands�reinitialize_command)rnrs�reinit_subcommandsr�r)�subs rr2z!Distribution.reinitialize_command�s���& *�)�)�)�)�)��'�7�+�+� 6�"�L��*�*�<�8�8�G�G�"�3�3�5�5�L�� � ��N��"�"�$�$�$����&'��
�l�#��!�!�'�*�*�*�� C��/�/�1�1�
C�
C���)�)�#�/A�B�B�B�B��rc�0�tj||��dS�Nr
)rnr�levels rr�zDistribution.announce�s�����s�����rc�D�|jD]}|�|���dS)z�Run each command that was seen on the setup script command line.
Uses the list of commands found and cache of command objects
created by 'get_command_obj()'.
N)r��run_command)rnrs r�run_commandszDistribution.run_commands�s6��
�=� "� "�C����S�!�!�!�!� "� "rc��|j�|��rdStjd|��|�|��}|���|���d|j|<dS)a�Do whatever it takes to run a command (including nothing at all,
if the command has already been run). Specifically: if we have
already created and run the command named by 'command', return
silently without doing anything. If the command named by 'command'
doesn't even have a command object yet, create one. Then invoke
'run()' on that command object (or an existing one).
Nz
running %sr )r`rar�infor!�ensure_finalized�run)rnrsr s rr9zDistribution.run_command�sw���=���W�%�%� ��F����w�'�'�'��&�&�w�/�/��� � �"�"�"����
�
�
�!"��
�g���rc�D�t|jp|jpg��dkS�Nr)r�rRrUr�s r�has_pure_moduleszDistribution.has_pure_modules�s#���4�=�9�D�O�9�r�:�:�Q�>�>rc�@�|jot|j��dkSr@)rXr�r�s r�has_ext_moduleszDistribution.has_ext_modules�s ����=�C��(8�$9�$9�A�$=�=rc�@�|jot|j��dkSr@)rVr�r�s r�has_c_librarieszDistribution.has_c_libraries�s���~�9�#�d�n�"5�"5��"9�9rc�R�|���p|���Sr6)rArCr�s r�has_moduleszDistribution.has_modules�s%���$�$�&�&�@�$�*>�*>�*@�*@�@rc�@�|jot|j��dkSr@)rWr�r�s r�has_headerszDistribution.has_headers�����|�5��D�L� 1� 1�A� 5�5rc�@�|jot|j��dkSr@)r\r�r�s r�has_scriptszDistribution.has_scripts�rJrc�@�|jot|j��dkSr@)r]r�r�s r�has_data_fileszDistribution.has_data_files�s����;�3�t��#7�#7�!�#;�;rc�~�|���o)|���o|���Sr6)rArCrEr�s r�is_purezDistribution.is_pure�sD���%�%�'�'�+��(�(�*�*�*�+��(�(�*�*�*� ,rr6)NNr@)r r9))r�
__module__�__qualname__�__doc__r�r�r�rFr�rzrcr�r�r�r�r�r�rmr�r�rr�rrr�r!rr2r�INFOr�r:r9rArCrErGrIrLrNrPr�rrrr,s���������*���N��L�+
�+
�+
�O�XN�M�_�M�M�M���Y�'�L�\ �\ �\ �\ �| � � �8�8�8�8�8.�.�.�`64�64�64�64�tA�A�A�F � � �Y�Y�Y�v4�4�4�12�1��0+�0+�0+�0+�d&#�&#�&#�PA�A�A�"0�0�0�B���D
�
�
�$E�$E�$E�L����6*0�*0�*0�*0�X%�%�%�%�R#&�(�����"�"�"�#�#�#�(?�?�?�>�>�>�:�:�:�A�A�A�6�6�6�6�6�6�<�<�<�,�,�,�,�,rrc���eZdZdZdZd#d�Zd�Zd�Zd�Zd�Z d �Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�ZeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$dS)$rHz]Dummy class to hold the distribution meta-data: name, version,
author, and so forth.
)r&r'r*�author_emailr,�maintainer_emailr.r/r1�long_descriptionr4r2r)r-�
contact_emailr3�download_urlr5r6r7Nc�@�|�$|�t|����dSd|_d|_d|_d|_d|_d|_d|_d|_ d|_
d|_d|_d|_
d|_d|_d|_d|_d|_dSr6)�
read_pkg_file�openr&r'r*rVr,rWr.r/r1rXr4r2r3rZr5r6r7)rnr�s rrzzDistributionMetadata.__init__
s��������t�D�z�z�*�*�*�*�*��D�I��D�L��D�K� $�D��"�D�O�$(�D�!��D�H��D�L�#�D��$(�D�!� �D�M�!�D�N�#�D�� $�D�� �D�M� �D�M�!�D�N�N�Nrc����t|����fd�}�fd�}�d}|d��|_|d��|_|d��|_|d��|_d|_|d ��|_d|_|d
��|_|d��|_ d�vr|d��|_
nd|_
|d
��|_|d��|_d�vr#|d���d��|_
|d��|_|d��|_|dkr2|d��|_|d��|_|d��|_dSd|_d|_d|_dS)z-Reads the metadata values from a file object.c�(���|}|dkrdS|S�N�UNKNOWNr�)r&rrs �r�_read_fieldz7DistributionMetadata.read_pkg_file.<locals>._read_field(s!�����I�E�� �!�!��t��Lrc�D����|d��}|gkrdS|Sr6)�get_all)r&�valuesrs �r�
_read_listz6DistributionMetadata.read_pkg_file.<locals>._read_list.s)����[�[��t�,�,�F���|�|��t��Mrzmetadata-versionr&r'�summaryr*Nr+z home-pager/zdownload-urlr1r4r��platform�
classifier�1.1r6r5r7)rr&r'r1r*r,rVrWr.r/rZrXr�r4r2r3r6r5r7)rn�filerbrf�metadata_versionrs @rr\z"DistributionMetadata.read_pkg_file$s������%�%�� � � � � � � � � � ��1�2���K��'�'�� �"�{�9�-�-���&�;�y�1�1���!�k�(�+�+������'�K��7�7��� $����;�{�+�+���"�{�9�-�-����S� � � +��N� ;� ;�D��� $�D�� +��M� :� :���&�;�y�1�1�������'�K�
�3�3�9�9�#�>�>�D�M�#��J�/�/���%�:�l�3�3����u�$�$�&�J�z�2�2�D�M�&�J�z�2�2�D�M�'�Z��4�4�D�N�N�N� �D�M� �D�M�!�D�N�N�Nrc���ttj�|d��dd���5}|�|��ddd��dS#1swxYwYdS)z7Write the PKG-INFO file into the release tree.
zPKG-INFO�wzUTF-8)�encodingN)r]r�r�r��write_pkg_file)rn�base_dir�pkg_infos r�write_pkg_infoz#DistributionMetadata.write_pkg_infoXs����"�'�,�,�x��4�4�c�"�$�$�$� *�'/�����)�)�)� *� *� *� *� *� *� *� *� *� *� *� *���� *� *� *� *� *� *s�A�A�Ac��d}|js|js|js|js|jrd}|�d|z��|�d|���z��|�d|���z��|�d|���z��|�d|� ��z��|�d|�
��z��|�d |���z��|�d
|���z��|jr|�d|jz��t|�����}|�d|z��d
�|�����}|r|�d|z��|�|d|�����|�|d|�����|�|d|�����|�|d|�����|�|d|�����dS)z9Write the PKG-INFO format data to a file object.
z1.0rjzMetadata-Version: %s
z Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
r�z
Keywords: %s
�Platform�
Classifier�Requires�Provides� ObsoletesN)r5r6r7r3rZrh�get_name�get_version�get_description�get_url�get_contact�get_contact_email�get_licenser �get_long_descriptionr��get_keywords�_write_list�
get_platforms�get_classifiers�get_requires�get_provides�
get_obsoletes)rnrkr'� long_descr4s rrpz#DistributionMetadata.write_pkg_file_s������M� �T�]� �d�n� �� � �$(�$5� ��G��
�
�+�g�5�6�6�6��
�
�<�$�-�-�/�/�1�2�2�2��
�
�?�T�%5�%5�%7�%7�7�8�8�8��
�
�?�T�%9�%9�%;�%;�;�<�<�<��
�
�$�t�|�|�~�~�5�6�6�6��
�
�>�D�$4�$4�$6�$6�6�7�7�7��
�
�'�$�*@�*@�*B�*B�B�C�C�C��
�
�?�T�%5�%5�%7�%7�7�8�8�8��� A��J�J�+�d�.?�?�@�@�@�!�$�";�";�"=�"=�>�>� ��
�
�&��2�3�3�3��8�8�D�-�-�/�/�0�0��� 4��J�J�'�(�2�3�3�3�����z�4�+=�+=�+?�+?�@�@�@�����|�T�-A�-A�-C�-C�D�D�D�
����z�4�+<�+<�+>�+>�?�?�?�����z�4�+<�+<�+>�+>�?�?�?�����{�D�,>�,>�,@�,@�A�A�A�A�Arc�F�|D]}|�|�d|�d����dS)Nz: rB)rh)rnrkr&rers rr�z DistributionMetadata._write_list�s=��� 3� 3�E��J�J�T�T�T�5�5�5�1�2�2�2�2� 3� 3rc��|jpdSr`)r&r�s rrzzDistributionMetadata.get_name�s���y�%�I�%rc��|jpdS)Nz0.0.0)r'r�s rr{z DistributionMetadata.get_version�s���|�&�w�&rc�X�|����d|�����S)NrD)rzr{r�s r�get_fullnamez!DistributionMetadata.get_fullname�s(���-�-�/�/�/�/�4�+;�+;�+=�+=�+=�>�>rc��|jpdSr`)r*r�s r�
get_authorzDistributionMetadata.get_author�s���{�'�i�'rc��|jpdSr`)rVr�s r�get_author_emailz%DistributionMetadata.get_author_email����� �-�I�-rc��|jpdSr`)r,r�s r�get_maintainerz#DistributionMetadata.get_maintainer�s����+�)�+rc��|jpdSr`)rWr�s r�get_maintainer_emailz)DistributionMetadata.get_maintainer_email�����$�1� �1rc�"�|jp|jpdSr`)r,r*r�s rr~z DistributionMetadata.get_contact�s����:�$�+�:��:rc�"�|jp|jpdSr`)rWrVr�s rrz&DistributionMetadata.get_contact_email�s���$�F��(9�F�Y�Frc��|jpdSr`)r.r�s rr}zDistributionMetadata.get_url�s���x�$�9�$rc��|jpdSr`)r/r�s rr�z DistributionMetadata.get_license�s���|�(�y�(rc��|jpdSr`)r1r�s rr|z$DistributionMetadata.get_description�s����,�9�,rc��|jpdSr`)rXr�s rr�z)DistributionMetadata.get_long_description�r�rc��|jpgSr6)r4r�s rr�z!DistributionMetadata.get_keywords�����}�"��"rc�0�t|d��|_dS)Nr4)rr4�rnrs r�set_keywordsz!DistributionMetadata.set_keywords�s��$�U�J�7�7��
�
�
rc��|jpdgSr`)r2r�s rr�z"DistributionMetadata.get_platforms�s���~�,�)��,rc�0�t|d��|_dS)Nr2)rr2r�s r�
set_platformsz"DistributionMetadata.set_platforms�s��%�e�[�9�9����rc��|jpgSr6)r3r�s rr�z$DistributionMetadata.get_classifiers�s����%�2�%rc�0�t|d��|_dS)Nr3)rr3r�s r�set_classifiersz$DistributionMetadata.set_classifiers�s��'��}�=�=����rc��|jpdSr`)rZr�s r�get_download_urlz%DistributionMetadata.get_download_url�r�rc��|jpgSr6)r6r�s rr�z!DistributionMetadata.get_requires�r�rc�t�ddl}|D]}|j�|���t|��|_dSr@)�distutils.versionpredicate�versionpredicate�VersionPredicaterr6�rnrr�rs r�set_requiresz!DistributionMetadata.set_requires�sH��)�)�)�)�� ;� ;�A��&�7�7��:�:�:�:��U����
�
�
rc��|jpgSr6)r5r�s rr�z!DistributionMetadata.get_provides�r�rc�r�d�|D��}|D] }ddl}|j�|���!||_dS)Nc�6�g|]}|�����Sr�r�)r;rs rr=z5DistributionMetadata.set_provides.<locals>.<listcomp>�s ��*�*�*�q������*�*�*rr)r�r��split_provisionr5)rnrrr�s r�set_providesz!DistributionMetadata.set_provides�sU��*�*�E�*�*�*��� :� :�A�-�-�-�-��&�6�6�q�9�9�9�9���
�
�
rc��|jpgSr6)r7r�s rr�z"DistributionMetadata.get_obsoletes�s���~�#��#rc�t�ddl}|D]}|j�|���t|��|_dSr@)r�r�r�rr7r�s r�
set_obsoletesz"DistributionMetadata.set_obsoletes�sH��)�)�)�)�� ;� ;�A��&�7�7��:�:�:�:��e������rr6)%rrQrRrSrJrzr\rsrpr�rzr{r�r�r�r�r�r~rr}r��get_licencer|r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrHrH�s ����������"�"�"�"�.2"�2"�2"�h*�*�*� B� B� B�D3�3�3�&�&�&�'�'�'�?�?�?�(�(�(�.�.�.�,�,�,�2�2�2�;�;�;�G�G�G�%�%�%�)�)�)��K�-�-�-�2�2�2�#�#�#�8�8�8�-�-�-�:�:�:�&�&�&�>�>�>�.�.�.�#�#�#�$�$�$�#�#�#����$�$�$�%�%�%�%�%rrHc�N�g}|D]}|�|dd���� |S)zConvert a 4-tuple 'help_options' list as found in various command
classes to the 3-tuple form required by FancyGetopt.
r�)r�)rA�new_options�
help_tuples rr�r��s=���K��,�,�
����:�a��c�?�+�+�+�+��r)rSrfr��re�emailrrdr�distutils.errors�distutils.fancy_getoptrr�distutils.utilrrr r�r�distutils.debugr�compiler�rrrHr�r�rr�<module>r�sx�����
�
�
� � � � � � � � �#�#�#�#�#�#���O�O�O�O�������H�H�H���������A�A�A�A�A�A�A�A�B�B�B�B�B�B�B�B�B�B�������!�!�!�!�!�!��R�Z�4�
5�
5�
����J,�J,�J,�J,�J,�J,�J,�J,�f`%�`%�`%�`%�`%�`%�`%�`%�D����s��%�%
?>