bg ddlZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZdZejd Zejd Zejd Zd Zd efdZdZdZdS)N)Path)find_requirements)RequirementsNotFound)encoding)PermissionMissing) is_virtualenv)djangoceleryflaskz%^\s*from ([\._a-zA-Z0-9]+) import .*$z^\s*import ([\._a-zA-Z0-9]+)$z$^\s*import ([\._a-zA-Z0-9]+(, ){1})+ct}|dD].}t|}|rg}|d}||dd||ddD])}||*n_t|pt|}||dd}|D] }|tvr| |!0|S)N ,.) setsplit_IMPORT_MULTIPLE_REGEXmatchgroupappendstrip _IMPORT_REGEX_FROM_IMPORT_REGEXPOSSIBLE_LIBRARIESadd) file_contentsnamesliner import_namesfirstname import_names f/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/prospector/autodetect.pyfind_from_importsr%sM EEE##D))''&,,T22  5LKKNNE   crc + + + 5))!,22377 2 2##DJJLL1111 2"''--O1C1I1I$1O1OE} ;;q>>//44L' ' 'K000 +&&& ' Lpathclt} |D]}|r#t|r&|t |z}n|sx|jdkrm tj|}|t|z}nE#tj $r3}tj |j d|jtYd}~nd}~wwxYwt!|t!t"krnn"#t$$r}t'||d}~wwxYw|S)Nz.pyz: )riterdiris_dirrfind_from_path is_symlinksuffixr read_py_filer%CouldNotHandleEncodingwarningswarnr' __cause__ ImportWarninglenrPermissionErrorr)r'ritemcontentserrs r$r+r+-sa EEE/LLNN  D{{}} Q &&---__&& Q4;%+?+?Q'4T::H.x888EE6QQQMSX"@"@"@"@-PPPPPPPPQ5zzS!344445 ///%%3./ LsBA,D=&B$#D$C&3)C!D!C&&+D D1D,,D1ct|}g}|D]U}|jL|jtvr,||jV|S)N)rr"lowerrr)r'reqsr requirements r$find_from_requirementsr=Gsm T " "D E33   'K,<,B,B,D,DHZ,Z,Z LL)//11 2 2 2 Lr&c@tj|r'tj|}|dkrd}g} t |}n#t $rYnwxYwt |t tkrt|}|S)Nr) osr'isfiledirnamer=rr4rr+)r' librariess r$autodetect_librariesrDPs w~~dwt$$ 2::DI *400       9~~.////"4(( s A A'&A')r@rer0pathlibrrequirements_detectorrrequirements_detector.detectr prospectorrprospector.exceptionsrprospector.pathutilsrrcompilerrrr%r+r=rDr&r$rNs 333333======333333......2 RZ HII ;<< #$KLL.4r&