§ |<ˆjø ã ó — d dl Z d dlmZ d dlmZmZ d dlZddlmZm Z ddl mZ ddlm Z ddlmZ g d ¢Zd Zeeef Zdedee fd „Zdedee fd„Zdedee fd„Zdedee fd„Zdedee fd„ZdS )é N)ÚPath)ÚListÚUnioné )ÚCouldNotParseRequirementsÚRequirementsNotFound)Ú from_setup_py)Úparse_constraint)ÚDetectedRequirement)Úfind_requirementsÚfrom_requirements_txtÚfrom_requirements_dirÚfrom_requirements_blobÚfrom_pyproject_tomlr r r )z-iz--index-urlz--extra-index-urlz --no-indexz-fz--find-linksz-rÚpathÚreturnc óì — g }t | t ¦ « rt | ¦ « } | dz }| ¦ « rJ| ¦ « r6 t |¦ « }| ¦ « |S # t $ r Y nw xY w| dz }| ¦ « r^| ¦ « rJ t |¦ « }t |¦ « dk r| ¦ « |S n# t $ r Y nw xY wdD ]M}| |z }|j r?| ¦ « r+ |t |¦ « z }Œ6# t $ r }Y d}~ŒEd}~ww xY wŒN| dz }| ¦ « r*| ¦ « rt |¦ « }|�||z }t | ¦ « } | �|| z }t t |¦ « ¦ « }t |¦ « dk r| ¦ « |S t ‚)a¶ This method tries to determine the requirements of a particular project by inspecting the possible places that they could be defined. It will attempt, in order: 1) to parse setup.py in the root for an install_requires value 2) to read a requirements.txt file or a requirements.pip in the root 3) to read all .txt files in a folder called 'requirements' in the root 4) to read files matching "*requirements*.txt" and "*reqs*.txt" in the root, excluding any starting or ending with 'test' If one of these succeeds, then a list of pkg_resources.Requirement's will be returned. If none can be found, then a RequirementsNotFound will be raised zsetup.pyzpyproject.tomlr )zrequirements.txtzrequirements.pipNÚrequirements)Ú isinstanceÚstrr ÚexistsÚis_filer Úsortr r Úlenr Úis_dirr r ÚlistÚsetr ) r r Úsetup_pyÚpoetry_tomlÚreqfile_nameÚreqfileÚeÚrequirements_dirÚfrom_dirÚ from_blobs ún/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/requirements_detector/detect.pyr r &