Exemplo n.º 1
0
def rule_runner() -> RuleRunner:
    rule_runner = RuleRunner(
        rules=[
            *repl_rules(),
            *ipython_subsystem_rules(),
            *python_repl.rules(),
            *pex_from_targets.rules(),
            *local_dists.rules(),
            *target_types_rules(),
            QueryRule(Process, (PexProcess, )),
        ],
        target_types=[
            PythonSourcesGeneratorTarget,
            ProtobufSourceTarget,
            PythonSourceTarget,
            PythonRequirementTarget,
        ],
    )
    rule_runner.write_files({
        "src/python/foo.proto":
        'syntax = "proto3";message Foo {}',
        "src/python/lib.py":
        "from foo import Foo\nclass SomeClass:\n  pass\n",
        "src/python/BUILD":
        ("protobuf_source(name='proto', source='foo.proto')\n"
         "python_sources(dependencies=[':proto'])"),
    })
    return rule_runner
Exemplo n.º 2
0
def rule_runner() -> RuleRunner:
    return RuleRunner(
        rules=[
            *repl_rules(),
            *python_repl.rules(),
            *pex_from_targets.rules(),
            QueryRule(Process, (PexProcess, )),
        ],
        target_types=[PythonLibrary, ProtobufLibrary],
    )
Exemplo n.º 3
0
 def rules(cls):
     return (
         *super().rules(),
         *repl_rules(),
         *python_repl.rules(),
         *pex.rules(),
         *archive.rules(),
         *external_tool.rules(),
         *python_sources.rules(),
         *pex_from_targets.rules(),
         *strip_source_roots.rules(),
         *ancestor_files.rules(),
         RootRule(PythonRepl),
     )
Exemplo n.º 4
0
 def rules(cls):
     return (
         *super().rules(),
         *repl_rules(),
         *python_repl.rules(),
         *pex.rules(),
         *archive.rules(),
         *external_tool.rules(),
         *python_sources.rules(),
         *pex_from_targets.rules(),
         *stripped_source_files.rules(),
         *ancestor_files.rules(),
         QueryRule(Process, (PexProcess, OptionsBootstrapper)),
     )
Exemplo n.º 5
0
 def rules(cls):
     return (
         *super().rules(),
         *repl_rules(),
         *python_repl.rules(),
         *pex.rules(),
         *download_pex_bin.rules(),
         *archive.rules(),
         *external_tool.rules(),
         *importable_python_sources.rules(),
         *pex_from_targets.rules(),
         *python_native_code.rules(),
         *strip_source_roots.rules(),
         *subprocess_environment.rules(),
         RootRule(PythonRepl),
     )
Exemplo n.º 6
0
def rule_runner() -> RuleRunner:
    rule_runner = RuleRunner(
        rules=[
            *repl_rules(),
            *ipython_subsystem_rules(),
            *python_repl.rules(),
            *pex_from_targets.rules(),
            *local_dists.rules(),
            QueryRule(Process, (PexProcess, )),
        ],
        target_types=[PythonLibrary, ProtobufLibrary],
    )
    rule_runner.write_files({
        "src/python/foo.proto":
        'syntax = "proto3";message Foo {}',
        "src/python/lib.py":
        "from foo import Foo\nclass SomeClass:\n  pass\n",
        "src/python/BUILD":
        ("protobuf_library(name='proto')\npython_library(dependencies=[':proto'])"
         ),
    })
    return rule_runner
Exemplo n.º 7
0
def rule_runner() -> RuleRunner:
    return RuleRunner(
        rules=(*repl_rules(), create_mock_repl_request, UnionRule(ReplImplementation, MockRepl)),
    )