HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/pbr/__pycache__/packaging.cpython-38.pyc
U

jP�^2z�@s<dZddlmZddlmZddlmZzddlm	Z	Wn e
k
rXddl	m	Z	YnXddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlmZddlmZdd	lmZddlmZdd
lmZddlmZddlmZdd
lmZddlmZddlZddlmZddlmZdZ dd�dD�Z!dZ"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'dYd!d"�Z(dZd#d$�Z)Gd%d&�d&ej�Z*Gd'd(�d(ej�Z+Gd)d*�d*ej,�Z-Gd+d,�d,ej.�Z/Gd-d.�d.ej.�Z0d/d0�Z1z&dd1l2m3Z3Gd2d3�d3e3j4�Z5d4Z6Wne
k
�rd Z6YnXd5d6�Z7d7Z8d8Z9e9e9e8d9�Z:d:d;�Z;e
j<�=ej>�d fd<d=�Z?Gd>d?�d?ej�Z@Gd@dA�dAej�ZAGdBdC�dCejB�ZCGdDdE�dEej�ZDdFdG�ZEGdHdI�dIej�ZFzddJlmGZGd4ZHeGjIZIWne
k
�r�d ZHdZIYnXdKdL�ZJdMdN�ZKdOdP�ZLdQdR�ZMd[dSdT�ZNdUdV�ZOd\dWdX�ZPejQjRZRdS)]z4
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-requirescCsg|]}|tjd�qS)r)�sys�version_info)�.0�x�r�//usr/lib/python3/dist-packages/pbr/packaging.py�
<listcomp>;sr)zrequirements-py%d.txtztools/pip-requires-py%d)ztest-requirements.txtztools/test-requirescCs4tj�d�}|r(tdd�|�d�D��Sttt�S)NZPBR_REQUIREMENTS_FILEScss|]}|��VqdS�N��strip�r�frrr�	<genexpr>Csz)get_requirements_files.<locals>.<genexpr>�,)�os�environ�get�tuple�split�PY_REQUIREMENTS_FILES�list�REQUIREMENTS_FILES)�filesrrr�get_requirements_files@sr'cCs:g}|�|d�}|r|�|�|�|�d�|�||<dS)z5Append a 
 separated list to possibly existing value.��
N)r �append�extend�join)Zconfig�keyZ	text_listZ	new_valueZ
current_valuerrr�append_text_listLs

r.cCsdd�|D�S)NcSsg|]}tj�|�r|�qSr)r�path�existsrrrrrWsz!_any_existing.<locals>.<listcomp>r)Z	file_listrrr�
_any_existingVsr1cCsvt|�}dd�|D�}|r*t�d|t�dd�|D�}|D]4}t|d�� }|���d�W5QR�SQRXq<gS)NcSsg|]}|tkr|�qSr�r#rrrrr_sz'get_reqs_from_files.<locals>.<listcomp>z�Support for '-pyN'-suffixed requirements files is removed in pbr 5.0 and these files are now ignored. Use environment markers instead. Conflicting files: %rcSsg|]}|tkr|�qSrr2rrrrrgs�rr))r1�warnings�warn�DeprecationWarning�open�readr")�requirements_files�existingZ
deprecatedZrequirements_fileZfilrrr�get_reqs_from_files[s��&r;cCst�dd|��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)�matchrrr�egg_fragmentos
�rAFc
	CsV|dkrt�}g}t|�D�]4}|��r|�d�r4qt�d|�rBq|�d�rn|�d�d}|t|g|d�7}qztj	�
|�j}Wntk
r�d}YnXt�d|�r�t�d|�}|�
d	�}t|�}|jr�t�d
t|j�}nt�d|�r�d}d}|dk	�r>t�d
d|�}|�r2|�d�}	|	dk�r&d}	|d|	�}|�|�qt�d||f�q|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 %s: %s)r'r;r�
startswithr=r@�	partition�parse_requirements�
pkg_resourcesZRequirement�parse�project_name�
ValueError�grouprZschemer>rAZfragment�findr*r�info)
r9rEZrequirements�lineZreq_filerM�extractZegg�reasonZsemi_posrrrrJ�sT�
�





�rJcCsj|dkrt�}g}t|�D]J}t�d|�r,qt�d|�rN|�t�dd|��qt�d|�r|�|�q|S)Nz
(\s*#)|(\s*$)z\s*-[ef]\s+r(z+^\s*(https?|git(\+(https|ssh))?|svn|hg)\S*:)r'r;r=r@r*r>)r9Zdependency_linksrRrrr�parse_dependency_links�srUc@seZdZdZdZdd�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.
    rcCst|j�tj�|�Sr)�	_from_git�distributionr�run��selfrrrrY�s
zInstallWithGit.runN��__name__�
__module__�__qualname__�__doc__�command_namerYrrrrrV�srVc@seZdZdZdZdd�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.
    rcCst|j�tj�|�Sr)rWrX�
du_installrrYrZrrrrY�s
zLocalInstall.runNr\rrrrrb�srbc@s eZdZdZdZdZdd�ZdS)�	TestrTestz&Make setup.py test do the right thing.�testz&DEPRECATED: Run unit tests using testrcCst�dt�tj�|�dS)Nzytestr integration is deprecated in pbr 4.2 and will be removed in a future release. Please call your test runner directly)r4r5r6r�TestrrYrZrrrrY�s�z
TestrTest.runN�r]r^r_r`ra�descriptionrYrrrrrd�srdc@s4eZdZdZeZgZdZdd�Zdd�Zdd�Z	d	S)
�LocalRPMVersionz:Output the rpm *compatible* version string of this packageZrpm_versioncCs.t�d�|j��}tt�|������dS)Nz[pbr] Extracting rpm version)	rrQrX�get_name�printr�VersionInfo�semantic_versionZ
rpm_string�r[�namerrrrY
s

zLocalRPMVersion.runcCsdSrrrZrrr�initialize_optionssz"LocalRPMVersion.initialize_optionscCsdSrrrZrrr�finalize_optionssz LocalRPMVersion.finalize_optionsN�
r]r^r_r`rhZuser_optionsrarYrprqrrrrrisric@s4eZdZdZeZgZdZdd�Zdd�Zdd�Z	d	S)
�LocalDebVersionz:Output the deb *compatible* version string of this packageZdeb_versioncCs.t�d�|j��}tt�|������dS)Nz[pbr] Extracting deb version)	rrQrXrjrkrrlrmZ
debian_stringrnrrrrY s

zLocalDebVersion.runcCsdSrrrZrrrrp%sz"LocalDebVersion.initialize_optionscCsdSrrrZrrrrq(sz LocalDebVersion.finalize_optionsNrrrrrrrssrscCstjSr)r�
have_testrrrrrrt,srt)�commandsc@s eZdZdZdZdZdd�ZdS)�NoseTestz)Fallback test runner if testr is a no-go.rez%DEPRECATED: Run unit tests using nosecCst�dt�tj�|�dS)Nzpnose integration in pbr is deprecated. Please use the native nose setuptools configuration or call nose directly)r4r5r6ru�	nosetestsrYrZrrrrY9s�zNoseTest.runNrgrrrrrv3srvTcCstSr)�
_have_noserrrr�	have_noseHsrya#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())
)Zconsole_scriptsZgui_scripts�wsgi_scriptscCsH|jrt|j�dkrtd��|t||j|jdd�|j�d�}||S)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
    rDzBScript targets must be of the form 'func' or 'Class.class_method'.r�.)rO�module_nameZ
import_targetZ
invoke_target)Zattrs�lenrN�dictr|r,)rOZentry_point�header�templateZscript_textrrr�generate_script�s
�r�ccsPt�d||�}t��D]4\}}|�|���D]\}}|t||||�fVq,qdS)z$Override entrypoints console_script.r(N)r�get_script_header�ENTRY_POINTS_MAP�items�
get_entry_mapr�)�dist�
executable�
is_wininstrrOr�ro�eprrr�override_get_script_args�sr�c@seZdZdZdd�ZdS)�LocalDeveloprcCs:tjdkrtj�||�S|js6t|�D]}|j|�q&dS)NZwin32)r�platformr�install_wrapper_scriptsZexclude_scriptsr��write_script)r[r��argsrrrr��s

z$LocalDevelop.install_wrapper_scriptsN)r]r^r_rar�rrrrr��sr�c@s$eZdZdZdZdd�Zdd�ZdS)�LocalInstallScriptsz(Intercepts console scripts entry_points.r	c	CsLt�d||�}td}|�d���D]"\}}td|||�}|�||�q$dS)Nr(rz)rr�r�r�r�r�r�)	r[r�r�r�rZwsgi_script_templateror�Zcontentrrr�_make_wsgi_scripts_only�s�z+LocalInstallScripts._make_wsgi_scripts_onlyc	Cs�ddl}|�d�|jjr,|jjj�|�ng|_|�d�}t	�
|jt	�|j|j
�|j|j�}|�d�}t|dtj�}t|�d�dd�}d|jjkr�|�|||�|jr�dStjd	kr�t}ntj}d
|}||||�D]}|j|�q�dS)NrrZ
build_scriptsr�Z
bdist_wininstZ_is_runningFZbdist_wheel�ntz"%s")Z!distutils.command.install_scriptsZrun_commandrXZscripts�commandr	rYZoutfiles�get_finalized_commandrKZDistributionZegg_baseZPathMetadatarZegg_nameZegg_version�getattrrZsys_executableZhave_runr�Zno_eprror��get_script_argsr�)	r[�	distutils�ei_cmdr�Zbs_cmdr�r�r�r�rrrrY�sB

�
��
zLocalInstallScripts.runN)r]r^r_r`rar�rYrrrrr��sr�c@s eZdZdZdd�Zdd�ZdS)�LocalManifestMakerz?Add any files that are in git and some standard sensible files.cCsdD]}|j�|�qdS)N)zinclude AUTHORSzinclude ChangeLogzexclude .gitignorezexclude .gitreviewzglobal-exclude *.pyc)�filelistZprocess_template_line)r[Z
template_linerrr�_add_pbr_defaultssz$LocalManifestMaker._add_pbr_defaultscCs�|j�d�}tj�|�|j�|j�|j�|j�|j�t	�
��t�|dd�}|spt
��}|r�|j�|�ntj�|j�r�|��|�d�}|��|jjd|jd�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.
        �pbrZskip_git_sdistZSKIP_GIT_SDISTr�*)�prefixN)rX�get_option_dictr
�add_defaultsr�r*r��manifestr+rZget_extra_filesr
�get_boolean_optionrZ_find_git_filesrr/r0Z
read_manifestr�r�Zinclude_patternr)r[�option_dict�should_skipZrcfilesr�rrrr�
s"
�
zLocalManifestMaker.add_defaultsN)r]r^r_r`r�r�rrrrr�s
r�c@seZdZdZdZdd�ZdS)�LocalEggInfozAOverride the egg_info command to regenerate SOURCES.txt sensibly.rcCs�tj�|jd�}tj�|�r2tj�d�s2dtjkr^t�d�t	|j
�}||_|��|j
|_
n:t�d�t��|_
t|d����d�D]}|j
�|�q�dS)	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.gitr
z[pbr] Processing SOURCES.txtz"[pbr] Reusing existing SOURCES.txtr3r)N)rr/r,rr0r�argvrrQr�rXr�rYr�ZFileListr7r8r"r*)r[Zmanifest_filenameZmm�entryrrr�find_sources/s	
��




zLocalEggInfo.find_sourcesN)r]r^r_r`rar�rrrrr�*sr�cCs>|�d�}t��}|r t�|�}tj||d�tj|d�dS)Nr�)r��	changelog)r�)r�r�_iter_log_onelineZ_iter_changelogZwrite_git_changelogZgenerate_authors)rXr�r�rrrrWHs

rWc@s>eZdZdZdZdd�ZdefgejjZdd�Zdd	�Z	d
S)�
LocalSDistz5Builds the ChangeLog and Authors files from VC first.r
cCs�t|d�r|jS|j�d�}t�|dd�}|r8d|_dSzddlm}Wn&tk
rnt	�
d�d|_YdSX|�|j�\}}}tj
�tj
�|j|j��s�t	�
d	�d|_dS||g|_t	�
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�Z	skip_renoZSKIP_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)�hasattrr�rXr�r
r�Zrenor��ImportErrorrrQZload_configrr/r0r,ZreporootZ	notespath�_files)r[r�r�r��confZoutput_fileZ
cache_filerrr�
checking_renoVs4
�
�



zLocalSDist.checking_renoZ
build_renocCst|j�tj�|�dSr)rWrXr
rYrZrrrrY�s
zLocalSDist.runcCs0|��r |j�|j�|j��tj�|�dSr)r�r�r+r��sortr
�make_distributionrZrrrr��s
zLocalSDist.make_distributionN)
r]r^r_r`rar�r
Zsub_commandsrYr�rrrrr�Qs*r�)�builddoccCstSr)�_have_sphinxrrrr�have_sphinx�sr�c	s�i�|r|d}nd}t�dd|g|�}td���fdd�|�d�D�}t�}|D]}|�d	d�|�d
�D��qR�fdd�}|d
|d�|d|d�|d|d�|d|d�|D]}t�d|�q���dd��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..HEADZHEADrz--pretty=%B�sem-ver:cs*g|]"}|���d�r|�d����qS)r�N)�lowerrHr)rrR)�
header_lenrrr�s�z)_get_increment_kwargs.<locals>.<listcomp>r)cSsg|]}|���qSrr)r�symbolrrrr�srcs||krd�|<|�|�dS)NT)�discard)r��symbolsZimpact)�resultrr�_handle_symbol�sz-_get_increment_kwargs.<locals>._handle_symbolZbugfixZpatchZfeature�minorZdeprecationz	api-break�majorz[pbr] Unknown Sem-Ver symbol %rN)	r�_run_git_commandr}r"�set�updaterrQ�pop)	�git_dir�tagZversion_specr�rur�r�r�r�r)r�r�r�_get_increment_kwargs�s*
�r�c	
Cs�tj|d�}d}t|�D]x\}\}}}t�}t�}t|�D]<}z"tj�|�}|||<|�	|�Wq:t
k
rtYq:Xq:|r|t|�|fSqd|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.
    )r�rr()rr��	enumerater�r~r$r�SemanticVersion�from_pip_string�add�	Exception�max)	r�r�Z	row_countZignoredZtag_setZversion_tagsZ
semver_to_tagr�Zsemverrrr�_get_revno_and_last_tag�sr�cCs�t|�\}}tj�|pd�}|dkr*|}n|jft||��}|dk	r`||kr`tdt||d���|dkrl|S|�|�}|dk	r�|�|�}||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�target)	r�rr�r�Z	incrementr�rNr~Zto_dev)r��target_versionr�ZdistanceZlast_semverZnew_versionZnew_devZ
target_devrrr�_get_version_from_git_target�s*�
��

r�cCs�t��}|rvz,tjddg|dd��dd�}tj�|�}Wn*tk
rb|rZtj�|�}nd}YnXt||�}|�	�Szt
�WStk
r�YdSXdS)	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.
    Zdescribez
--exact-matchT)Zthrow_on_error�-r{Nr()rZ_run_git_functionsr��replacerr�r�r�r�Zrelease_stringZunicode�	NameError)�pre_versionr�Ztaggedr�r�rrr�_get_version_from_gits0���

r�c
Cs�ddg}i}|D]\}zt|d�}Wnttfk
r>YqYnXzt�|�}Wqtjjk
rjYqYqXq|�dd�|kr�dS|�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-INFOZMETADATAr3�NameNZVersion)r7�IOError�OSError�emailZmessage_from_file�errorsZMessageErrorr )�package_nameZpkg_metadata_filenamesZpkg_metadata�filenameZpkg_metadata_filerrr�_get_version_from_pkg_metadata,s
r�cCsltj�dtj�dd��}|r |St|�}|r0|St|�}tjddkrP|�d�}|rX|Stdj	|d���dS)	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.
    ZPBR_VERSIONZOSLO_PACKAGE_VERSIONNrrDzutf-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.)ro)
rrr r�r�rr�encoder��format)r�r�rrrr�get_versionDs"�
�r�)NF)N)N)N)Sr`Z
__future__rZdistutils.commandrrcr�rZurllib.parserr�r�Zemail.errorsrr=rr4rKZ
setuptoolsZsetuptools.commandrrrr	r
r�rrr
Zpbr.pbr_jsonrrr%r#ZTEST_REQUIREMENTS_FILESr'r.r1r;rArJrUrVrbrfrdZCommandrirsrtZnoserurwrvrxryZ
_wsgi_textZ_script_textr�r�r/�normpathr�r�r�r�Zmanifest_makerr�r�rWr�r�r�Z
LocalBuildDocr�r�r�r�r�r�r�Zpbr_jsonZwrite_pbr_jsonrrrr�<module>s�

C

6��
	:*	@

)%
&
/