Your IP : 18.116.27.225


Current Path : /opt/alt/python37/lib/python3.7/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/setuptools/__pycache__/build_meta.cpython-37.pyc

B

��Re((�@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZdddddd	d
gZGdd
�d
e
�ZGdd
�d
ejj�Zejdd��Zdd�Zdd�Zdd�ZGdd�de�ZGdd�de�Ze�ZejZejZejZejZejZe�ZdS)a-A PEP 517 interface to setuptools

Previously, when a user or a command line tool (let's call it a "frontend")
needed to make a request of setuptools to take a certain action, for
example, generating a list of installation requirements, the frontend would
would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line.

PEP 517 defines a different method of interfacing with setuptools. Rather
than calling "setup.py" directly, the frontend should:

  1. Set the current directory to the directory with a setup.py file
  2. Import this module into a safe python interpreter (one in which
     setuptools can potentially set global variables or crash hard).
  3. Call one of the functions defined in PEP 517.

What each function does is defined in PEP 517. However, here is a "casual"
definition of the functions (this definition should not be relied on for
bug reports or API stability):

  - `build_wheel`: build a wheel in the folder and return the basename
  - `get_requires_for_build_wheel`: get the `setup_requires` to build
  - `prepare_metadata_for_build_wheel`: get the `install_requires`
  - `build_sdist`: build an sdist in the folder and return the basename
  - `get_requires_for_build_sdist`: get the `setup_requires` to build

Again, this is not a formal definition! Just a "taste" of the module.
�N)�parse_requirements�get_requires_for_build_sdist�get_requires_for_build_wheel� prepare_metadata_for_build_wheel�build_wheel�build_sdist�
__legacy__�SetupRequirementsErrorc@seZdZdd�ZdS)r	cCs
||_dS)N)�
specifiers)�selfr
�r��/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/build_meta.py�__init__4szSetupRequirementsError.__init__N)�__name__�
__module__�__qualname__rrrrr
r	3sc@s&eZdZdd�Zeejdd���ZdS)�DistributioncCstttt|���}t|��dS)N)�list�map�strrr	)rr
Zspecifier_listrrr
�fetch_build_eggs9szDistribution.fetch_build_eggsccs*tjj}|tj_z
dVWd|tj_XdS)zw
        Replace
        distutils.dist.Distribution with this class
        for the duration of this context.
        N)�	distutils�corer)�cls�origrrr
�patch>s

zDistribution.patchN)rrrr�classmethod�
contextlib�contextmanagerrrrrr
r8srccs(tj}dd�t_z
dVWd|t_XdS)a
Temporarily disable installing setup_requires

    Under PEP 517, the backend reports build dependencies to the frontend,
    and the frontend is responsible for ensuring they're installed.
    So setuptools (acting as a backend) should not try to install them.
    cSsdS)Nr)�attrsrrr
�<lambda>W�z+no_install_setup_requires.<locals>.<lambda>N)�
setuptoolsZ_install_setup_requires)rrrr
�no_install_setup_requiresNs


r#cs�fdd�t���D�S)Ncs&g|]}tj�tj��|��r|�qSr)�os�path�isdir�join)�.0�name)�a_dirrr
�
<listcomp>_sz1_get_immediate_subdirectories.<locals>.<listcomp>)r$�listdir)r*r)r*r
�_get_immediate_subdirectories^sr-csD�fdd�t�|�D�}y
|\}Wntk
r>td��YnX|S)Nc3s|]}|���r|VqdS)N)�endswith)r(�f)�	extensionrr
�	<genexpr>esz'_file_with_extension.<locals>.<genexpr>z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)r$r,�
ValueError)�	directoryr0Zmatching�filer)r0r
�_file_with_extensioncs
r5cCs&tj�|�st�d�Sttdt�|�S)Nz%from setuptools import setup; setup()�open)r$r%�exists�io�StringIO�getattr�tokenizer6)�setup_scriptrrr
�_open_setup_scriptqs
r=c@s`eZdZdd�Zdd�Zddd�Zdd	d
�Zddd�Zdd
d�Zdd�Z	ddd�Z
ddd�ZdS)�_BuildMetaBackendcCs|pi}|�dg�|S)Nz--global-option)�
setdefault)r�config_settingsrrr
�_fix_config{sz_BuildMetaBackend._fix_configc
Csz|�|�}tjdd�dg|dt_y t���|��WdQRXWn,tk
rt}z||j7}Wdd}~XYnX|S)N��egg_infoz--global-option)rA�sys�argvrr�	run_setupr	r
)rr@�requirements�errr
�_get_build_requires�s

z%_BuildMetaBackend._get_build_requires�setup.pyc	CsD|}d}t|��}|���dd�}WdQRXtt||d�t��dS)N�__main__z\r\nz\n�exec)r=�read�replacerL�compile�locals)rr<�__file__rr/�coderrr
rF�s

z_BuildMetaBackend.run_setupNcCs|�|�}|j|dgd�S)N�wheel)rG)rArI)rr@rrr
r�s
z._BuildMetaBackend.get_requires_for_build_wheelcCs|�|�}|j|gd�S)N)rG)rArI)rr@rrr
r�s
z._BuildMetaBackend.get_requires_for_build_sdistc	Cs�tjdd�dd|gt_t��|��WdQRX|}x`dd�t�|�D�}t|�dkr�tt|��dkr�tj�	|t�|�d�}q:t|�dks�t
�Pq:W||kr�t�tj�	||d�|�tj
|dd�|dS)	NrBZ	dist_infoz
--egg-basecSsg|]}|�d�r|�qS)z
.dist-info)r.)r(r/rrr
r+�szF_BuildMetaBackend.prepare_metadata_for_build_wheel.<locals>.<listcomp>rT)�
ignore_errors)rDrEr#rFr$r,�lenr-r%r'�AssertionError�shutil�move�rmtree)r�metadata_directoryr@Zdist_info_directoryZ
dist_infosrrr
r�s(z2_BuildMetaBackend.prepare_metadata_for_build_wheelc
Cs�|�|�}tj�|�}tj|dd�tj|d���}tjdd�|d|g|dt_t	��|�
�WdQRXt||�}tj�||�}tj�
|�r�t�|�t�tj�||�|�WdQRX|S)NT)�exist_ok)�dirrBz
--dist-dirz--global-option)rAr$r%�abspath�makedirs�tempfile�TemporaryDirectoryrDrEr#rFr5r'r7�remove�rename)rZ
setup_commandZresult_extensionZresult_directoryr@Ztmp_dist_dirZresult_basename�result_pathrrr
�_build_with_temp_dir�s

 z&_BuildMetaBackend._build_with_temp_dircCs|�dgd||�S)N�bdist_wheelz.whl)rd)r�wheel_directoryr@rZrrr
r�s
z_BuildMetaBackend.build_wheelcCs|�dddgd||�S)N�sdistz	--formats�gztarz.tar.gz)rd)r�sdist_directoryr@rrr
r�sz_BuildMetaBackend.build_sdist)rJ)N)N)N)NN)N)rrrrArIrFrrrrdrrrrrr
r>ys



!
r>cs"eZdZdZd�fdd�	Z�ZS)�_BuildMetaLegacyBackendaOCompatibility backend for setuptools

    This is a version of setuptools.build_meta that endeavors
    to maintain backwards
    compatibility with pre-PEP 517 modes of invocation. It
    exists as a temporary
    bridge between the old packaging mechanism and the new
    packaging mechanism,
    and will eventually be removed.
    �setup.pyc
s�ttj�}tj�tj�|��}|tjkr6tj�d|�tjd}|tjd<ztt	|�j
|d�Wd|tjdd�<|tjd<XdS)Nr)r<)rrDr%r$�dirnamer]�insertrE�superrjrF)rr<�sys_pathZ
script_dirZ
sys_argv_0)�	__class__rr
rF�s



z!_BuildMetaLegacyBackend.run_setup)rk)rrr�__doc__rF�
__classcell__rr)rpr
rj�s
rj) rqr8r$rDr;rWrr_r"r�
pkg_resourcesr�__all__�
BaseExceptionr	�distrrr#r-r5r=�objectr>rjZ_BACKENDrrrrrrrrrr
�<module>s@m)

?>