
    ytf              	       `   d Z ddlZddlZddlmZmZmZ ddlZddlZ ej                  d       ej                  j                  ej                        Zd Z ed      Z ed      Zd Zej                  j%                  e      rU ej&                  e      D  cg c]9  } ej                  j)                  ej                  j+                  e|             r| ; c} Zej.                  j1                  ej                  j%                  e       d	
      ej.                  j3                  de      d               Zej                  j%                  e      r2 ej&                  e      D cg c]  }|j7                  d      s| c}Zej.                  j3                  de      d        Zyc c} w c c}w )z
Test our typing with mypy
    N)PIPESTDOUTPopenmypyc                     t         j                  j                  t         j                  j                  t              |       }t         j                  j                  |      s| }|S )zResolve a dir in the repo

    Resolved relative to zmq dir

    fallback on CWD (e.g. test run from repo, zmq installed, not -e)
    )ospathjoindirnamezmq_direxists)r	   resolved_paths     ]/var/www/html/software/conda/envs/higlass/lib/python3.12/site-packages/zmq/tests/test_mypy.pyresolve_repo_dirr      sB     GGLL!94@M 77>>-(    examples
mypy_testsc                      t        t        j                  ddgt        |       z   t        t
              }|j                         \  }}|j                  dd      }t        |       |j                  dk(  sJ |       y)zFRun mypy for a path

    Captures output and reports it on errors
    z-mr   )stdoutstderrutf8replacer   N)
r   sys
executablelistr   r   communicatedecodeprint
returncode)	mypy_argspo_outs        r   run_mypyr%   %   sh    
 		v&i8f	A ==?DAq
((69
%C	#J<<1!c!r   z!only test from examples directory)reasonexamplec                 d    t         j                  j                  t        |       }t	        d|       y Nz--disallow-untyped-calls)r   r	   r
   examples_dirr%   )r'   example_dirs     r   test_mypy_exampler,   ;   s#    
 '',,|W5K'5r   z.pyfilenamec                 `    t        dt        j                  j                  t        |              y r)   )r%   r   r	   r
   mypy_dir)r-   s    r   	test_mypyr0   H   s    'h)IJr   )__doc__r   r   
subprocessr   r   r   pytestzmqimportorskipr	   r   __file__r   r   r*   r/   r%   r   listdirisdirr
   r   markskipifparametrizer,   endswithr   r0   )dr!   s   00r   <module>r>      s}   
 
 * *  
   F 
''//#,,
'  
+L)" 77>>, L)77==lA67 	
H 
|$$-P   H-6 .6
 77>>('RZZ1GQZZ5F!GJ Z0K 1K+" Hs   >F&%F+<F+