
    yIfo                    p    d Z ddlmZ ddlmZ ddlmZ ddlmZ g dZ	ddd	ge	Z
ddZddZddZddZdS )z Borrowed from the pip code base.    )annotations)urlsplit)url2pathname)canonicalize_name)ftpsshgithgbzrsftpsvnhttphttpsfilenamestrreturnboolc                .    t          |           t          v S )N)get_url_schemeVALID_SCHEMAS)r   s    S/var/www/piapp/venv/lib/python3.11/site-packages/tox/tox_env/python/pip/req/util.pyis_urlr      s    $=00    url
str | Nonec                j    d| vrd S |                      dd          d                                         S )N:   r   )splitlower)r   s    r   r   r      s5    
#~~t99S!Q%%'''r   c                    t          |           \  }}}}}|r|dk    rd}nd| }t          |          t          ||z             S )N	localhost z8non-local file URIs are not supported on this platform: )r   
ValueErrorr   )r   _netlocpathmsgs        r   url_to_pathr*      s\    $SMMAvtQ V{**PPPoo&&&r   valuetargetset[str]otherNonec                   |                      d          }d|v rb|                                 |                                 |                    d           |d |                    d          dz   = d|vrd S d|v b|D ]V}|dk    r|                                 t	          |          }|                    |           |                    |           Wd S )N,z:all:r   z:none:)r    clearaddindexr   discard)r+   r,   r.   newr   normalized_names         r   handle_binary_optionr8   "   s    
++c

C
S..

7(#))G$$q(()3F S..  $ $8LLNNN+D11o&&&

?####$ $r   N)r   r   r   r   )r   r   r   r   )r   r   r   r   )r+   r   r,   r-   r.   r-   r   r/   )__doc__
__future__r   urllib.parser   urllib.requestr   packaging.utilsr   VCSr   r   r   r*   r8    r   r   <module>r@      s    & & " " " " " " ! ! ! ! ! ! ' ' ' ' ' ' - - - - - -777&/3/1 1 1 1( ( ( (' ' ' '$ $ $ $ $ $r   