HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1991111/root/usr/lib/python3/dist-packages/pbr/__pycache__/
Upload File :
Current File : //proc/1991111/root/usr/lib/python3/dist-packages/pbr/__pycache__/packaging.cpython-311.pyc
�

㦧b�z��@�dZddlmZddlmZddlmZ	ddlm	Z	n#e
$r	ddl	m	Z	YnwxYwddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlmZddlmZdd	lmZddlmZdd
lmZddlmZddlmZdd
lmZddlmZddlZddlmZddlmZdZ d�dD��Z!dZ"d�Z#d�Z$d�Z%d�Z&d�Z'dEd�Z(dFd�Z)Gd�dej��Z*Gd�d ej��Z+Gd!�d"ej,��Z-Gd#�d$ej.��Z/Gd%�d&ej.��Z0d'�Z1	dd(l2m3Z3Gd)�d*e3j4��Z5d+Z6n
#e
$rdZ6YnwxYwd,�Z7d-Z8d.Z9e9e9e8d/�Z:d0�Z;e
j<�=ej>��fd1�Z?Gd2�d3ej��Z@Gd4�d5ej��ZAGd6�d7ejB��ZCGd8�d9ej��ZDd:�ZEGd;�d<ej��ZF	dd=lmGZGd+ZHeGjIZIn#e
$rdZHdZIYnwxYwd>�ZJd?�ZKd@�ZLdA�ZMdFdB�ZNdC�ZOdFdD�ZPejQjRZRdS)Gz4
Utilities with minimum-depends for use in setup.py
�)�unicode_literals)�install)�log)�urlparseN)�develop)�easy_install)�egg_info)�install_scripts)�sdist)�extra_files)�git)�options)�
testr_command)�version)zrequirements.txtztools/pip-requiresc�8�g|]}|tjdz��S)r)�sys�version_info)�.0�xs  �//usr/lib/python3/dist-packages/pbr/packaging.py�
<listcomp>r;s1��9�9�9�Q��S�-�a�0�0�9�9�9�)zrequirements-py%d.txtztools/pip-requires-py%d)ztest-requirements.txtztools/test-requiresc���tj�d��}|r,td�|�d��D����St
t
t��zS)N�PBR_REQUIREMENTS_FILESc3�>K�|]}|���V��dS�N��strip�r�fs  r�	<genexpr>z)get_requirements_files.<locals>.<genexpr>Cs*����9�9�1�Q�W�W�Y�Y�9�9�9�9�9�9r�,)�os�environ�get�tuple�split�PY_REQUIREMENTS_FILES�list�REQUIREMENTS_FILES)�filess r�get_requirements_filesr,@s]���J�N�N�3�4�4�E��:��9�9����C�(8�(8�9�9�9�9�9�9�!�4�(:�#;�#;�;�;rc��g}|�|d��}|r|�|��|�|��d�|��||<dS)z5Append a 
 separated list to possibly existing value.��
N)r%�append�extend�join)�config�key�	text_list�	new_value�
current_values     r�append_text_listr8Lsc���I��J�J�s�B�'�'�M��(�����'�'�'�
���Y�����)�)�I�&�&�F�3�K�K�Krc��d�|D��S)Nc�P�g|]#}tj�|���!|��$S�)r#�path�existsrs  rrz!_any_existing.<locals>.<listcomp>Ws+��6�6�6�!�B�G�N�N�1�$5�$5�6�A�6�6�6rr;)�	file_lists r�
_any_existingr?Vs��6�6�y�6�6�6�6rc�>�t|��}d�|D��}|rtjd|zt��d�|D��}|D]S}t	|d��5}|����d��cddd��cS#1swxYwY�TgS)Nc�$�g|]
}|tv�|��Sr;�r(rs  rrz'get_reqs_from_files.<locals>.<listcomp>_s#��D�D�D���.C�)C�)C�!�)C�)C�)Crz�Support for '-pyN'-suffixed requirements files is removed in pbr 5.0 and these files are now ignored. Use environment markers instead. Conflicting files: %rc�$�g|]
}|tv�|��Sr;rBrs  rrz'get_reqs_from_files.<locals>.<listcomp>gs#��F�F�F�a�q�0E�'E�'E��'E�'E�'Er�rr/)r?�warnings�warn�DeprecationWarning�open�readr')�requirements_files�existing�
deprecated�requirements_file�fils     r�get_reqs_from_filesrO[s���/�0�0�H�E�D�X�D�D�D�J��*��
��(�(�)�		*�	*�	*�G�F�8�F�F�F�H�%�*�*��
�#�S�
)�
)�	*�S��8�8�:�:�#�#�D�)�)�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*�	*��Is�'B�B	�B	c�^�tjdd|���d��S)Na�(?P<PackageName>[\w.-]+)-(?P<GlobalVersion>(?P<VersionTripple>(?P<Major>0|[1-9][0-9]*)\.(?P<Minor>0|[1-9][0-9]*)\.(?P<Patch>0|[1-9][0-9]*)){1}(?P<Tags>(?:\-(?P<Prerelease>(?:(?=[0]{1}[0-9A-Za-z-]{0})(?:[0]{1})|(?=[1-9]{1}[0-9]*[A-Za-z]{0})(?:[0-9]+)|(?=[0-9]*[A-Za-z-]+[0-9A-Za-z-]*)(?:[0-9A-Za-z-]+)){1}(?:\.(?=[0]{1}[0-9A-Za-z-]{0})(?:[0]{1})|\.(?=[1-9]{1}[0-9]*[A-Za-z]{0})(?:[0-9]+)|\.(?=[0-9]*[A-Za-z-]+[0-9A-Za-z-]*)(?:[0-9A-Za-z-]+))*){1}){0,1}(?:\+(?P<Meta>(?:[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))){0,1}))z"\g<PackageName>>=\g<GlobalVersion>���)�re�sub�groups)�matchs r�egg_fragmentrVos1��
�6�M�8��,�,�.�.��$�!&�&�&rFc���|�t��}g}t|��D�]�}|���r|�d��r�-t	jd|��r�C|�d��r1|�d��d}|t|g|���z
}��	tj	�
|��j}n#t$rd}YnwxYwt	jd|��r*t	jd|��}|�
d	��}t|��}|jr!t	jd
t"|j��}nt	jd|��rd}d}|�Vt	jd
d|��}|r'|�d��}	|	dkrd}	|d|	�}|�|�����t+jd|�d|�������|S)N�#z5^\s*(-i|--index-url|--extra-index-url|--find-links).*z-r� �)�
strip_markersz\s*-e\s+z
\s*-e\s+(.*)$�zegg=([^&]+).*$z\s*-f\s+zIndex Locationz#.*$r.�;rz[pbr] Excluding z: )r,rOr�
startswithrRrU�	partition�parse_requirements�
pkg_resources�Requirement�parse�project_name�
ValueError�groupr�schemerSrV�fragment�findr0r�info)
rJr[�requirements�line�req_filerd�extract�egg�reason�semi_poss
          rr`r`�s)���!�3�5�5���L�#�$6�7�7�8C�8C���
�
���	�����!5�!5�	���8�L����	���?�?�4� � �	��~�~�c�*�*�1�-�H��.��
�-�9�9�9�
9�L��	 �(�4�:�:�4�@�@�M�L�L���	 �	 �	 ��L�L�L�	 ���� �8�K��&�&�	$��h�/��6�6�G��=�=��#�#�D��t�n�n���:�	&��6�+�\�3�<�H�H�D�D�
�X�k�4�
(�
(�	&��D�%�F����6�&�"�d�+�+�D��
'��9�9�S�>�>���a�<�<�#�H��I�X�I�������%�%�%�%��H�H�,8�L�L�&�&�A�
C�
C�
C�
C��s�,$C�C �C c�L�|�t��}g}t|��D]�}tjd|��r�tjd|��r*|�tjdd|�����Wtjd|��r|�|����|S)Nz
(\s*#)|(\s*$)z\s*-[ef]\s+r.z+^\s*(https?|git(\+(https|ssh))?|svn|hg)\S*:)r,rOrRrUr0rS)rJ�dependency_linksrls   r�parse_dependency_linksrt�s����!�3�5�5����$�$6�7�7�	*�	*��
�8�$�d�+�+�	��
�8�N�D�)�)�	*��#�#�B�F�>�2�t�$D�$D�E�E�E�E�
�X�D�d�
K�
K�	*��#�#�D�)�)�)���rc��eZdZdZdZd�ZdS)�InstallWithGitz�Extracts ChangeLog and AUTHORS from git then installs.

    This is useful for e.g. readthedocs where the package is
    installed and then docs built.
    rc�h�t|j��tj�|��Sr)�	_from_git�distributionr�run��selfs rrzzInstallWithGit.run�s)���$�#�$�$�$���"�"�4�(�(�(rN��__name__�
__module__�__qualname__�__doc__�command_namerzr;rrrvrv�s4���������L�)�)�)�)�)rrvc��eZdZdZdZd�ZdS)�LocalInstallz�Runs python setup.py install in a sensible manner.

    Force a non-egg installed in the manner of
    single-version-externally-managed, which allows us to install manpages
    and config files.
    rc�h�t|j��tj�|��Sr)rxry�
du_installrrzr{s rrzzLocalInstall.run�s*���$�#�$�$�$��!�%�%�d�+�+�+rNr}r;rrr�r��s4���������L�,�,�,�,�,rr�c� �eZdZdZdZdZd�ZdS)�	TestrTestz&Make setup.py test do the right thing.�testz&DEPRECATED: Run unit tests using testrc�x�tjdt��tj�|��dS)Nzytestr integration is deprecated in pbr 4.2 and will be removed in a future release. Please call your test runner directly)rErFrGr�Testrrzr{s rrzz
TestrTest.run�s?���
�(�)�	*�	*�	*�	�����%�%�%�%�%rN�r~rr�r�r��descriptionrzr;rrr�r��s3������0�0��L�:�K�&�&�&�&�&rr�c�0�eZdZdZeZgZdZd�Zd�Zd�Z	dS)�LocalRPMVersionz:Output the rpm *compatible* version string of this package�rpm_versionc���tjd��|j���}t	tj|����������dS)Nz[pbr] Extracting rpm version)	rrjry�get_name�printr�VersionInfo�semantic_version�
rpm_string�r|�names  rrzzLocalRPMVersion.run
s^����/�0�0�0�� �)�)�+�+��
�g�!�$�'�'�8�8�:�:�E�E�G�G�H�H�H�H�Hrc��dSrr;r{s r�initialize_optionsz"LocalRPMVersion.initialize_options����rc��dSrr;r{s r�finalize_optionsz LocalRPMVersion.finalize_optionsr�rN�
r~rr�r�r��user_optionsr�rzr�r�r;rrr�r�sX������N�G��K��L� �L�I�I�I�

�
�
�
�
�
�
�
rr�c�0�eZdZdZeZgZdZd�Zd�Zd�Z	dS)�LocalDebVersionz:Output the deb *compatible* version string of this package�deb_versionc���tjd��|j���}t	tj|����������dS)Nz[pbr] Extracting deb version)	rrjryr�r�rr�r��
debian_stringr�s  rrzzLocalDebVersion.run s^����/�0�0�0�� �)�)�+�+��
�g�!�$�'�'�8�8�:�:�H�H�J�J�K�K�K�K�Krc��dSrr;r{s rr�z"LocalDebVersion.initialize_options%r�rc��dSrr;r{s rr�z LocalDebVersion.finalize_options(r�rNr�r;rrr�r�sX������N�G��K��L� �L�L�L�L�

�
�
�
�
�
�
�
rr�c��tjSr)r�
have_testrr;rrr�r�,s���#�#r)�commandsc� �eZdZdZdZdZd�ZdS)�NoseTestz)Fallback test runner if testr is a no-go.r�z%DEPRECATED: Run unit tests using nosec�x�tjdt��tj�|��dS)Nzpnose integration in pbr is deprecated. Please use the native nose setuptools configuration or call nose directly)rErFrGr��	nosetestsrzr{s rrzzNoseTest.run9s?���M�*�-�
.�
.�
.�
��"�"�4�(�(�(�(�(rNr�r;rrr�r�3s3������7�7���=��	)�	)�	)�	)�	)rr�Tc��tSr)�
_have_noser;rr�	have_noser�Hs���ra#PBR Generated from %(group)r

import threading

from %(module_name)s import %(import_target)s

if __name__ == "__main__":
    import argparse
    import socket
    import sys
    import wsgiref.simple_server as wss

    parser = argparse.ArgumentParser(
        description=%(import_target)s.__doc__,
        formatter_class=argparse.ArgumentDefaultsHelpFormatter,
        usage='%%(prog)s [-h] [--port PORT] [--host IP] -- [passed options]')
    parser.add_argument('--port', '-p', type=int, default=8000,
                        help='TCP port to listen on')
    parser.add_argument('--host', '-b', default='',
                        help='IP to bind the server to')
    parser.add_argument('args',
                        nargs=argparse.REMAINDER,
                        metavar='-- [passed options]',
                        help="'--' is the separator of the arguments used "
                        "to start the WSGI server and the arguments passed "
                        "to the WSGI application.")
    args = parser.parse_args()
    if args.args:
        if args.args[0] == '--':
            args.args.pop(0)
        else:
            parser.error("unrecognized arguments: %%s" %% ' '.join(args.args))
    sys.argv[1:] = args.args
    server = wss.make_server(args.host, args.port, %(invoke_target)s())

    print("*" * 80)
    print("STARTING test server %(module_name)s.%(invoke_target)s")
    url = "http://%%s:%%d/" %% (server.server_name, server.server_port)
    print("Available at %%s" %% url)
    print("DANGER! For testing only, do not use in production")
    print("*" * 80)
    sys.stdout.flush()

    server.serve_forever()
else:
    application = None
    app_lock = threading.Lock()

    with app_lock:
        if application is None:
            application = %(invoke_target)s()

z�# PBR Generated from %(group)r

import sys

from %(module_name)s import %(import_target)s


if __name__ == "__main__":
    sys.exit(%(invoke_target)s())
)�console_scripts�gui_scripts�wsgi_scriptsc	���|jrt|j��dkrtd���|t||j|jdd�|j�����z}||zS)a`Generate the script based on the template.

    :param str group:
        The entry-point group name, e.g., "console_scripts".
    :param str header:
        The first line of the script, e.g., "!#/usr/bin/env python".
    :param str template:
        The script template.
    :returns:
        The templated script content
    :rtype:
        str
    rZzBScript targets must be of the form 'func' or 'Class.class_method'.r�.)rf�module_name�
import_target�
invoke_target)�attrs�lenre�dictr�r2)rf�entry_point�header�template�script_texts     r�generate_scriptr��s�����<��K�$5� 6� 6�� :� :��;�<�<�	<��T���+�!�'��*��h�h�{�0�1�1�	����K��K��rc	#�\K�	tj�d|��}n%#t$rtjd|��}YnwxYwt
���D]H\}}|�|�����D]\}}|t||||��fV���IdS)z$Override entrypoints console_script.r.N)	r�ScriptWriter�
get_header�AttributeError�get_script_header�ENTRY_POINTS_MAP�items�
get_entry_mapr�)�dist�
executabler�rfr�r��eps       r�override_get_script_argsr��s�����@��*�5�5�b�*�E�E�����@�@�@��/��J�?�?����@����+�1�1�3�3�G�G���x��*�*�5�1�1�7�7�9�9�	G�	G�H�D�"�����F�H�E�E�F�F�F�F�F�	G�G�Gs� %�A�Ac��eZdZdZd�ZdS)�LocalDeveloprc��tjdkr tj�||��S|jst|��D]}|j|��
dSdS)N�win32)r�platformr�install_wrapper_scripts�exclude_scriptsr��write_script)r|r��argss   rr�z$LocalDevelop.install_wrapper_scripts�sp���<�7�"�"��?�:�:�4��F�F�F��#�	)�0��6�6�
)�
)��!��!�4�(�(�(�	)�	)�
)�
)rN)r~rr�r�r�r;rrr�r��s(�������L�)�)�)�)�)rr�c�"�eZdZdZdZd�Zd�ZdS)�LocalInstallScriptsz(Intercepts console scripts entry_points.r
c�X�	tj�d|��}n%#t$rtjd|��}YnwxYwt
d}|�d�����D]-\}}td|||��}|�	||���.dS)Nr.r�)
rr�r�r�r�r�r�r�r�r�)r|r�r�r��wsgi_script_templater�r��contents        r�_make_wsgi_scripts_onlyz+LocalInstallScripts._make_wsgi_scripts_only�s���	D�!�.�9�9�"�j�I�I�F�F���	D�	D�	D�!�3�B�
�C�C�F�F�F�	D����/��?���*�*�>�:�:�@�@�B�B�	-�	-�H�D�"�%���F�,@�B�B�G����d�G�,�,�,�,�	-�	-s� #�A�Ac��ddl}|�d��|jjr%|jjj�|��ng|_|�d��}tj
|jtj|j|j
��|j|j��}|�d��}t!|dt"j��}d|jjvr|�||��|jrdSt,jdkrt0}nt"j}d|z}|||��D]}|j|��
dS)Nrr	�
build_scriptsr��bdist_wheel�ntz"%s")�!distutils.command.install_scripts�run_commandry�scripts�commandr
rz�outfiles�get_finalized_commandra�Distribution�egg_base�PathMetadatar	�egg_name�egg_version�getattrr�sys_executable�have_runr��no_epr#r�r��get_script_argsr�)r|�	distutils�ei_cmdr��bs_cmdr�r�r�s        rrzzLocalInstallScripts.run�sc��0�0�0�0�����$�$�$���$�	���-�=�A�A�$�G�G�G�G��D�M��+�+�J�7�7���)��O��&�v����H�H��O�V�/�
�
��
�+�+�O�<�<����L�,�"=�?�?�
��D�-�6�6�6�

�(�(��z�:�:�:��:�	�
�F�
�7�d�?�?�6�O�O�*�:�O��*�,�J�#�O�D�*�5�5�	%�	%�D��D��t�$�$�$�	%�	%rN)r~rr�r�r�r�rzr;rrr�r��s=������2�2�$�L�
-�
-�
-�'%�'%�'%�'%�'%rr�c��eZdZdZd�Zd�ZdS)�LocalManifestMakerz?Add any files that are in git and some standard sensible files.c�D�dD]}|j�|���dS)N)zinclude AUTHORSzinclude ChangeLogzexclude .gitignorezexclude .gitreviewzglobal-exclude *.pyc)�filelist�process_template_line)r|�
template_lines  r�_add_pbr_defaultsz$LocalManifestMaker._add_pbr_defaultss8��
�	?�	?�M�
�M�/�/�
�>�>�>�>�	?�	?rc���|j�d��}tj�|��|j�|j��|j�|j��|j�tj
����tj|dd��}|s0tj��}|r|j�|��n8tj�|j��r|���|�d��}|���|j�d|j���dS)a_Add all the default files to self.filelist:

        Extends the functionality provided by distutils to also included
        additional sane defaults, such as the ``AUTHORS`` and ``ChangeLog``
        files generated by *pbr*.

        Warns if (``README`` or ``README.txt``) or ``setup.py`` are missing;
        everything else is optional.
        �pbr�skip_git_sdist�SKIP_GIT_SDISTr	�*)�prefixN)ry�get_option_dictr�add_defaultsr�r0r��manifestr1r�get_extra_filesr�get_boolean_optionr
�_find_git_filesr#r<r=�
read_manifestr�r��include_patternr	)r|�option_dict�should_skip�rcfilesr�s     rrzLocalManifestMaker.add_defaultssB���'�7�7��>�>��
�� � ��&�&�&��
���T�]�+�+�+��
���T�]�+�+�+��
���[�8�:�:�;�;�;��0��>N�1A�C�C���	!��)�+�+�G��
.��
�$�$�W�-�-�-��
�W�^�^�D�M�
*�
*�	!���� � � ��+�+�J�7�7����� � � ��
�%�%�c�&�/�%�B�B�B�B�BrN)r~rr�r�r�rr;rrr�r�s=������I�I�?�?�?�C�C�C�C�Crr�c��eZdZdZdZd�ZdS)�LocalEggInfozAOverride the egg_info command to regenerate SOURCES.txt sensibly.r	c��tj�|jd��}tj�|��r-tj�d��sdt
jvrQtjd��t|j
��}||_|���|j
|_
dStjd��tj��|_
t|d��5}|����d��D]}|j
�|���	ddd��dS#1swxYwYdS)	apGenerate SOURCES.txt only if there isn't one already.

        If we are in an sdist command, then we always want to update
        SOURCES.txt. If we are not in an sdist command, then it doesn't
        matter one flip, and is actually destructive.
        However, if we're in a git context, it's always the right thing to do
        to recreate SOURCES.txt
        zSOURCES.txtz.gitrz[pbr] Processing SOURCES.txtz"[pbr] Reusing existing SOURCES.txtrDr/N)r#r<r2r	r=r�argvrrjr�ryrrzr��FileListrHrIr'r0)r|�manifest_filename�mmrN�entrys     r�find_sourceszLocalEggInfo.find_sources3sn���G�L�L���
�F�F������0�1�1�
	0�����v�&�&�
	0��3�8�#�#��H�3�4�4�4�#�D�$5�6�6�B�+�B�K��F�F�H�H�H��K�D�M�M�M��H�9�:�:�:�$�-�/�/�D�M��'��-�-�
0�� �X�X�Z�Z�-�-�d�3�3�0�0�E��M�(�(��/�/�/�/�0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0����
0�
0�
0�
0�
0�
0s�?AE�E�EN)r~rr�r�r�rr;rrrr.s.������K�K��L�0�0�0�0�0rrc���|�d��}tj��}|rtj|��}tj||���tj|���dS)Nr�)r�	changelog)r)rr
�_iter_log_oneline�_iter_changelog�write_git_changelog�generate_authors)ryrrs   rrxrxMsk���.�.�u�5�5�K��%�'�'�I��3��'�	�2�2�	����y�I�I�I�I���[�1�1�1�1�1�1rc�L�eZdZdZdZd�ZdefgejjzZd�Zd�Z	dS)�
LocalSDistz5Builds the ChangeLog and Authors files from VC first.rc�^�t|d��r|jS|j�d��}t	j|dd��}|r	d|_dS	ddlm}n,#t$rtj
d��d|_YdSwxYw|�|j��\}}}tj
�tj
�|j|j����stj
d	��d|_dS||g|_tj
d
��d|_dS)z�Ensure reno is installed and configured.

        We can't run reno-based commands if reno isn't installed/available, and
        don't want to if the user isn't using it.
        �	_has_renor��	skip_reno�SKIP_GENERATE_RENOFr)�
setup_commandz>[pbr] reno was not found or is too old. Skipping release noteszC[pbr] reno does not appear to be configured. Skipping release notesz[pbr] Generating release notesT)�hasattrrryrrr�renor �ImportErrorrrj�load_configr#r<r=r2�reporoot�	notespath�_files)r|rr	r �conf�output_file�
cache_files       r�
checking_renozLocalSDist.checking_reno[s_���4��%�%�	"��>�!��'�7�7��>�>���0��k�1E�G�G���	�"�D�N��5�	�
+�*�*�*�*�*�*���	�	�	��H�%�
&�
&�
&�"�D�N��5�5�		����)6�(A�(A���)�)�%��k�:��w�~�~�b�g�l�l�4�=�$�.�I�I�J�J�	��H�%�
&�
&�
&�"�D�N��5�"�J�/�����1�2�2�2�����ts�A�%B�B�
build_renoc�l�t|j��tj�|��dSr)rxryrrzr{s rrzzLocalSDist.run�s-���$�#�$�$�$�
���������rc���|���r8|j�|j��|j���t
j�|��dSr)r+r�r1r'�sortr�make_distributionr{s rr0zLocalSDist.make_distribution�s`�������	!��M� � ���-�-�-��M��� � � �
��%�%�d�+�+�+�+�+rN)
r~rr�r�r�r+r�sub_commandsrzr0r;rrrrVsf������?�?��L�(�(�(�T"�=�1�2�U�[�5M�M�L����
,�,�,�,�,rr)�builddocc��tSr)�_have_sphinxr;rr�have_sphinxr5�s���rc��	�
�i�
|r|dz}nd}tjdd|g|��}td���	�	fd�|�d��D��}t	��}|D]4}|�d�|�d	��D�����5�
fd
�}|d|d��|d
|d��|d|d��|d|d��|D]}t
jd|z����
�dd���
S)aCalculate the sort of semver increment needed from git history.

    Every commit from HEAD to tag is consider for Sem-Ver metadata lines.
    See the pbr docs for their syntax.

    :return: a dict of kwargs for passing into SemanticVersion.increment.
    z..HEAD�HEADrz--pretty=%B�sem-ver:c���g|]W}|�������d���;|�d������XS)r8N)�lowerrr^)rrl�
header_lens  �rrz)_get_increment_kwargs.<locals>.<listcomp>�sk���@�@�@�d��:�:�<�<�%�%�'�'�2�2�:�>�>�@��Z�[�[�!�'�'�)�)�@�@�@rr/c�6�g|]}|�����Sr;r)r�symbols  rrz)_get_increment_kwargs.<locals>.<listcomp>�s ��H�H�H�6������H�H�Hrr"c�H��||vrd�|<|�|��dSdS)NT)�discard)r=�symbols�impact�results   �r�_handle_symbolz-_get_increment_kwargs.<locals>._handle_symbol�s7����W���!�F�6�N��O�O�F�#�#�#�#�#��r�bugfix�patch�feature�minor�deprecationz	api-break�majorz[pbr] Unknown Sem-Ver symbol %rN)	r
�_run_git_commandr�r'�set�updaterrj�pop)�git_dir�tag�version_specrr�r@r�rCr=r;rBs         @@r�_get_increment_kwargsrQ�s������F�
���X�~������$�e�]�L�%I�%,�.�.�I��Z���J�@�@�@�@�i�o�o�d�6K�6K�@�@�@�H��e�e�G��J�J�����H�H�W�]�]�3�5G�5G�H�H�H�I�I�I�I�$�$�$�$�$��N�8�W�g�.�.�.��N�9�g�w�/�/�/��N�=�'�7�3�3�3��N�;���1�1�1��=�=����2�V�;�<�<�<�<��J�J�w������Mrc��tj|���}d}t|��D]�\}\}}}t��}t	��}t|��D]L}	tj�|��}|||<|�	|���=#t$rY�IwxYw|r|t|��|fcS��d|fS)z�Return the commit data about the most recent tag.

    We use git-describe to find this out, but if there are no
    tags then we fall back to counting commits since the beginning
    of time.
    )rNrr.)r
r�	enumeraterKr�r)r�SemanticVersion�from_pip_string�add�	Exception�max)	rNr�	row_count�ignored�tag_set�version_tags�
semver_to_tagrO�semvers	         r�_get_revno_and_last_tagr_�s����%�g�6�6�6�I��I�2;�I�2F�2F�?�?�.�	�.�G�W�g��u�u�����
���=�=�	�	�C�
� �0�@�@��E�E��(+�
�f�%�� � ��(�(�(�(���
�
�
���
�����	?� ��\�!2�!2�3�Y�>�>�>�>�	?�
�y�=�s�9B�
B%�$B%c�~�t|��\}}tj�|pd��}|dkr|}n|jdit||����}|�'||kr!t
dt||���z���|dkr|S|�|��}|�|�|��}||kr|S|S)a�Calculate a version from a target version in git_dir.

    This is used for untagged versions only. A new version is calculated as
    necessary based on git metadata - distance to tags, current hash, contents
    of commit messages.

    :param git_dir: The git directory we're working from.
    :param target_version: If None, the last tagged version (or 0 if there are
        no tags yet) is incremented as needed to produce an appropriate target
        version following semver rules. Otherwise target_version is used as a
        constraint - if semver rules would result in a newer version then an
        exception is raised.
    :return: A semver version object.
    �0rNzRgit history requires a target version of %(new)s, but target version is %(target)s)�new�targetr;)	r_rrTrU�	incrementrQrer��to_dev)rN�target_versionrO�distance�last_semver�new_version�new_dev�
target_devs        r�_get_version_from_git_targetrl�s���,�G�4�4�M�C���)�9�9�#�*��E�E�K��1�}�}�!���+�k�+�3�3�#�G�S�1�1�3�3���!�k�N�&B�&B��
$��[��8�8�8�
9�:�:�	:��1�}�}���� � ��*�*�G��!�#�*�*�8�4�4�
��������Nrc��tj��}|r�	tjddg|d����dd��}tj�|��}n4#t$r'|r tj�|��}nd}YnwxYwt||��}|�	��S	t��S#t$rYdSwxYw)	a�Calculate a version string from git.

    If the revision is tagged, return that. Otherwise calculate a semantic
    version description of the tree.

    The number of revisions since the last tag is included in the dev counter
    in the version for untagged versions.

    :param pre_version: If supplied use this as the target version rather than
        inferring one from the last tag + commit messages.
    �describez
--exact-matchT)�throw_on_error�-r�Nr.)r
�_run_git_functionsrJ�replacerrTrUrWrl�release_string�unicode�	NameError)�pre_versionrN�taggedrfrBs     r�_get_version_from_gitrxs���$�&�&�G��'�	&��)��_�-�w�#�%�%�%�%,�W�S�#�%6�%6�
�%�4�D�D�V�L�L�N�N���	&�	&�	&��
&�!(�!8�!H�!H��"!�"!���"&����	&����.�g�~�F�F���$�$�&�&�&���y�y��������r�r����s$�AA$�$.B�B�=
C�
C�Cc�D�ddg}i}|D]f}	t|d��5}tj|��}ddd��n#1swxYwY�@#tttjjf$rY�cwxYw|�dd��|krdS|�dd��S)z�Get the version from package metadata if present.

    This looks for PKG-INFO if present (for sdists), and if not looks
    for METADATA (for wheels) and failing that will return None.
    zPKG-INFO�METADATArDN�Name�Version)rH�email�message_from_file�IOError�OSError�errors�MessageErrorr%)�package_name�pkg_metadata_filenames�pkg_metadata�filename�pkg_metadata_files     r�_get_version_from_pkg_metadatar�1s��)�*�5���L�*����	��h��$�$�
J�(9�$�6�7H�I�I��
J�
J�
J�
J�
J�
J�
J�
J�
J�
J�
J����
J�
J�
J�
J�����%�,�";�<�	�	�	��H�	���������%�%��5�5��t����I�t�,�,�,s1�A	�=�A	�A	�A	�A	�A	�	!A-�,A-c�d�tj�dtj�dd����}|r|St|��}|r|St	|��}t
jddkr|jd��}|r|Std�	|������)	aGet the version of the project.

    First, try getting it from PKG-INFO or METADATA, if it exists. If it does,
    that means we're in a distribution tarball or that install has happened.
    Otherwise, if there is no PKG-INFO or METADATA file, pull the version
    from git.

    We do not support setup.py version sanity in git archive tarballs, nor do
    we support packagers directly sucking our git repo into theirs. We expect
    that a source tarball be made from our git repo - or that if someone wants
    to make a source tarball from a fork of our repo with additional tags in it
    that they understand and desire the results of doing that.

    :param pre_version: The version field from setup.cfg - if set then this
        version will be the next release.
    �PBR_VERSION�OSLO_PACKAGE_VERSIONNrrZzutf-8a(Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name {name} was given, but was not able to be found.)r�)
r#r$r%r�rxrr�encoderW�format)r�rvrs   r�get_versionr�Fs���"�j�n�n��
�
���-�t�4�4�6�6�G�����,�\�:�:�G�����#�K�0�0�G�
����a��� �'�.��)�)������
�<�
=C�F�)�=C�=+�=+�,�,�,r)NFr)Sr��
__future__r�distutils.commandrr�r�r�urllib.parserr#r}�email.errorsr#rRrrEra�
setuptools�setuptools.commandrrr	r
rr�rr
r�pbr.pbr_jsonrrr*r(�TEST_REQUIREMENTS_FILESr,r8r?rOrVr`rtrvr�r�r��Commandr�r�r��noser�r�r�r�r��
_wsgi_text�_script_textr�r�r<�normpathr�r�r�r��manifest_makerr�rrxrr2r4�
LocalBuildDocr5rQr_rlrxr�r��pbr_json�write_pbr_jsonr;rr�<module>r�s��"��(�'�'�'�'�'�3�3�3�3�3�3�������"�%�%�%�%�%�%�%���"�"�"�!�!�!�!�!�!�!�!�"����
��������	�	�	�	�	�	�	�	�
�
�
�
�������������&�&�&�&�&�&�+�+�+�+�+�+�'�'�'�'�'�'�&�&�&�&�&�&�.�.�.�.�.�.�$�$�$�$�$�$�����������������������������������?��9�9�;8�9�9�9��J��	<�	<�	<�'�'�'�7�7�7�
���(&�&�&�(@�@�@�@�F����&)�)�)�)�)�W�_�)�)�)�,�,�,�,�,�7�?�,�,�,�
&�
&�
&�
&�
&�
�#�
&�
&�
&� 
�
�
�
�
�j�(�
�
�
�&
�
�
�
�
�j�(�
�
�
�&$�$�$��������
)�
)�
)�
)�
)�8�%�
)�
)�
)��J�J�������J�J�J��������4�
�l	��$������ � � �6��)�)�#�.�9�9�
G�
G�
G�
G�	)�	)�	)�	)�	)�7�?�	)�	)�	)�7%�7%�7%�7%�7%�/�9�7%�7%�7%�t'C�'C�'C�'C�'C��0�'C�'C�'C�T0�0�0�0�0�8�$�0�0�0�>2�2�2�=,�=,�=,�=,�=,���=,�=,�=,�@��������L��*�M�M�������L��M�M�M�����
���&�&�&�R���0"�"�"�J#�#�#�#�L-�-�-�*(,�(,�(,�(,�^��,���s0��+�+�D:�:E�E�G,�,	G8�7G8