コード例 #1
0
def rules():
    return (
        *ancestor_files.rules(),
        *coverage_py.rules(),
        *dependency_inference_rules.rules(),
        *export.rules(),
        *ipython.rules(),
        *local_dists.rules(),
        *lockfile.rules(),
        *package_pex_binary.rules(),
        *pex.rules(),
        *pex_cli.rules(),
        *pex_environment.rules(),
        *pex_from_targets.rules(),
        *pytest.rules(),
        *pytest_runner.rules(),
        *python_native_code.rules(),
        *python_sources.rules(),
        *repl.rules(),
        *run_pex_binary.rules(),
        *setup_py.rules(),
        *setuptools.rules(),
        *tailor.rules(),
        *target_types_rules.rules(),
        # Macros.
        *deprecation_fixers.rules(),
        *pipenv_requirements.rules(),
        *poetry_requirements.rules(),
        *python_requirements.rules(),
    )
コード例 #2
0
def rule_runner() -> RuleRunner:
    return RuleRunner(
        rules=[
            build_runtime_package_dependencies,
            create_or_update_coverage_config,
            *pytest_runner.rules(),
            *pytest_subsystem_rules(),
            *pex_from_targets.rules(),
            *dependency_inference_rules.rules(),
            *distdir.rules(),
            *config_files.rules(),
            *package_pex_binary.rules(),
            get_filtered_environment,
            *target_types_rules.rules(),
            *local_dists.rules(),
            *setup_py.rules(),
            *setuptools_rules(),
            QueryRule(TestResult, (PythonTestFieldSet, )),
            QueryRule(TestDebugRequest, (PythonTestFieldSet, )),
        ],
        target_types=[
            PexBinary,
            PythonSourcesGeneratorTarget,
            PythonTestsGeneratorTarget,
            PythonTestUtilsGeneratorTarget,
            PythonRequirementTarget,
            PythonDistribution,
        ],
        objects={"python_artifact": PythonArtifact},
    )
コード例 #3
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
コード例 #4
0
def rule_runner() -> RuleRunner:
    return RuleRunner(
        rules=[
            *local_dists.rules(),
            *setup_py_rules(),
            *setuptools_rules(),
            *target_types_rules.rules(),
            QueryRule(LocalDistsPex, (LocalDistsPexRequest, )),
        ],
        target_types=[PythonLibrary, PythonDistribution],
        objects={"python_artifact": PythonArtifact},
    )
コード例 #5
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
コード例 #6
0
def rules():
    return (
        *coverage_py.rules(),
        *lockfile.rules(),
        *tailor.rules(),
        *ancestor_files.rules(),
        *local_dists.rules(),
        *python_sources.rules(),
        *dependency_inference_rules.rules(),
        *pex.rules(),
        *pex_cli.rules(),
        *pex_environment.rules(),
        *pex_from_targets.rules(),
        *pytest_runner.rules(),
        *package_pex_binary.rules(),
        *python_native_code.rules(),
        *repl.rules(),
        *run_pex_binary.rules(),
        *target_types_rules.rules(),
        *setup_py.rules(),
        *setuptools.rules(),
        *ipython.rules(),
        *pytest.rules(),
    )