<!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>

Re                  @   s  d  Z  d d l m Z d d l m Z d d l Z d d l Z d d l Z d d l m Z d d l	 Z	 d d l
 Z
 d d l Z d d l Z e j d d k r d d   Z d	 d
   Z n d d   Z d d
   Z Gd d   d e  Z Gd d   d e  Z Gd d   d e  Z d d   Z d d   Z d d   Z d d   Z d Z d d   Z d d   Z d  d!   Z d d" d#  Z d$ d%   Z Gd& d'   d' e  Z Gd( d)   d) e  Z d* d+   Z  d d d# d% d+ h Z! d, d-   Z" e# d. k re"   d S)/ag  This is invoked in a subprocess to call the build backend hooks.

It expects:
- Command line args: hook_name, control_dir
- Environment variables:
      PEP517_BUILD_BACKEND=entry.point:spec
      PEP517_BACKEND_PATH=paths (separated with os.pathsep)
- control_dir/input.json:
  - {"kwargs": {...}}

Results:
- control_dir/output.json
  - {"return_val": ...}
    )glob)import_moduleN)join   c             K   s6   t  | d d d  } t j |  | |  Wd  QRXd  S)Nwencodingzutf-8)openjsondump)objpathkwargsf r   /builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.py
write_json!   s    r   c          	   C   s0   t  |  d d d  } t j |  SWd  QRXd  S)Nrr   zutf-8)r   r	   load)r   r   r   r   r   	read_json%   s    r   c             K   s6   t  | d    } t j |  | d d | Wd  QRXd  S)Nwbr   zutf-8)r   r	   r
   )r   r   r   r   r   r   r   r   +   s    c          	   C   s*   t  |  d   } t j |  SWd  QRXd  S)Nrb)r   r	   r   )r   r   r   r   r   r   /   s    c               @   s"   e  Z d  Z d Z d d   Z d S)BackendUnavailablez&Raised if we cannot import the backendc             C   s   | |  _  d  S)N)	traceback)selfr   r   r   r   __init__6   s    zBackendUnavailable.__init__N)__name__
__module____qualname____doc__r   r   r   r   r   r   4   s   r   c               @   s"   e  Z d  Z d Z d d   Z d S)BackendInvalidz Raised if the backend is invalidc             C   s   | |  _  d  S)N)message)r   r    r   r   r   r   <   s    zBackendInvalid.__init__N)r   r   r   r   r   r   r   r   r   r   :   s   r   c               @   s   e  Z d  Z d Z d S)HookMissingzARaised if a hook is missing and we are not executing the fallbackN)r   r   r   r   r   r   r   r   r!   @   s   r!   c             C   sX   t  j j t  j j |    }  t  j j t  j j |   } t  j j |  | g  | k S)z5Test if a file is located within the given directory.)osr   normcaseabspathcommonprefix)filename	directoryr   r   r   contained_inD   s    r(   c                 s   t  j j d  }  |  r= |  j t  j  } | t j d d  <t  j d } | j d  \ } } } y t |    Wn$ t	 k
 r t
 t j     Yn X|  r t   f d d   | D  s t d   | r x& | j d	  D] } t   |    q W  S)
zFind and load the build backendPEP517_BACKEND_PATHNr   PEP517_BUILD_BACKEND:c             3   s!   |  ] } t    j |  Vq d  S)N)r(   __file__).0r   )r   r   r   	<genexpr>\   s   z!_build_backend.<locals>.<genexpr>z(Backend was not loaded from backend-path.)r"   environgetsplitpathsepsysr   	partitionr   ImportErrorr   r   
format_excanyr   getattr)backend_pathZextra_pathitemsepZmod_path_Zobj_pathZ	path_partr   )r   r   _build_backendK   s&    r=   c             C   s=   t    } y | j } Wn t k
 r. g  SYn X| |   Sd S)zfInvoke the optional get_requires_for_build_wheel hook

    Returns [] if the hook is not defined.
    N)r=   get_requires_for_build_wheelAttributeError)config_settingsbackendhookr   r   r   r>   g   s    		r>   c             C   s[   t    } y | j } Wn1 t k
 rI | s5 t    t | |  |  SYn X| |  |  Sd S)zInvoke optional prepare_metadata_for_build_wheel

    Implements a fallback by building a wheel if the hook isn't defined,
    unless _allow_fallback is False in which case HookMissing is raised.
    N)r=    prepare_metadata_for_build_wheelr?   r!   _get_wheel_metadata_from_wheel)metadata_directoryr@   _allow_fallbackrA   rB   r   r   r   rC   u   s    			rC   ZPEP517_ALREADY_BUILT_WHEELc             C   s\   g  } x9 |  j    D]+ } t j d |  } | r | j |  q W| rL | St d   d S)z6Identify the .dist-info folder inside a wheel ZipFile.z[^/\\]+-[^/\\]+\.dist-info/z#No .dist-info folder found in wheelN)namelistrematchappend	Exception)Zwhl_zipresr   mr   r   r   _dist_info_files   s    rN   c             C   s   d d l  m } |  j | |  } t t j j | t  d   Wd QRXt j j | |  } | |  ) } t |  } | j	 d | d |  Wd QRX| d j
 d  d S)zBuild a wheel and extract the metadata from it.

    Fallback for when the build backend does not
    define the 'get_wheel_metadata' hook.
    r   )ZipFiler   Nr   members/)zipfilerO   build_wheelr   r"   r   r   WHEEL_BUILT_MARKERrN   
extractallr2   )rA   rE   r@   rO   Zwhl_basenameZwhl_fileZzipfZ	dist_infor   r   r   rD      s    rD   c             C   s   |  s
 d St  j j |   } t  j j t | t   s; d St t  j j | d   } | sj t d  d St	 |  d k r t d  d S| d S)zHCheck for a wheel already built during the get_wheel_metadata hook.
    Nz*.whlz+Found wheel built marker, but no .whl files   zHFound multiple .whl files; unspecified behaviour. Will call build_wheel.r   )
r"   r   dirnameisfilepjoinrT   r   r   printlen)rE   Zmetadata_parentZ	whl_filesr   r   r   _find_already_built_wheel   s    

r\   c             C   sH   t  |  } | r2 t j | |   t j j |  St   j |  | |  S)zInvoke the mandatory build_wheel hook.

    If a wheel was already built in the
    prepare_metadata_for_build_wheel fallback, this
    will copy it rather than rebuilding the wheel.
    )r\   shutilcopy2r"   r   basenamer=   rS   )wheel_directoryr@   rE   Zprebuilt_whlr   r   r   rS      s    rS   c             C   s=   t    } y | j } Wn t k
 r. g  SYn X| |   Sd S)zfInvoke the optional get_requires_for_build_wheel hook

    Returns [] if the hook is not defined.
    N)r=   get_requires_for_build_sdistr?   )r@   rA   rB   r   r   r   ra      s    		ra   c               @   s   e  Z d  Z d Z d S)_DummyExceptionz(Nothing should ever raise this exceptionN)r   r   r   r   r   r   r   r   rb      s   rb   c               @   s"   e  Z d  Z d Z d d   Z d S)GotUnsupportedOperationz9For internal use when backend raises UnsupportedOperationc             C   s   | |  _  d  S)N)r   )r   r   r   r   r   r      s    z GotUnsupportedOperation.__init__N)r   r   r   r   r   r   r   r   r   rc      s   rc   c             C   sT   t    } y | j |  |  SWn0 t | d t  k
 rO t t j     Yn Xd S)z&Invoke the mandatory build_sdist hook.UnsupportedOperationN)r=   build_sdistr9   rb   rc   r   r7   )sdist_directoryr@   rA   r   r   r   re      s
    	re   c              C   s  t  t j  d k  r" t j d  t j d }  t j d } |  t k rY t j d |   t   |  } t t | d   } d d d	 d  i } y | | d
   | d	 <Wn t k
 r } z d | d <| j	 | d <WYd  d  } ~ Xn t
 k
 r} z d | d <| j | d <WYd  d  } ~ XnW t k
 rY} z d | d <| j	 | d <WYd  d  } ~ Xn t k
 rtd | d <Yn Xt | t | d  d d d  S)Nr   z"Needs args: hook_name, control_dirrV      zUnknown hook: %sz
input.jsonunsupportedF
return_valr   T
no_backendr   backend_invalidbackend_errorhook_missingzoutput.jsonindent)r[   r4   argvexit
HOOK_NAMESglobalsr   rY   r   r   r   r    rc   r!   r   )	hook_nameZcontrol_dirrB   
hook_inputZjson_outer   r   r   main   s.    


rv   __main__)$r   r   	importlibr   r	   r"   os.pathr   rY   rH   r]   r4   r   version_infor   r   rK   r   r   r!   r(   r=   r>   rC   rT   rN   rD   r\   rS   ra   rb   rc   re   rq   rv   r   r   r   r   r   <module>   sN   
	