o
    ޥi2                     @   s\   d dl Z d dlZd dlmZ d dlZd dlmZmZmZ dd Z	dd Z
dd	 Zd
d ZdS )    N)Path	find_rootset_root
setup_rootc                   C   s   t sJ tsJ tsJ d S Nr    r   r   J/home/ubuntu/.local/lib/python3.10/site-packages/tests/test_pyrootutils.pytest_pyrootutils
   s   r
   c                  C   s  t  } |  s	J t d} |  sJ t d} |  sJ t t} |  s'J t tt} |  s3J t tt} |  s?J t td} |  sJJ t tg dd} |  sXJ tt t tdd} W d    n1 snw   Y  tt t tg dd} W d    n1 sw   Y  tt t ttjjj} W d    n1 sw   Y  tt	 t g } W d    n1 sw   Y  tt	 t dg d} W d    d S 1 sw   Y  d S )	N .z.git)z
.setup.cfgzsetup.pyLICENSE)	indicatorabc)r   deffgh)absr   *   )
r   exists__file__strr   pytestraisesFileNotFoundErrorparent	TypeErrorpathr   r   r	   test_find_root   s>   

"r   c                  C   s   t t} |  s
J t| j t t| ksJ dtjvs!J t	| ddddd dtjv s1J tjd t| ks<J t t| ksFJ t	| ddddd t t| ksYJ t| t
jv sbJ d S )NPROJECT_ROOTTF)project_root_env_vardotenv
pythonpathcwd)r   r   r   oschdirr   getcwdr   environr   sysr   r   r   r   r	   test_set_root9   s   r)   c                  C   s   t t} |  s
J d S r   )r   r   r   r   r   r   r	   test_setup_rootM   s   r*   )r$   r(   pathlibr   r   pyrootutilsr   r   r   r
   r   r)   r*   r   r   r   r	   <module>   s    )