示例#1
0
 def rules(cls):
     return super().rules() + [
         RootRule(A),
         # B is both a RootRule and an intermediate product here.
         RootRule(B),
         RootRule(C),
         RootRule(UnionX),
         error_msg_test_rule,
         consumes_a_and_b,
         transitive_b_c,
         transitive_coroutine_rule,
         dataclass_rule,
         RootRule(FrozenAfterInit),
         use_frozen_after_init_object,
         RootRule(FrozenFieldsDataclass),
         RootRule(UnionWrapper),
         UnionRule(UnionBase, UnionA),
         UnionRule(UnionWithNonMemberErrorMsg, UnionX),
         RootRule(UnionA),
         select_union_a,
         UnionRule(union_base=UnionBase, union_member=UnionB),
         RootRule(UnionB),
         select_union_b,
         a_union_test,
     ]
示例#2
0
文件: repl.py 项目: wisechengyi/pants
def rules():
    return [
        subsystem_rule(IPython),
        UnionRule(ReplImplementation, PythonRepl),
        UnionRule(ReplImplementation, IPythonRepl),
        run_python_repl,
        run_ipython_repl,
    ]
示例#3
0
def rules():
    return [
        setup_black,
        create_black_request,
        fmt,
        lint,
        subsystem_rule(Black),
        UnionRule(PythonFormatTarget, BlackTarget),
        UnionRule(PythonLintTarget, BlackTarget),
    ]
示例#4
0
def rules():
    return [
        setup_isort,
        create_isort_request,
        fmt,
        lint,
        subsystem_rule(Isort),
        UnionRule(PythonFormatTarget, IsortTarget),
        UnionRule(PythonLintTarget, IsortTarget),
    ]
def rules():
    return [
        target_adaptor,
        app_adaptor,
        binary_adaptor,
        tests_adaptor,
        plugin_adaptor,
        UnionRule(TargetWithSources, PythonTargetAdaptor),
        UnionRule(TargetWithSources, PythonAppAdaptor),
        UnionRule(TargetWithSources, PythonBinaryAdaptor),
        UnionRule(TargetWithSources, PythonTestsAdaptor),
        UnionRule(TargetWithSources, PantsPluginAdaptor),
    ]
示例#6
0
def rules():
    return [
        format_python_target,
        target_adaptor,
        app_adaptor,
        binary_adaptor,
        tests_adaptor,
        plugin_adaptor,
        UnionRule(FormatTarget, PythonTargetAdaptor),
        UnionRule(FormatTarget, PythonAppAdaptor),
        UnionRule(FormatTarget, PythonBinaryAdaptor),
        UnionRule(FormatTarget, PythonTestsAdaptor),
        UnionRule(FormatTarget, PantsPluginAdaptor),
    ]
示例#7
0
def rules():
    return [
        setup_black,
        create_black_request,
        fmt,
        lint,
        subsystem_rule(Black),
        UnionRule(PythonFormatTarget, BlackTarget),
        UnionRule(PythonLintTarget, BlackTarget),
        *download_pex_bin.rules(),
        *pex.rules(),
        *python_native_code.rules(),
        *subprocess_environment.rules(),
    ]
示例#8
0
def rules():
    return [
        setup,
        fmt,
        lint,
        subsystem_rule(Docformatter),
        UnionRule(PythonFormatter, DocformatterFormatter),
        UnionRule(Linter, DocformatterFormatter),
        *download_pex_bin.rules(),
        *determine_source_files.rules(),
        *pex.rules(),
        *python_native_code.rules(),
        *strip_source_roots.rules(),
        *subprocess_environment.rules(),
    ]
示例#9
0
def rules():
    return [
        target_adaptor,
        app_adaptor,
        binary_adaptor,
        tests_adaptor,
        plugin_adaptor,
        run_black,
        UnionRule(FmtTarget, PythonTargetAdaptor),
        UnionRule(FmtTarget, PythonAppAdaptor),
        UnionRule(FmtTarget, PythonBinaryAdaptor),
        UnionRule(FmtTarget, PythonTestsAdaptor),
        UnionRule(FmtTarget, PantsPluginAdaptor),
        optionable_rule(Black),
        optionable_rule(PythonSetup),
    ]
示例#10
0
def rules():
    return [
        run_python_test,
        UnionRule(TestTarget, PythonTestsAdaptor),
        optionable_rule(PyTest),
        optionable_rule(PythonSetup),
    ]
示例#11
0
    def test_register_union_rules(self):
        # Two calls to register_rules should merge relevant unions.
        @union
        class Base:
            pass

        class A:
            pass

        class B:
            pass

        self.build_configuration.register_rules([UnionRule(Base, A)])
        self.build_configuration.register_rules([UnionRule(Base, B)])
        self.assertEqual(set(self.build_configuration.union_rules()[Base]),
                         {A, B})
示例#12
0
def rules():
    return [
        lint_python_target, target_adaptor, app_adaptor, binary_adaptor,
        tests_adaptor, plugin_adaptor,
        *(RootRule(target_type) for target_type in PYTHON_TARGET_TYPES),
        *(UnionRule(LintTarget, target_type)
          for target_type in PYTHON_TARGET_TYPES)
    ]
示例#13
0
def rules():
    return [
        run_python_test,
        debug_python_test,
        setup_pytest_for_target,
        UnionRule(TestTarget, PythonTestsAdaptorWithOrigin),
        subsystem_rule(PyTest),
        subsystem_rule(PythonSetup),
    ]
示例#14
0
def rules():
    return [
        run_python_test,
        debug_python_test,
        setup_pytest_for_target,
        UnionRule(TestConfiguration, PythonTestConfiguration),
        subsystem_rule(PyTest),
        subsystem_rule(PythonSetup),
    ]
示例#15
0
def rules():
    return [
        run_python_test,
        debug_python_test,
        setup_pytest_for_target,
        UnionRule(TestRunner, PytestRunner),
        subsystem_rule(PyTest),
        subsystem_rule(PythonSetup),
    ]
示例#16
0
def rules():
    return [
        target_adaptor,
        app_adaptor,
        binary_adaptor,
        tests_adaptor,
        plugin_adaptor,
        get_black_input,
        fmt_with_black,
        lint_with_black,
        UnionRule(TargetWithSources, PythonTargetAdaptor),
        UnionRule(TargetWithSources, PythonAppAdaptor),
        UnionRule(TargetWithSources, PythonBinaryAdaptor),
        UnionRule(TargetWithSources, PythonTestsAdaptor),
        UnionRule(TargetWithSources, PantsPluginAdaptor),
        optionable_rule(Black),
        optionable_rule(PythonSetup),
    ]
示例#17
0
 def rules(cls):
     return super(SchedulerTest, cls).rules() + [
         RootRule(A),
         # B is both a RootRule and an intermediate product here.
         RootRule(B),
         RootRule(C),
         consumes_a_and_b,
         transitive_b_c,
         transitive_coroutine_rule,
         RootRule(UnionWrapper),
         UnionRule(UnionBase, UnionA),
         RootRule(UnionA),
         select_union_a,
         UnionRule(union_base=UnionBase, union_member=UnionB),
         RootRule(UnionB),
         select_union_b,
         a_union_test,
     ]
示例#18
0
def rules():
    return [
        lint,
        subsystem_rule(Bandit),
        UnionRule(PythonLintTarget, BanditTarget),
        *download_pex_bin.rules(),
        *pex.rules(),
        *python_native_code.rules(),
        *subprocess_environment.rules(),
    ]
示例#19
0
def rules():
    return [
        RootRule(PytestCoverageDataBatch),
        RootRule(CoveragercRequest),
        construct_coverage_config,
        generate_coverage_report,
        merge_coverage_data,
        subsystem_rule(PytestCoverage),
        setup_coverage,
        UnionRule(CoverageDataBatch, PytestCoverageDataBatch),
    ]
示例#20
0
 def rules(cls):
     return super().rules() + [
         RootRule(A),
         # B is both a RootRule and an intermediate product here.
         RootRule(B),
         RootRule(C),
         RootRule(UnionX),
         error_msg_test_rule,
         consumes_a_and_b,
         transitive_b_c,
         transitive_coroutine_rule,
         RootRule(UnionWrapper),
         UnionRule(UnionBase, UnionA),
         UnionRule(UnionWithNonMemberErrorMsg, UnionX),
         RootRule(UnionA),
         select_union_a,
         UnionRule(union_base=UnionBase, union_member=UnionB),
         RootRule(UnionB),
         select_union_b,
         a_union_test,
     ]
示例#21
0
def rules():
    return [
        lint,
        subsystem_rule(Flake8),
        UnionRule(Linter, Flake8Linter),
        *download_pex_bin.rules(),
        *determine_source_files.rules(),
        *pex.rules(),
        *python_native_code.rules(),
        *strip_source_roots.rules(),
        *subprocess_environment.rules(),
    ]
示例#22
0
def rules():
    return [
        pylint_lint,
        subsystem_rule(Pylint),
        UnionRule(Linter, PylintLinter),
        *download_pex_bin.rules(),
        *determine_source_files.rules(),
        *pex.rules(),
        *importable_python_sources.rules(),
        *strip_source_roots.rules(),
        *python_native_code.rules(),
        *subprocess_environment.rules(),
    ]
示例#23
0
def rules():
    return [
        create_python_awslambda,
        setup_lambdex,
        UnionRule(AWSLambdaTarget, PythonAWSLambdaAdaptor),
        subsystem_rule(Lambdex),
        *download_pex_bin.rules(),
        *importable_python_sources.rules(),
        *pex.rules(),
        *pex_from_targets.rules(),
        *python_native_code.rules(),
        *strip_source_roots.rules(),
        *subprocess_environment.rules(),
    ]
示例#24
0
def rules():
    return [
        UnionRule(BinaryTarget, PythonBinaryAdaptor),
        create_python_binary,
    ]
示例#25
0
文件: structs.py 项目: tushar19/pants
def rules():
    return [
        UnionRule(HydrateableField, SourcesField),
        UnionRule(HydrateableField, BundlesField),
    ]
示例#26
0
def rules():
    return [
        lint,
        subsystem_rule(Flake8),
        UnionRule(PythonLintTarget, Flake8Target)
    ]
示例#27
0
def rules():
    return [
        format_python_target,
        UnionRule(LanguageFormatters, PythonFormatters)
    ]
示例#28
0
文件: rules.py 项目: grimreaper/pants
def rules():
  return [lint, optionable_rule(Flake8), UnionRule(PythonLintTarget, Flake8Target)]
示例#29
0
def rules():
    return [
        create_python_binary,
        UnionRule(BinaryConfiguration, PythonBinaryConfiguration)
    ]
示例#30
0
def rules():
    return [
        lint,
        subsystem_rule(Bandit),
        UnionRule(PythonLintTarget, BanditTarget)
    ]