U
    Åmœd&  ã                
   @   sŽ   d dl Z d dlmZ eeƒjZdd„ Zz"d dlmZ eƒ  eded�Z	W n8 e
eefk
r€   dd	lmZ eejƒZed
 Z	Y nX dd„ ZdS )é    N)ÚPathc                  C   sJ   z0ddl } ddl}|j}| jD ]}| |¡ qW n tk
rD   Y nX dS )zÖ    Under some circumstances, (e.g. when installing a PEP 517 package via pip),
    pkg_resources.working_set.entries is stale. This tries to fix that.
    See https://github.com/pypa/setuptools_scm/issues/513
    r   N)ÚsysÚpkg_resourcesÚworking_setÚpathÚ	add_entryÚ	Exception)r   r   ÚwsÚentry© r   úI/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/scanpy/_metadata.pyÚrefresh_entry_points   s    
r   )Úget_versionz..)ÚrootÚrelative_toé   )Úpkg_metadataÚVersionc                  C   s"   t  ¡ D ]} | jdkr dS qdS )a      Checks if we are being imported by flit.
    This is necessary so flit can import __version__ without all depedencies installed.
    There are a few options to make this hack unnecessary, see:
    https://github.com/takluyver/flit/issues/253#issuecomment-737870438
    Z$get_docstring_and_version_via_importTF)Ú	tracebackÚextract_stackÚname)Úframer   r   r   Úwithin_flit$   s    
r   )r   Úpathlibr   Ú__file__ÚparentÚherer   Zsetuptools_scmr   Ú__version__ÚImportErrorÚLookupErrorÚFileNotFoundErrorZ_compatr   r   Úmetadatar   r   r   r   r   Ú<module>   s   

