echoing-london-29138
03/01/2022, 12:02 PMprocess_result = await Get(
FallibleProcessResult,
PexProcess(
importlinter_pex,
argv=[],
description="Running ImportLinter Playbook...",
input_digest=merged_digest,
level=LogLevel.DEBUG,
extra_env={"PYTHONPATH": ":".join(pythonpath)},
cache_scope=ProcessCacheScope.PER_RESTART_SUCCESSFUL,
),
)
hundreds-father-404
03/01/2022, 3:23 PMPYTHONPATH
, you'll use PEX_EXTRA_SYS_PATH
. First use PythonSourceFiles
to determine the source roots you should set: https://github.com/pantsbuild/pants/blob/7e97ef6dfd50a8eb0294b6ded5e67dbd7da921df/src/python/pants/backend/python/lint/pylint/rules.py#L98
Then set the env like this:
https://github.com/pantsbuild/pants/blob/7e97ef6dfd50a8eb0294b6ded5e67dbd7da921df/src/python/pants/backend/python/lint/pylint/rules.py#L164echoing-london-29138
03/01/2022, 3:36 PMechoing-london-29138
03/01/2022, 3:37 PMhundreds-father-404
03/01/2022, 3:39 PMPythonSourceFiles
to get the source roots + the source files. Use this rather than SourceFiles
or HydratedSources
. https://github.com/pantsbuild/pants/blob/7e97ef6dfd50a8eb0294b6ded5e67dbd7da921df/src/python/pants/backend/python/goals/pytest_runner.py#L187
3. The env={"PEX_EXTRA_SYS_PATH": }
lineechoing-london-29138
03/01/2022, 4:45 PM