From 60403ab9522b5c64142c67cc8ce653e6840e4093 Mon Sep 17 00:00:00 2001 From: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> Date: Thu, 29 Apr 2021 11:31:03 -0700 Subject: [PATCH 1/2] Add back `interpreter_constraints` field to `pex_binary` (#11977) This should not have been deprecated in 2.2.x - that was a mistake. Even though `pex_binary` no longer has a `sources` field, it is still sensible to want to change the interpreter constraints for a binary. For example, it is totally valid to have a `pex_binary` with no first party code and only 3rd party reqs, and to want to set the constraints for that. [ci skip-rust] [ci skip-build-wheels] --- src/python/pants/backend/python/target_types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/python/pants/backend/python/target_types.py b/src/python/pants/backend/python/target_types.py index dceee9b1f7e..1c44aa39f6d 100644 --- a/src/python/pants/backend/python/target_types.py +++ b/src/python/pants/backend/python/target_types.py @@ -372,6 +372,7 @@ class PexBinary(Target): core_fields = ( *COMMON_TARGET_FIELDS, OutputPathField, + InterpreterConstraintsField, PexBinaryDependencies, PexEntryPointField, PexPlatformsField, From a89e9651893116038bcd198c9e5f847e6e8149de Mon Sep 17 00:00:00 2001 From: Eric Arellano Date: Thu, 29 Apr 2021 11:35:42 -0700 Subject: [PATCH 2/2] Add back to python_awslambda too # Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels] --- src/python/pants/backend/awslambda/python/target_types.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/python/pants/backend/awslambda/python/target_types.py b/src/python/pants/backend/awslambda/python/target_types.py index 76d327acb51..bcfd1126e88 100644 --- a/src/python/pants/backend/awslambda/python/target_types.py +++ b/src/python/pants/backend/awslambda/python/target_types.py @@ -8,6 +8,7 @@ from pants.backend.python.dependency_inference.module_mapper import PythonModule, PythonModuleOwners from pants.backend.python.dependency_inference.rules import PythonInferSubsystem, import_rules +from pants.backend.python.target_types import InterpreterConstraintsField from pants.core.goals.package import OutputPathField from pants.engine.addresses import Address from pants.engine.fs import GlobMatchErrorBehavior, PathGlobs, Paths @@ -189,6 +190,7 @@ class PythonAWSLambda(Target): core_fields = ( *COMMON_TARGET_FIELDS, OutputPathField, + InterpreterConstraintsField, PythonAwsLambdaDependencies, PythonAwsLambdaHandlerField, PythonAwsLambdaRuntime,