Python Parameters
Pip, Pipenv, Poetry
Note the following:
Make sure that the project directory contains at least one Python extension file (it can be located in any directory, not only in the root directory).
The Unified Agent runs the command 'pip download -r requirements.txt' for every 'requirements.txt' file that it finds within the project directories (the file can reside either in the root or in a nested directory).
In some scenarios, the Unified Agent might skip pyproject.toml files and print a DEBUG log entry about it. For more information, please refer to the known limitations page.
Configuration File Parameter | Description and Expected Behavior | If True | If False | Default | Command Line Parameter Available? |
---|---|---|---|---|---|
python.resolveDependencies | Whether to resolve python dependencies. "requirements.txt" or "pipfile" are required. | Resolves python dependencies | Will not resolve python dependencies. | True | No |
python.ignoreSourceFiles | When using the dependency resolver, it will only include package dependencies, not source files. NOTE: Only relevant when fileSystemScan is true. | Ignores *.py files in scan. | Will not ignore files which have ".py" extension. | True | No |
python.ignorePipInstallErrors | Whether to ignore errors of 'pip download -r requirements.txt' command. | Ignores download errors, and try to download packages one by one | Will consider such errors and react accordingly | False | No |
python.installVirtualenv | Whether to install the virtualenv package on --user. | Installs the virtualenv package by running "python -m pip install --user virtualenv" | Will not install the virtualenv package | False | No |
python.resolveHierarchyTree | Whether to resolve the hierarchy tree or a flat list of dependencies, requires "requirements.txt" like files. | Will install pipdeptree and use it to resolve and find the dependency hierarchy tree | Will resolve a flat list only | True | No |
python.requirementsFileIncludes | A comma or space-delimited list of dependency filenames specifying which files to be scanned for dependencies, instead of "requirements.txt", when using pip package manager. There are 4 supported values:
| N/A | N/A | requirements.txt | No |
python.resolveSetupFiles | Whether to resolve setup.py and setup.cfg files as part of the dependencies detection. IMPORTANT: This parameter is new for version 22.5.1 and replaces the soon-to-be-deprecated python.resolveSetupPyFiles. | setup.py and setup.cfg files are resolved | setup.py and setup.cfg files are not resolved | False | No |
python.resolveSetupPyFiles | Whether to resolve python dependencies in setup.py files, and if so, it executes the setup.py script in order to install and resolve dependencies. | Executes setup.py in order to install and resolve dependencies | Will ignore setup.py files | False | No |
python.runPipenvPreStep | Whether to run pipenv install command. If so, it requires "pipfile". | Runs the 'pipenv install' command. | Will not run the command | False | No |
python.pipenvDevDependencies | Whether or not to install "dev" dependencies, if so it requires "python.runPipenvPreStep=true" | Adds --dev to the command, resulting in: "pipenv install --dev" | Will not add --dev to the command | False | No |
python.IgnorePipenvInstallErrors | Whether to ignore errors of the 'pipenv run pip download' command. | Ignores download errors, and try to download packages one by one | Will consider such errors and react accordingly | False | No |
python.resolveGlobalPackages | Whether to resolve global packages or not. If so, it requires global package folders called site-packages or dist-packages in your scan directory. | If set to True and there is a site-packages or dist-packages folder, the resolution will be based on the packages under those folders. | Will not resolve global packages | False | No |
python.resolvePipEditablePackages | The parameter handles requirements.txt files with rows (packages) with the -e flag. | Resolves the dev dependencies on the first scan. | Will not resolve the dev dependencies on the first scan. | False | No |
python.resolvePoetryEditablePackages | The parameter handles requirements.txt files with rows (packages) with the -e flag. | Resolves the dev dependencies on the first scan. | Will not resolve the dev dependencies on the first scan. | False | No |
python.path | Points to the python executable path. If the executable path is already set in the environment variables, then just the executable name can be defined, e.g. in Linux "python2.7". NOTE: This parameter replaces "python" executable with the value defined. | N/A | N/A | python | No |
python.pipPath | Enables you to use different versions of pip. If set to pip3, will run "pip3" and "python -m pip3" instead of "pip" and "python -m pip". | N/A | N/A | pip | No |
python.runPoetryPreStep | Whether to run "poetry install" command. | Will run the "poetry install" command | Will not run the "poetry install" command | False | No |
python.includePoetryDevDependencies | Whether to scan Poetry project dev dependencies. | Scans Poetry project dev dependencies | Will ignore dev dependencies | False | No |
python.localPackagePathsToInstall | A space-delimited list of local package paths that will be installed during the pre-step, if is required. | N/A | N/A | Empty | No |
python.indexUrl | The local Pypi repository url, besides the official Pypi repository. Use if you have dependencies downloaded from a different source than the default pypi. | N/A | N/A | No | |
python.includePipenvDevDependencies | Enables you to include or exclude dev dependencies. | Include dev dependencies in the resolution. | Exclude dev dependencies in the resolution. | True | No |
Conda
Configuration File Parameter | Description and Expected Behavior | If True | If False | Default | Command Line Parameter Available? |
---|---|---|---|---|---|
conda.resolveDependencies | Whether to resolve conda dependencies. "environment.yml" is required. | Resolves conda dependencies. | Will not resolve conda dependencies. | True | No |