Skip to content

Commit 53ae427

Browse files
committed
Export prize collecting examples in python
1 parent f743205 commit 53ae427

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

examples/python/BUILD.bazel

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,44 @@ bintest(
427427
named_data = {"prize_collecting_tsp_sat_py3": ":prize_collecting_tsp_sat_py3"},
428428
)
429429

430+
py_binary(
431+
name = "prize_collecting_tsp_py3",
432+
srcs = ["prize_collecting_tsp.py"],
433+
main = "prize_collecting_tsp.py",
434+
deps = [
435+
"//ortools/constraint_solver/python:constraint_solver",
436+
"//ortools/routing:enums_py_pb2",
437+
"//ortools/routing:parameters_py_pb2",
438+
"//ortools/routing/python:routing",
439+
],
440+
)
441+
442+
bintest(
443+
name = "prize_collecting_tsp_py_test",
444+
size = "medium",
445+
srcs = [":prize_collecting_tsp_py_test.bintest"],
446+
named_data = {"prize_collecting_tsp_py3": ":prize_collecting_tsp_py3"},
447+
)
448+
449+
py_binary(
450+
name = "prize_collecting_vrp_py3",
451+
srcs = ["prize_collecting_vrp.py"],
452+
main = "prize_collecting_vrp.py",
453+
deps = [
454+
"//ortools/constraint_solver/python:constraint_solver",
455+
"//ortools/routing:enums_py_pb2",
456+
"//ortools/routing:parameters_py_pb2",
457+
"//ortools/routing/python:routing",
458+
],
459+
)
460+
461+
bintest(
462+
name = "prize_collecting_vrp_py_test",
463+
size = "medium",
464+
srcs = [":prize_collecting_vrp_py_test.bintest"],
465+
named_data = {"prize_collecting_vrp_py3": ":prize_collecting_vrp_py3"},
466+
)
467+
430468
py_binary(
431469
name = "prize_collecting_vrp_sat_py3",
432470
srcs = ["prize_collecting_vrp_sat.py"],

examples/python/CMakeBazel.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,28 @@ ortools_cxx_bintest(
274274
ENVIRONMENT BINTEST_prize_collecting_tsp_sat_py3=$<TARGET_FILE:bzl_py_example_prize_collecting_tsp_sat_py3>
275275
)
276276

277+
add_python_binary(
278+
NAME bzl_py_example_prize_collecting_tsp_py3
279+
FILE ${CMAKE_CURRENT_SOURCE_DIR}/prize_collecting_tsp.py
280+
)
281+
282+
ortools_cxx_bintest(
283+
NAME bzl_py_example_prize_collecting_tsp_py_test
284+
SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/prize_collecting_tsp_py_test.bintest
285+
ENVIRONMENT BINTEST_prize_collecting_tsp_py3=$<TARGET_FILE:bzl_py_example_prize_collecting_tsp_py3>
286+
)
287+
288+
add_python_binary(
289+
NAME bzl_py_example_prize_collecting_vrp_py3
290+
FILE ${CMAKE_CURRENT_SOURCE_DIR}/prize_collecting_vrp.py
291+
)
292+
293+
ortools_cxx_bintest(
294+
NAME bzl_py_example_prize_collecting_vrp_py_test
295+
SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/prize_collecting_vrp_py_test.bintest
296+
ENVIRONMENT BINTEST_prize_collecting_vrp_py3=$<TARGET_FILE:bzl_py_example_prize_collecting_vrp_py3>
297+
)
298+
277299
add_python_binary(
278300
NAME bzl_py_example_prize_collecting_vrp_sat_py3
279301
FILE ${CMAKE_CURRENT_SOURCE_DIR}/prize_collecting_vrp_sat.py

0 commit comments

Comments
 (0)