a
    d{                     @   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eejdd Zeee	dddZe	dddZeeef dddZeeef dddZ dS )    N)module_from_specspec_from_file_locationPath)
ModuleType)AnyDict)parse_requirements)find_packages.srcpytorch_lightningrequirementspytorchZFREEZE_REQUIREMENTS)namelocationreturnc                 C   sT   t | |}|s"J d|  d| t|}|jsDJ 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   d/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/pytorch_lightning/__setup__.py_load_py_module   s    
r   )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trdndddd ttjtdD }  fdd| D }t|d	 D ]}t	|g||j
< qX|d
 |d	  |d  |d< |d |d  |d< |S )Nnoneall)Zpath_dirunfreezec                 S   s   g | ]}t |qS r   r   .0pr   r   r   
<listcomp>'       z#_prepare_extras.<locals>.<listcomp>z*.txtc                    s0   i | ](}|j d vr|j jf d|j iqS ))zdocs.txtz	devel.txtzbase.txt	file_name)r   stemload_requirementsr#   r   Zcommon_argsr   r   
<dictcomp>(   s   
z#_prepare_extras.<locals>.<dictcomp>Z
strategiesextraZexamplestestdev)r   dict_PATH_REQUIREMENTS_FREEZE_REQUIREMENTSglobr   r   r   r	   strkey)Z	req_filesextrasreqr   r+   r   _prepare_extras    s    r8   c                  C   s   t  } tdtjtd}tdtjtd}| jt|j|jd}t	d|j|j
|j|j|jd|jtdg d	d
ddid|ddg dddg| jttrdnddt ddddg ddS )Naboutz__about__.pyversionz__version__.py)Zhomepager:   zpytorch-lightningz)https://github.com/Lightning-AI/lightningr   )r   zpytorch_lightning.*Zlightning_fabriczlightning_fabric.*)whereinclude Tztext/markdownF)zdeep learningr   ZAIz>=3.7wheelr    r!   )r"   z0https://github.com/Lightning-AI/lightning/issuesz,https://pytorch-lightning.rtfd.io/en/latest/)zBug TrackerZ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.7z%Programming Language :: Python :: 3.8z%Programming Language :: Python :: 3.9z&Programming Language :: Python :: 3.10)r   r:   descriptionauthorauthor_emailurldownload_urllicensepackagespackage_dirZinclude_package_datalong_descriptionZlong_description_content_typeZzip_safekeywordsZpython_requiresZsetup_requiresZinstall_requiresZextras_requireproject_urlsclassifiers)r   r   r   r   r   _PACKAGE_ROOTZload_readme_descriptionZ__homepage__r:   r0   Z__docs__
__author____author_email____license__r
   r*   r1   r2   r8   )r   r9   r:   rG   r   r   r   _setup_args4   sJ    
	rO   )!r3   os.pathr   Zimportlib.utilr   r   pathlibr   typesr   typingr   r   pkg_resourcesr	   
setuptoolsr
   r   r   r   Z_SOURCE_ROOTrK   r1   boolintenvirongetr2   r4   r   r   r8   rO   r   r   r   r   <module>   s    	