sparse-lifeguard-95737
04/29/2022, 8:37 PMimport-linter
, and trying to debug rule graph errors in the integration tests. I basically copy-paste-adjusted the setups from mypy
and flake8
to set things up. the errors I’m seeing look like:
No source of dependency ImportLinter for @rule(pants.backend.python.lint.import_linter.rules:88:import_linter_lint_partition(ImportLinterPartition, ImportLinterConfigFile, ImportLinterCustomContracts, ImportLinter) -> LintResult, gets=[Get(PythonSourceFiles, PythonSourceFilesRequest), Get(Pex, RequirementsPexRequest), Get(VenvPex, PexRequest), Get(Digest, MergeDigests), Get(FallibleProcessResult, VenvPexProcess)]). All potential sources were eliminated: []
there’s a separate error like ^^^ for every input type to import_linter_lint_partition
. the stacktrace is coming out of my pytest.fixture
for setting up a rule runner:
@pytest.fixture
def rule_runner() -> RuleRunner:
return RuleRunner(
rules=[
*import_linter_rules(),
*import_linter_subsystem_rules(),
*dependency_inference_rules.rules(),
*config_files.rules(),
*target_types_rules.rules(),
QueryRule(LintResults, [ImportLinterRequest]),
],
target_types=[PythonSourcesGeneratorTarget, PythonRequirementTarget, PythonSourceTarget],
)
any tips to help me debug what’s wrong with the setup? I keep wondering if the empty array in All potential sources were eliminated: []
is a sign that the rules aren’t getting collected properlywitty-crayon-22786
04/29/2022, 8:59 PMImportLinter
is a subsystem that you’re expecting to be able to consume? is it registered with SubsystemRule
…? that’s sometimes necessary when it’s in its own file.sparse-lifeguard-95737
04/29/2022, 9:03 PMSubsystemRule
👀witty-crayon-22786
04/29/2022, 9:04 PM@rule
without the SubsystemRule
, but that can failwitty-crayon-22786
04/29/2022, 9:05 PMsparse-lifeguard-95737
04/29/2022, 9:06 PMGet(VenvPex, PexRequest)
). will make the draftwitty-crayon-22786
04/29/2022, 9:07 PMsparse-lifeguard-95737
04/29/2022, 9:08 PMsparse-lifeguard-95737
04/29/2022, 9:10 PMmypy
and flake8
plugins - if you see any puzzling choices in the draft, it’s likely caused by me not quite knowing what I’m doing 🙂witty-crayon-22786
04/29/2022, 9:22 PMsparse-lifeguard-95737
04/29/2022, 9:31 PM