o
    8wi                     @   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 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)parse_requirements)find_packages.srcpytorch_lightningrequirementspytorch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   X/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/pytorch_lightning/__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  |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extra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g d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$t d%d&dd'g d(d)S )*Naboutz__about__.pyversionz__version__.py)homepager@   r   zpytorch-lightningdescriptionauthorauthor_emailurldownload_urlz)https://github.com/Lightning-AI/lightninglicensepackagesr   )r   zpytorch_lightning.*lightning_fabriczlightning_fabric.*)whereincludepackage_dir include_package_dataTlong_descriptionlong_description_content_typeztext/markdownzip_safeFkeywords)zdeep learningr   AIpython_requiresz>=3.9setup_requireswheelr#   r$   )r&   z8https://github.com/Lightning-AI/pytorch-lightning/issuesz,https://pytorch-lightning.rtfd.io/en/latest/)zBug TrackerDocumentationzSource Code)zEnvironment :: ConsolezNatural Language :: Englishz+Development Status :: 5 - Production/StablezIntended Audience :: Developersz:Topic :: Scientific/Engineering :: Artificial Intelligencez4Topic :: Scientific/Engineering :: Image Recognitionz7Topic :: Scientific/Engineering :: Information Analysisz2License :: OSI Approved :: Apache Software Licensez"Operating System :: OS Independentz#Programming Language :: Python :: 3z%Programming Language :: Python :: 3.9z&Programming Language :: Python :: 3.10z&Programming Language :: Python :: 3.11z&Programming Language :: Python :: 3.12)install_requires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@   rO   r   r   r   _setup_args4   sl   
	rc   ) r8   os.pathr   importlib.utilr   r   pathlibr   typesr   typingr   pkg_resourcesr   
setuptoolsr	   r!   r   r    _SOURCE_ROOTr\   r6   environgetlowerr7   r9   r   r"   dictr>   rc   r   r   r   r   <module>   s"    	