python-infer
Options controlling which dependencies will be inferred for Python targets.
Backend: ``
Config section: [python-infer]
Basic options
conftests
--[no-]python-infer-conftestsPANTS_PYTHON_INFER_CONFTESTS[python-infer]
conftests = <bool>
TrueInfer a test target's dependencies on any conftest.py files in the current directory and ancestor directories.
entry_points
--[no-]python-infer-entry-pointsPANTS_PYTHON_INFER_ENTRY_POINTS[python-infer]
entry_points = <bool>
TrueInfer dependencies on targets' entry points, e.g. pex_binary's entry_point field, python_awslambda's handler field and python_distribution's entry_points field.
imports
--[no-]python-infer-importsPANTS_PYTHON_INFER_IMPORTS[python-infer]
imports = <bool>
TrueInfer a target's imported dependencies by parsing import statements from sources.
inits
--[no-]python-infer-initsPANTS_PYTHON_INFER_INITS[python-infer]
inits = <bool>
FalseInfer a target's dependencies on any __init__.py files in the packages it is located in (recursively upward in the directory structure).
Even if this is disabled, Pants will still include any ancestor __init__.py files, only they will not be 'proper' dependencies, e.g. they will not show up in ./pants dependencies and their own dependencies will not be used.
If you have empty __init__.py files, it's safe to leave this option off; otherwise, you should enable this option.
string_imports
--[no-]python-infer-string-importsPANTS_PYTHON_INFER_STRING_IMPORTS[python-infer]
string_imports = <bool>
FalseInfer a target's dependencies based on strings that look like dynamic dependencies, such as Django settings files expressing dependencies as strings. To ignore any false positives, put !{bad_address} in the dependencies field of your target.
string_imports_min_dots
--python-infer-string-imports-min-dots=<int>PANTS_PYTHON_INFER_STRING_IMPORTS_MIN_DOTS[python-infer]
string_imports_min_dots = <int>
2If --string-imports is True, treat valid-looking strings with at least this many dots in them as potential dynamic dependencies. E.g., 'foo.bar.Baz' will be treated as a potential dependency if this option is set to 2 but not if set to 3.
Advanced options
None
Deprecated options
None
Related subsystems
None