o
    zi/                     @   s   d dl Z d dlZd dlmZmZ d dlmZ d dlmZ d dl	m
Z
mZ d dlmZ d dlmZ dZejed	Zejed
ZejddZejdd dv ZdededefddZdefddZdeee
f fddZdeee
f fddZdS )    N)module_from_specspec_from_file_locationPath)
ModuleType)AnyDict)parse_requirements)find_packages.srclightning_fabricrequirementsfabricFREEZE_REQUIREMENTS0)1truenamelocationreturnc                 C   sT   t | |}|sJ d|  d| t|}|js"J d|  d| |j| |S )NzFailed to load module z from zModuleSpec.loader is None for )r   r   loaderexec_module)r   r   specpy r   N/home/ubuntu/.local/lib/python3.10/site-packages/lightning_fabric/__setup__.py_load_py_module   s   
r   c                  C   s   t jtdd} td| S )Nz.actionszassistant.py	assistant)ospathjoin_PROJECT_ROOTr   )r   r   r   r   _load_assistant   s   
r#   c                     s   t   ttrdndddd ttjtdD }  fdd| D }t|d	 D ]
}t|g||j	< q+|d	 |d
  |d< |d |d  |d< |S )Nnoneall)path_dirunfreezec                 S   s   g | ]}t |qS r   r   .0pr   r   r   
<listcomp>'   s    z#_prepare_extras.<locals>.<listcomp>z*.txtc                    s0   i | ]}|j d vr|j jdd|j iqS ))zdocs.txtzbase.txt	file_namer   )r   stemload_requirementsr(   r   common_argsr   r   
<dictcomp>(   s
    
z#_prepare_extras.<locals>.<dictcomp>
strategiesexamplestestdev)
r#   _PATH_REQUIREMENTS_FREEZE_REQUIREMENTSglobr   r    r!   r	   strkey)	req_filesextrasreqr   r/   r   _prepare_extras    s   r>   c                  C   s  t  } tdtjtd}tdtjtd}| jt|j|jd}i ddd|jd|j	d	|j
d
|jd|jddd|jdtdddgddddid|dddddddg ddd d!d"g| jttrmd#nd$d%d&d'git d(d)dd*g d+d,S )-Naboutz__about__.pyversionz__version__.py)homepager@   r   zlightning-fabricdescriptionauthorauthor_emailurldownload_urlz)https://github.com/Lightning-AI/lightninglicensepackagesr   r   zlightning_fabric.*)whereincludepackage_dir long_descriptionlong_description_content_typeztext/markdowninclude_package_dataTzip_safeFkeywords)zdeep learningpytorchAIpython_requiresz>=3.8setup_requireswheelr$   r%   )r'   console_scriptsz#fabric = lightning_fabric.cli:_mainz0https://github.com/Lightning-AI/lightning/issuesz,https://pytorch-lightning.rtfd.io/en/latest/)zBug TrackerDocumentationzSource Code)zEnvironment :: ConsolezNatural Language :: EnglishzDevelopment Status :: 4 - BetazIntended Audience :: Developersz:Topic :: Scientific/Engineering :: Artificial Intelligencez7Topic :: Scientific/Engineering :: Information Analysisz"Operating System :: OS Independentz#Programming Language :: Python :: 3z%Programming Language :: Python :: 3.8z%Programming Language :: Python :: 3.9z&Programming Language :: Python :: 3.10z&Programming Language :: Python :: 3.11)install_requiresentry_pointsextras_requireproject_urlsclassifiers)r#   r   r   r    r!   _PACKAGE_ROOTload_readme_description__homepage__r@   __docs__
__author____author_email____license__r
   r.   r6   r7   r>   )r   r?   r@   rM   r   r   r   _setup_args4   sn   
	
re   )r8   r   importlib.utilr   r   pathlibr   typesr   typingr   r   pkg_resourcesr	   
setuptoolsr
   r"   r    r!   _SOURCE_ROOTr^   r6   environgetlowerr7   r9   r   r#   r>   re   r   r   r   r   <module>   s"    	