1515
1616load ("@pip_deps//:requirements.bzl" , "requirement" )
1717load ("@pybind11_bazel//:build_defs.bzl" , "pybind_extension" )
18- load ("@rules_cc//cc:cc_binary.bzl" , "cc_binary" )
1918load ("@rules_cc//cc:cc_library.bzl" , "cc_library" )
2019load ("@rules_python//python:py_test.bzl" , "py_test" )
2120
@@ -28,45 +27,12 @@ cc_library(
2827 ],
2928)
3029
31- cc_binary (
32- name = "gen_proto_builder_pybind11" ,
33- srcs = ["gen_proto_builder_pybind11.cc" ],
34- deps = [
35- "//ortools/base" ,
36- "//ortools/constraint_solver:search_stats_cc_proto" ,
37- "//ortools/constraint_solver:solver_parameters_cc_proto" ,
38- "//ortools/routing:enums_cc_proto" ,
39- "//ortools/routing:heuristic_parameters_cc_proto" ,
40- "//ortools/routing:ils_cc_proto" ,
41- "//ortools/routing:parameters_cc_proto" ,
42- "//ortools/util/python:wrappers" ,
43- "@abseil-cpp//absl/flags:parse" ,
44- "@abseil-cpp//absl/flags:usage" ,
45- "@abseil-cpp//absl/log:die_if_null" ,
46- "@abseil-cpp//absl/log:initialize" ,
47- "@abseil-cpp//absl/strings:str_format" ,
48- ],
49- )
50-
51- genrule (
52- name = "run_gen_proto_builder_pybind11" ,
53- outs = ["proto_builder_pybind11.h" ],
54- cmd = "$(location :gen_proto_builder_pybind11) > $@" ,
55- tools = [":gen_proto_builder_pybind11" ],
56- )
57-
58- cc_library (
59- name = "proto_builder_pybind11" ,
60- hdrs = ["proto_builder_pybind11.h" ],
61- )
62-
6330pybind_extension (
6431 name = "routing" ,
6532 srcs = ["routing.cc" ],
6633 visibility = ["//visibility:public" ],
6734 deps = [
6835 ":doc" ,
69- ":proto_builder_pybind11" ,
7036 "//ortools/constraint_solver:cp" ,
7137 "//ortools/constraint_solver:search_stats_cc_proto" ,
7238 "//ortools/constraint_solver:solver_parameters_cc_proto" ,
@@ -87,6 +53,7 @@ pybind_extension(
8753 "@abseil-cpp//absl/container:flat_hash_set" ,
8854 "@protobuf//:duration_cc_proto" ,
8955 "@pybind11_abseil//pybind11_abseil:absl_casters" ,
56+ "@pybind11_protobuf//pybind11_protobuf:native_proto_caster" ,
9057 ],
9158)
9259
@@ -98,6 +65,7 @@ py_test(
9865 ":routing" ,
9966 requirement ("absl-py" ),
10067 "//ortools/constraint_solver/python:constraint_solver" ,
68+ "//ortools/constraint_solver:search_stats_py_pb2" ,
10169 "//ortools/routing:enums_py_pb2" ,
10270 "//ortools/routing:parameters_py_pb2" ,
10371 ],
@@ -111,6 +79,7 @@ py_test(
11179 ":routing" ,
11280 requirement ("absl-py" ),
11381 "//ortools/routing:enums_py_pb2" ,
82+ "//ortools/routing:parameters_py_pb2" , # keep
11483 ],
11584)
11685
@@ -132,6 +101,7 @@ py_test(
132101 ":routing" ,
133102 requirement ("absl-py" ),
134103 "//ortools/routing:enums_py_pb2" ,
104+ "//ortools/routing:parameters_py_pb2" , # keep
135105 "//ortools/util:optional_boolean_py_pb2" ,
136106 "//ortools/util/python:sorted_interval_list" ,
137107 ],
0 commit comments