
    ,h                         d Z ddlZddlZddlZddl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mZ e
j                  j                  d       G d d             Z G d d	      Zd
 Zd Zd Zd Zy)z&Support code for distutils test cases.    N)Distribution)always_iterabledistutils_managed_tempdirc                   &    e Zd ZdZd ZddZddZy)TempdirManagerzI
    Mix-in class that handles temporary directories for test cases.
    c                 d    t        j                         }| j                  j                  |       |S )zjCreate a temporary directory that will be cleaned up.

        Returns the path of the directory.
        )tempfilemkdtemptempdirsappend)selfds     e/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/setuptools/_distutils/tests/support.pyr
   zTempdirManager.mkdtemp   s)    
 Q    c                 \    t        j                  t        |       j                  |d       y)zVWrites a file in the given path.

        path can be a string or a sequence.
        zutf-8)encodingN)pathlibPathr   
write_text)r   pathcontents      r   
write_filezTempdirManager.write_file   s%    
 	od+,77'7Rr   c                     | j                         }t        j                  j                  ||      }t        j                  |       t        |      }||fS )a  Will generate a test environment.

        This function creates:
         - a Distribution instance using keywords
         - a temporary directory with a package structure

        It returns the package directory and the distribution
        instance.
        )attrs)r
   osr   joinmkdirr   )r   pkg_namekwtmp_dirpkg_dirdists         r   create_distzTempdirManager.create_dist&   sC     ,,.'',,w1
"%}r   N)xxx)foo)__name__
__module____qualname____doc__r
   r   r#    r   r   r   r      s    Sr   r   c                       e Zd ZdZd Zd Zy)DummyCommandzAClass to store options for retrieval via set_undefined_options().c                 8    t        |       j                  |       y N)varsupdate)r   kwargss     r   __init__zDummyCommand.__init__;   s    T
&!r   c                      y r.   r*   )r   s    r   ensure_finalizedzDummyCommand.ensure_finalized>   s    r   N)r&   r'   r(   r)   r2   r4   r*   r   r   r,   r,   8   s    K"r   r,   c                 |    t        j                  t               t        j                  j                  | d             y)ak  Helper for tests that need the xxmodule.c source file.

    Example use:

        def test_compile(self):
            copy_xxmodule_c(self.tmpdir)
            self.assertIn('xxmodule.c', os.listdir(self.tmpdir))

    If the source file can be found, it will be copied to *directory*.  If not,
    the test will be skipped.  Errors during copy are not caught.
    
xxmodule.cN)shutilcopy_get_xxmodule_pathr   r   r   )	directorys    r   copy_xxmodule_cr;   B   s%     KK"$bggll9l&KLr   c                      t         j                  dkD  rdnd} t        j                  j	                  t        j                  j                  t              |       S )N)   	   r6   zxxmodule-3.8.c)sysversion_infor   r   r   dirname__file__)source_names    r   r9   r9   Q   s9    "%"2"2V";,AQK77<<1;??r   c                    t         j                  dk(  r%t        j                  j	                  d      | _        yt        j                  d      rt        j                  d      }|	dg| _        yt        j                  dk(  rg | _        y|j                  d      \  }}}|j                  t         j                        D cg c]  }|s|	 c}| _        yyc c}w )	a  Function needed to make build_ext tests pass.

    When Python was built with --enable-shared on Unix, -L. is not enough to
    find libpython<blah>.so, because regrtest runs in a tempdir, not in the
    source directory where the .so lives.

    When Python was built with in debug mode on Windows, build_ext commands
    need their debug attribute set, and it is not done automatically for
    some reason.

    This function handles both of these things.  Example use:

        cmd = build_ext(dist)
        support.fixup_build_ext(cmd)
        cmd.ensure_finalized()

    Unlike most other Unix platforms, Mac OS X embeds absolute paths
    to shared libraries into executables, so the fixup is not needed there.
    ntz_d.exePy_ENABLE_SHARED	RUNSHAREDN.darwin=)r   namer?   
executableendswithdebug	sysconfigget_config_varlibrary_dirsplatform	partitionsplitpathsep)cmd	runsharedrK   equalsvaluer   s         r   fixup_build_extrZ   V   s    ( 
ww$NN++H5			!	!"4	5 ,,[9	 #uC||x'#% &/&9&9#&>#fe/4{{2::/F#L!!A#L  
6 $Ms   ?CCc           	          t        j                  | g| j                        D cg c]  }t        |dg       D ]  }|  c}}| _        | S c c}}w )z
    pytest will honor markers as found on the class, but when
    markers are on multiple subclasses, only one appears. Use
    this decorator to combine those markers.
    
pytestmark)	itertoolschain	__bases__getattrr\   )clsbasemarks      r   combine_markersrd   {   sY     OOSE3==9D,3  	CN
 Js   A)r)   r]   r   r   r7   r?   rO   r	   distutils.corer   pytestmore_itertoolsr   rc   usefixturesr   r,   r;   r9   rZ   rd   r*   r   r   <module>ri      sr    ,  	   
   '  * 45$ $ 6$N M@
"MJr   