47 lines
1.1 KiB
Python
47 lines
1.1 KiB
Python
# Python wrapper for cp_model.
|
|
|
|
load("@ortools_deps//:requirements.bzl", "requirement")
|
|
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")
|
|
load("@rules_python//python:defs.bzl", "py_library")
|
|
|
|
pybind_extension(
|
|
name = "swig_helper",
|
|
srcs = ["swig_helper.cc"],
|
|
data = [
|
|
"//ortools/util/python:sorted_interval_list.so",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//ortools/sat:cp_model_cc_proto",
|
|
"//ortools/sat:swig_helper",
|
|
"@com_google_absl//absl/strings",
|
|
],
|
|
)
|
|
|
|
py_library(
|
|
name = "cp_model_helper",
|
|
srcs = ["cp_model_helper.py"],
|
|
data = [
|
|
":swig_helper.so",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
requirement("numpy"),
|
|
],
|
|
)
|
|
|
|
py_library(
|
|
name = "cp_model",
|
|
srcs = ["cp_model.py"],
|
|
data = [
|
|
":swig_helper.so",
|
|
"//ortools/util/python:sorted_interval_list.so",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":cp_model_helper",
|
|
"//ortools/sat:cp_model_py_pb2",
|
|
"//ortools/sat:sat_parameters_py_pb2",
|
|
],
|
|
)
|