From fcb3c3a26e40b435fb782a55e43a127856bf385e Mon Sep 17 00:00:00 2001 From: Andreas Stenius Date: Fri, 9 Jul 2021 14:09:59 +0200 Subject: [PATCH] test_inject_python_distribution_dependencies: fix test issue. # 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/python/target_types_rules.py | 1 + src/python/pants/backend/python/target_types_test.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/python/pants/backend/python/target_types_rules.py b/src/python/pants/backend/python/target_types_rules.py index 82ee3fb753d2..ca457141870e 100644 --- a/src/python/pants/backend/python/target_types_rules.py +++ b/src/python/pants/backend/python/target_types_rules.py @@ -209,6 +209,7 @@ async def inject_python_distribution_dependencies( original_tgt.target[PythonDistributionEntryPoints] ), ) + entry_point_addresses = Addresses() if entry_points.val and python_infer_subsystem.entry_points: diff --git a/src/python/pants/backend/python/target_types_test.py b/src/python/pants/backend/python/target_types_test.py index 211bcaa10c0e..1aaa00695159 100644 --- a/src/python/pants/backend/python/target_types_test.py +++ b/src/python/pants/backend/python/target_types_test.py @@ -41,7 +41,9 @@ inject_pex_binary_entry_point_dependency, inject_python_distribution_dependencies, resolve_pex_entry_point, + resolve_python_distribution_entry_points, ) +from pants.backend.python.util_rules import python_sources from pants.engine.addresses import Address from pants.engine.internals.scheduler import ExecutionError from pants.engine.target import ( @@ -343,7 +345,10 @@ def test_inject_python_distribution_dependencies() -> None: rule_runner = RuleRunner( rules=[ inject_python_distribution_dependencies, + resolve_pex_entry_point, + resolve_python_distribution_entry_points, *import_rules(), + *python_sources.rules(), QueryRule(InjectedDependencies, [InjectPythonDistributionDependencies]), ], target_types=[PythonDistribution, PythonRequirementLibrary, PythonLibrary, PexBinary],