
    i                       U d dl mZ d dlZd dlZd dlZd dlmZmZmZ d dl	m
Z
 erd dlmZ eeej        e         f         Zded<    edeeej        e         f         	          Zd
 ZddZddZddZej        d             ZdS )    )annotationsN)TYPE_CHECKINGTypeVarUnion)unique_everseen)	TypeAliasr   StrPathStrPathT)boundc                p    t           j                            |           }t          j        |d           dS )z1Ensure that the parent directory of `path` existsT)exist_okN)ospathdirnamemakedirs)r   r   s     H/srv/django_bis/venv311/lib/python3.11/site-packages/setuptools/_path.pyensure_directoryr      s0    good##GK$''''''    p1p2returnboolc                B    t          |           t          |          k    S )a  Differs from os.path.samefile because it does not require paths to exist.
    Purely string based (no comparison between i-nodes).
    >>> same_path("a/b", "./a/b")
    True
    >>> same_path("a/b", "a/./b")
    True
    >>> same_path("a/b", "././a/b")
    True
    >>> same_path("a/b", "./a/b/c/..")
    True
    >>> same_path("a/b", "../a/b/c")
    False
    >>> same_path("a", "a/b")
    False
    )normpath)r   r   s     r   	same_pathr      s      B<<8B<<''r   filenamec                d    t           j        dk    rt          j                            |           n| S )a  
    Contrary to POSIX 2008, on Cygwin, getcwd (3) contains
    symlink components. Using
    os.path.abspath() works around this limitation. A fix in os.getcwd()
    would probably better, in Cygwin even more so, except
    that this seems to be by design...
    cygwin)sysplatformr   r   abspathr   s    r   _cygwin_patchr#   *   s)     ),(@(@27??8$$$hNr   strc           	         t           j                            t           j                            t           j                            t          |                                         S )z2Normalize a file/dir name for comparison purposes.)r   r   normcaserealpathr   r#   r"   s    r   r   r   5   s@    7BG,,RW-=-=mH>U>U-V-VWWXXXr   c              #  h  K   t                      }t          j                            d|          }t          j                            dd          }	 t          j                            t          |                     }t          d||g          }t          j                            |          }|r|t          j        d<   dV  ||u r"t          j                            dd           dS |t          j        d<   dS # ||u r!t          j                            dd           n|t          j        d<   w xY w)a  
    Add the indicated paths to the head of the PYTHONPATH environment
    variable so that subprocesses will also see the packages at
    these paths.

    Do this in a context that restores the value on exit.

    >>> getfixture('monkeypatch').setenv('PYTHONPATH', 'anything')
    >>> with paths_on_pythonpath(['foo', 'bar']):
    ...     assert 'foo' in os.environ['PYTHONPATH']
    ...     assert 'anything' in os.environ['PYTHONPATH']
    >>> os.environ['PYTHONPATH']
    'anything'

    >>> getfixture('monkeypatch').delenv('PYTHONPATH')
    >>> with paths_on_pythonpath(['foo', 'bar']):
    ...     assert 'foo' in os.environ['PYTHONPATH']
    >>> os.environ.get('PYTHONPATH')
    
PYTHONPATH N)	objectr   environgetpathsepjoinr   filterpop)pathsnothingorig_pythonpathcurrent_pythonpathprefixto_joinnew_paths          r   paths_on_pythonpathr9   :   s     * hhGjnn\7;;Ob997!7!788(:;<<:??7++ 	0'/BJ|$g%%JNN<.....'6BJ|$$$ g%%JNN<....'6BJ|$6666s   A2C; ;6D1)r   r	   r   r	   r   r   )r   r	   )r   r	   r   r$   )
__future__r   
contextlibr   r   typingr   r   r   more_itertoolsr   typing_extensionsr   r$   PathLiker	   __annotations__r
   r   r   r#   r   contextmanagerr9    r   r   <module>rC      sE   " " " " " " "     				 



 0 0 0 0 0 0 0 0 0 0 * * * * * * ,++++++3C 001 1 1 1 17:U3C0@+@%ABBB( ( (( ( ( (&O O O OY Y Y Y
 "7 "7 "7 "7 "7r   