// each target runs with its own interpreter constraints. See
// https://github.com/PyCQA/bandit//under-which-version-of-python-should-i-install-bandit.
interpreter_constraints = PexInterpreterConstraints.create_from_adaptors(
adaptors=[adaptor] if isinstance(adaptor, PythonTargetAdaptor) else [],
python_setup=python_setup,
)
requirements_pex = await Get[Pex](
After Change
if bandit.options.skip:
return LintResult.noop()
adaptors_with_origins = targets.adaptors_with_origins
// NB: Bandit output depends upon which Python interpreter version it"s run with. We ensure that
// each target runs with its own interpreter constraints. See
// https://github.com/PyCQA/bandit//under-which-version-of-python-should-i-install-bandit.
interpreter_constraints = PexInterpreterConstraints.create_from_adaptors(
(adaptor_with_origin.adaptor for adaptor_with_origin in adaptors_with_origins),
python_setup=python_setup,
)
requirements_pex = await Get[Pex](
CreatePex(
output_filename="bandit.pex",
requirements=PexRequirements(requirements=tuple(bandit.get_requirement_specs())),
interpreter_constraints=interpreter_constraints,
entry_point=bandit.get_entry_point(),
)
)
config_path: Optional[str] = bandit.options.config
config_snapshot = await Get[Snapshot](
PathGlobs(
globs=tuple([config_path] if config_path else []),
glob_match_error_behavior=GlobMatchErrorBehavior.error,
description_of_origin="the option `--bandit-config`",
)
)
all_source_files = await Get[SourceFiles](
AllSourceFilesRequest(
adaptor_with_origin.adaptor for adaptor_with_origin in adaptors_with_origins
)
)
specified_source_files = await Get[SourceFiles](
SpecifiedSourceFilesRequest(adaptors_with_origins)
)
merged_input_files = await Get[Digest](
DirectoriesToMerge(
directories=(
all_source_files.snapshot.directory_digest,
requirements_pex.directory_digest,
config_snapshot.directory_digest,
)
),
)
address_references = ", ".join(
sorted(
adaptor_with_origin.adaptor.address.reference()
for adaptor_with_origin in adaptors_with_origins
)
)