// each target runs with its own interpreter constraints. See
// http://flake8.pycqa.org/en/latest/user/invocation.html.
interpreter_constraints = PexInterpreterConstraints.create_from_adaptors(
adaptors=[adaptor] if isinstance(adaptor, PythonTargetAdaptor) else [],
python_setup=python_setup,
)
requirements_pex = await Get[Pex](
After Change
// NB: Flake8 output depends upon which Python interpreter version it"s run with. We ensure that
// each target runs with its own interpreter constraints. See
// http://flake8.pycqa.org/en/latest/user/invocation.html.
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="flake8.pex",
requirements=PexRequirements(requirements=tuple(flake8.get_requirement_specs())),
interpreter_constraints=interpreter_constraints,
entry_point=flake8.get_entry_point(),
)
)
config_path: Optional[str] = flake8.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 `--flake8-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
)
)
request = requirements_pex.create_execute_request(
python_setup=python_setup,
subprocess_encoding_environment=subprocess_encoding_environment,