diff --git a/ortools/algorithms/BUILD.bazel b/ortools/algorithms/BUILD.bazel index ff0f1ffd1f..5f778ab22c 100644 --- a/ortools/algorithms/BUILD.bazel +++ b/ortools/algorithms/BUILD.bazel @@ -28,9 +28,7 @@ bool_flag( config_setting( name = "use_cbc", - flag_values = { - ":with_cbc": "true", - }, + flag_values = {":with_cbc": "true"}, ) bool_flag( @@ -40,9 +38,7 @@ bool_flag( config_setting( name = "use_scip", - flag_values = { - ":with_scip": "true", - }, + flag_values = {":with_scip": "true"}, ) cc_library( @@ -93,12 +89,12 @@ cc_library( cc_test( name = "radix_sort_test", - size = "medium", srcs = ["radix_sort_test.cc"], copts = select({ "@platforms//os:windows": ["/Zc:preprocessor"], "//conditions:default": [], }), + tags = ["noci"], deps = [ ":radix_sort", "//ortools/base:dump_vars", @@ -314,6 +310,7 @@ cc_library( hdrs = ["sparse_permutation.h"], deps = [ "//ortools/base", + "//ortools/base:numbers", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/types:span", ], diff --git a/ortools/algorithms/python/BUILD.bazel b/ortools/algorithms/python/BUILD.bazel index de7c3e4f72..20442a7c24 100644 --- a/ortools/algorithms/python/BUILD.bazel +++ b/ortools/algorithms/python/BUILD.bazel @@ -11,9 +11,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") +# Description: python wrapping of the libraries in ../ -# Python wrapper for .. +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load("@pip_deps//:requirements.bzl", "requirement") load("@pybind11_bazel//:build_defs.bzl", "pybind_extension") load("@rules_cc//cc:cc_library.bzl", "cc_library") @@ -27,9 +27,7 @@ bool_flag( config_setting( name = "use_cbc", - flag_values = { - ":with_cbc": "true", - }, + flag_values = {":with_cbc": "true"}, ) bool_flag( @@ -39,9 +37,7 @@ bool_flag( config_setting( name = "use_scip", - flag_values = { - ":with_scip": "true", - }, + flag_values = {":with_scip": "true"}, ) # knapsack_solver @@ -54,7 +50,7 @@ cc_library( pybind_extension( name = "knapsack_solver", srcs = ["knapsack_solver.cc"], - copts = [] + select({ + copts = select({ ":use_cbc": ["-DUSE_CBC"], "//conditions:default": [], }) + select({ @@ -65,12 +61,12 @@ pybind_extension( deps = [ ":knapsack_solver_doc", "//ortools/algorithms:knapsack_solver_lib", - "@abseil-cpp//absl/strings", ], ) py_test( name = "knapsack_solver_test", + size = "small", srcs = ["knapsack_solver_test.py"], deps = [ ":knapsack_solver", diff --git a/ortools/algorithms/python/knapsack_solver_test.py b/ortools/algorithms/python/knapsack_solver_test.py index 9e124e442b..85f9d82c73 100755 --- a/ortools/algorithms/python/knapsack_solver_test.py +++ b/ortools/algorithms/python/knapsack_solver_test.py @@ -14,7 +14,6 @@ """knapsack_solver unittest file.""" -from absl import app from absl.testing import absltest from ortools.algorithms.python import knapsack_solver @@ -261,9 +260,5 @@ class PyWrapAlgorithmsKnapsackSolverTest(absltest.TestCase): self.assertEqual(optimal_profit, profit) -def main(_): - absltest.main() - - if __name__ == "__main__": - app.run(main) + absltest.main()