File: //opt/alt/python38/lib/python3.8/site-packages/pbr/__pycache__/core.cpython-38.pyc
U
�Va � @ s� d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dl m
Z
ejZdd� Z
dd � Zejd d
kr�eZefZneZeefZdd� Z dS )
� )�core)�errorsN)�dist)�utilc C s t �tj�t_d S �N)r �_get_unpatchedr �Distribution� r r �9/opt/alt/python38/lib/python3.8/site-packages/pbr/core.py�_monkeypatch_distribution= s r c C s
t t_d S r )�_saved_core_distributionr r r r r r
�!_restore_distribution_monkeypatchA s r
� c s� �z�t� |sW ��rdS t|t�r0tj�|�}ntj�d�}tj�|�sVt� d| ��zt
�|�}W nB tk
r� t
�� d }t�d� t�d||jj|f ��Y nX |�r4|�� D ]|\}}t| jd| �r�t| jd| �|� q�t| j|��rt| j||� q�t| |��rt| ||� q�dt|� }t�|� q�tj�| � t| jjt t!f ��rft"| jj�| j_d d
g� t
�#� fdd��| _$W 5 t � X dS )
a9 Implements the actual pbr setup() keyword. When used, this should be
the only keyword in your setup() aside from `setup_requires`.
If given as a string, the value of pbr is assumed to be the relative path
to the setup.cfg file to use. Otherwise, if it evaluates to true, it
simply assumes that pbr should be used, and the default 'setup.cfg' is
used.
This works by reading the setup.cfg file, parsing out the supported
metadata and command options, and using them to rebuild the
`DistributionMetadata` object and set the newly added command options.
The reason for doing things this way is that a custom `Distribution` class
will not play nicely with setup_requires; however, this implementation may
not work well with distributions that do use a `Distribution` subclass.
Nz setup.cfgz%The setup.cfg file %s does not exist.� z
Error parsingzError parsing %s: %s: %s�set_zUnknown distribution option: %sz
pre_hook.*zpost_hook.*c s
t �� �S r )r �
IgnoreDictr ��ignorer r
�<lambda>� � zpbr.<locals>.<lambda>)%r
r �
isinstance�string_type�os�path�abspath�existsr �DistutilsFileErrorr �cfg_to_args� Exception�sys�exc_info�logging� exception�DistutilsSetupError� __class__�__name__�items�hasattr�metadata�getattr�setattr�repr�warnings�warnr r �finalize_options�version�
integer_types�float�str�DefaultGetDict�command_options) r �attr�valuer �attrs�e�key�val�msgr r r
�pbrM sJ
�
�
�
r<