<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
U
    ʗRe1                     @   s  d Z ddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZ ddlmZmZ ddlmZmZ ddlmZ ddlmZmZ ddlmZmZ dd	lmZ dd
lmZ ddlm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z*m+Z+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6 e7e8Z9e:dej;Z<ee&ge=f Z>ee
e& e
e& f Z?e@e=dddZAe&e=e>e=dddZBe&e=dddZCe&e>e=d d!d"ZDe&ee= dd#d$ZEe&ee@d%d&d'ZFee=d(d)d*ZGe&e@dd+d,d-ZHe&e@e=e
e@ e
e@ e=ee@ d.d/d0ZIe&e@e
e@ e
e@ e=ee@ d1d2d3ZJe&e
e@ e=d4d5d6ZKe	e& ee=e
e@ e
e@ e?d7d8d9ZLdS ):z;Orchestrator for building wheels from InstallRequirements.
    N)AnyCallableIterableListOptionalTuple)canonicalize_namecanonicalize_version)InvalidVersionVersion)
WheelCache)InvalidWheelFilenameUnsupportedWheel)FilesystemWheelget_wheel_distribution)Link)Wheel)build_wheel_pep517)build_wheel_editable)build_wheel_legacy)InstallRequirement)
indent_log)
ensure_dir	hash_fileis_wheel_installed)make_setuptools_clean_args)call_subprocess)TempDirectory)path_to_url)vcsz([a-z0-9_.]+)-([a-z0-9_.!+-]+))sreturnc                 C   s   t t| S )zjDetermine whether the string looks like an egg_info.

    :param s: The string to parse. E.g. foo-2.1
    )bool_egg_info_research)r     r%   /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/wheel_builder.py_contains_egg_info&   s    r'   )req
need_wheelcheck_binary_allowedr!   c                 C   s   | j r
dS | jr&|r"td| j dS |r.dS | js8dS | jrF|  S | jrPdS || sjtd| j dS t	 std| j dS dS )zBReturn whether an InstallRequirement should be built into a wheel.Fz(Skipping %s, due to already being wheel.TzCSkipping wheel build for %s, due to binaries being disabled for it.zOUsing legacy 'setup.py install' for %s, since package 'wheel' is not installed.)

constraintis_wheelloggerinfoname
source_direditablesupports_pyproject_editable
use_pep517r   )r(   r)   r*   r%   r%   r&   _should_build.   s<    r4   )r(   r!   c                 C   s   t | dtdS )NTr)   r*   )r4   _always_true)r(   r%   r%   r&   should_build_for_wheel_commandc   s    r7   )r(   r*   r!   c                 C   s   t | d|dS )NFr5   )r4   )r(   r*   r%   r%   r&    should_build_for_install_commandi   s
      r8   c                 C   s   | j s| jsdS | jrb| jjrb| j r(t| js2tt| jj}|sHt|| jj	| jr^dS dS | jslt| j
 \}}t|rdS dS )z
    Return whether a built InstallRequirement can be stored in the persistent
    wheel cache, assuming the wheel cache is available, and _should_build()
    has determined a wheel needs to be built.
    FT)r1   r0   linkis_vcsAssertionErrorr   get_backend_for_schemeschemeis_immutable_rev_checkouturlsplitextr'   )r(   vcs_backendbaseextr%   r%   r&   _should_cacher   s    


rD   )r(   wheel_cacher!   c                 C   s>   t |j}| jst|r.t| r.|| j}n|| j}|S )zdReturn the persistent or temporary cache directory where the built
    wheel need to be stored.
    )r"   	cache_dirr9   r;   rD   get_path_for_linkget_ephem_path_for_link)r(   rE   cache_availablerF   r%   r%   r&   _get_cache_dir   s    

rJ   )_r!   c                 C   s   dS )NTr%   )rK   r%   r%   r&   r6      s    r6   )r(   
wheel_pathr!   c           	      C   s   t | jp
d}ttj|}t |j|kr>td||jtt	||}t
|j}t|t|jkrztd||j|j}|d krtdzt|}W n& tk
r   d| }t|Y nX |tdkrt|jtstd|d S )N z7Wheel has unexpected file name: expected {!r}, got {!r}zMissing Metadata-VersionzInvalid Metadata-Version: z1.2z6Metadata 1.2 mandates PEP 440 version, but {!r} is not)r   r/   r   ospathbasenamer   formatr   r   strversionr	   metadata_versionr   r   r
   
isinstance)	r(   rL   canonical_namewdistdist_verstrmetadata_version_valuerT   msgr%   r%   r&   _verify_one   s@     
 
r\   )r(   
output_dirverifybuild_optionsglobal_optionsr1   r!   c           	   
   C   s   |rdnd}zt | W n: tk
rR } ztd|| j| W Y dS d}~X Y nX | j t| ||||}W 5 Q R X |r|rzt| | W n> tt	fk
r } ztd|| j| W Y dS d}~X Y nX |S )zaBuild one wheel.

    :return: The filename of the built wheel, or None if the build failed.
    r1   wheelzBuilding %s for %s failed: %sNzBuilt %s for %s is invalid: %s)
r   OSErrorr-   warningr/   	build_env_build_one_inside_envr\   r   r   )	r(   r]   r^   r_   r`   r1   artifacterL   r%   r%   r&   
_build_one   s4        rh   )r(   r]   r_   r`   r1   r!   c                 C   s|  t ddf}| jst| jr| js(t| js2t|rDtd| j |rVtd| j |rtt| j| j| j|j	d}qt
| j| j| j|j	d}nt| j| j| j|||j	d}|d k	rRtj	|}tj	||}zNt|\}	}
t|| td| j||
|	  td| |W W  5 Q R  S  tk
rP } ztd	| j| W 5 d }~X Y nX | jsdt| | W 5 Q R  d S Q R X d S )
Nra   )kindz7Ignoring --global-option when building %s using PEP 517z6Ignoring --build-option when building %s using PEP 517)r/   backendmetadata_directorytempd)r/   setup_py_pathr0   r`   r_   rl   z3Created wheel for %s: filename=%s size=%d sha256=%szStored in directory: %sz Building wheel for %s failed: %s)r   r/   r;   r3   rk   pep517_backendr-   rc   r   rO   r   r   rm   unpacked_source_directoryrN   rP   joinr   shutilmover.   	hexdigest	Exception_clean_one_legacy)r(   r]   r_   r`   r1   temp_dirrL   
wheel_name	dest_path
wheel_hashlengthrg   r%   r%   r&   re      sx    


  	

re   )r(   r`   r!   c                 C   s\   t | j|d}td| j zt|d| jd W dS  tk
rV   td| j Y dS X d S )N)r`   zRunning setup.py clean for %szpython setup.py clean)command_desccwdTz Failed cleaning build dir for %sF)	r   rm   r-   r.   r/   r   r0   rt   error)r(   r`   
clean_argsr%   r%   r&   ru   1  s      ru   )requirementsrE   r^   r_   r`   r!   c           
   	   C   s  | sg g fS t dddd | D  t  g g  }}| D ]}|jsLtt||}t||||||jol|j	}	|	r|j
dk	r|||j
 tt|	|_|jj|_|jjst|| q>|| q>W 5 Q R X |rt dddd	 |D  |rt d
ddd	 |D  ||fS )zBuild wheels.

    :return: The list of InstallRequirement that succeeded to build and
        the list of InstallRequirement that failed to build.
    z*Building wheels for collected packages: %sz, c                 s   s   | ]}|j V  qd S )Nr/   .0r(   r%   r%   r&   	<genexpr>T  s     zbuild.<locals>.<genexpr>NzSuccessfully built %s c                 S   s   g | ]
}|j qS r%   r   r   r%   r%   r&   
<listcomp>w  s     zbuild.<locals>.<listcomp>zFailed to build %sc                 S   s   g | ]
}|j qS r%   r   r   r%   r%   r&   r   |  s     )r-   r.   rp   r   r/   r;   rJ   rh   r1   permit_editable_wheelsdownload_inforecord_download_originr   r   r9   	file_pathlocal_file_pathr,   append)
r   rE   r^   r_   r`   build_successesbuild_failuresr(   rF   
wheel_filer%   r%   r&   buildB  sL    





r   )M__doc__loggingos.pathrN   rerq   typingr   r   r   r   r   r   pip._vendor.packaging.utilsr   r	   Zpip._vendor.packaging.versionr
   r   pip._internal.cacher   pip._internal.exceptionsr   r   pip._internal.metadatar   r   pip._internal.models.linkr   pip._internal.models.wheelr   $pip._internal.operations.build.wheelr   -pip._internal.operations.build.wheel_editabler   +pip._internal.operations.build.wheel_legacyr   Zpip._internal.req.req_installr   pip._internal.utils.loggingr   pip._internal.utils.miscr   r   r   $pip._internal.utils.setuptools_buildr   pip._internal.utils.subprocessr   pip._internal.utils.temp_dirr   pip._internal.utils.urlsr   pip._internal.vcsr   	getLogger__name__r-   compile
IGNORECASEr#   r"   BinaryAllowedPredicateBuildResultrR   r'   r4   r7   r8   rD   rJ   r6   r\   rh   re   ru   r   r%   r%   r%   r&   <module>   s    
	6
!'G