diff --git a/cmake/python.cmake b/cmake/python.cmake index e38c0d61ff..6cf4e5f386 100644 --- a/cmake/python.cmake +++ b/cmake/python.cmake @@ -393,7 +393,7 @@ if(BUILD_MATH_OPT) endif() file(COPY ortools/sat/python/cp_model.py - ortools/sat/python/cp_model_helper.py + ortools/sat/python/cp_model_numbers.py DESTINATION ${PYTHON_PROJECT_DIR}/sat/python) file(COPY ortools/sat/colab/flags.py @@ -649,7 +649,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E copy $ ${PYTHON_PROJECT}/routing/python COMMAND ${CMAKE_COMMAND} -E copy - $ ${PYTHON_PROJECT}/sat/python + $ ${PYTHON_PROJECT}/sat/python COMMAND ${CMAKE_COMMAND} -E copy $ ${PYTHON_PROJECT}/scheduling/python COMMAND ${CMAKE_COMMAND} -E copy @@ -672,7 +672,7 @@ add_custom_command( model_builder_helper_pybind11 math_opt_pybind11 $ - swig_helper_pybind11 + cp_model_helper_pybind11 rcpsp_pybind11 sorted_interval_list_pybind11 WORKING_DIRECTORY python @@ -712,7 +712,7 @@ add_custom_command( COMMAND ${stubgen_EXECUTABLE} -p ortools.pdlp.python.pdlp --output . COMMAND ${stubgen_EXECUTABLE} -p ortools.routing.pywraprouting --output . COMMAND ${stubgen_EXECUTABLE} -p ortools.routing.python.model --output . - COMMAND ${stubgen_EXECUTABLE} -p ortools.sat.python.swig_helper --output . + COMMAND ${stubgen_EXECUTABLE} -p ortools.sat.python.cp_model_helper --output . COMMAND ${stubgen_EXECUTABLE} -p ortools.scheduling.python.rcpsp --output . COMMAND ${stubgen_EXECUTABLE} -p ortools.util.python.sorted_interval_list --output . COMMAND ${CMAKE_COMMAND} -E touch ${PROJECT_BINARY_DIR}/python/stub_timestamp diff --git a/cmake/samples/python/sample.py b/cmake/samples/python/sample.py index 9dc293fb8c..1cd6775868 100644 --- a/cmake/samples/python/sample.py +++ b/cmake/samples/python/sample.py @@ -21,7 +21,7 @@ from ortools.constraint_solver import pywrapcp # from ortools.graph.python import min_cost_flow from ortools.linear_solver import pywraplp # from ortools.linear_solver import linear_solver_pb2 -# from ortools.sat.python import swig_helper +# from ortools.sat.python import cp_model_helper # from ortools.sat.python import cp_model # from ortools.scheduling import rcpsp # from ortools.util.python import sorted_interval_list diff --git a/ortools/python/BUILD.bazel b/ortools/python/BUILD.bazel index 67633d4cac..4c30f9de22 100644 --- a/ortools/python/BUILD.bazel +++ b/ortools/python/BUILD.bazel @@ -23,7 +23,7 @@ py_binary( "//ortools/graph/python:linear_sum_assignment.so", "//ortools/graph/python:max_flow.so", "//ortools/graph/python:min_cost_flow.so", - "//ortools/sat/python:swig_helper.so", + "//ortools/sat/python:cp_model_helper.so", ], tags = ["manual"], deps = [ @@ -32,7 +32,7 @@ py_binary( "//ortools/sat/colab:flags", "//ortools/sat/colab:visualization", "//ortools/sat/python:cp_model", - "//ortools/sat/python:cp_model_helper", + "//ortools/sat/python:cp_model_numbers", requirement("notebook"), requirement("svgwrite"), requirement("plotly"), diff --git a/ortools/python/setup.py.in b/ortools/python/setup.py.in index 38be021e97..697011f6da 100644 --- a/ortools/python/setup.py.in +++ b/ortools/python/setup.py.in @@ -118,7 +118,7 @@ setup( '@PYTHON_PROJECT@.sat':['*.pyi'], '@PYTHON_PROJECT@.sat.colab':['*.pyi', 'py.typed'], '@PYTHON_PROJECT@.sat.python':[ - '$', + '$', '*.pyi', 'py.typed' ], diff --git a/ortools/sat/python/CMakeLists.txt b/ortools/sat/python/CMakeLists.txt index cf3e7d8d6a..d5e1cf1f60 100644 --- a/ortools/sat/python/CMakeLists.txt +++ b/ortools/sat/python/CMakeLists.txt @@ -11,26 +11,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -pybind11_add_module(swig_helper_pybind11 MODULE swig_helper.cc) -set_target_properties(swig_helper_pybind11 PROPERTIES - LIBRARY_OUTPUT_NAME "swig_helper") +pybind11_add_module(cp_model_helper_pybind11 MODULE cp_model_helper.cc) +set_target_properties(cp_model_helper_pybind11 PROPERTIES + LIBRARY_OUTPUT_NAME "cp_model_helper") # note: macOS is APPLE and also UNIX ! if(APPLE) - set_target_properties(swig_helper_pybind11 PROPERTIES + set_target_properties(cp_model_helper_pybind11 PROPERTIES SUFFIX ".so" INSTALL_RPATH "@loader_path;@loader_path/../../../${PYTHON_PROJECT}/.libs") elseif(UNIX) - set_target_properties(swig_helper_pybind11 PROPERTIES + set_target_properties(cp_model_helper_pybind11 PROPERTIES INSTALL_RPATH "$ORIGIN:$ORIGIN/../../../${PYTHON_PROJECT}/.libs") endif() -target_link_libraries(swig_helper_pybind11 PRIVATE +target_link_libraries(cp_model_helper_pybind11 PRIVATE ${PROJECT_NAMESPACE}::ortools pybind11_native_proto_caster protobuf::libprotobuf) -target_include_directories(swig_helper_pybind11 PRIVATE ${protobuf_SOURCE_DIR}) -add_library(${PROJECT_NAMESPACE}::swig_helper_pybind11 ALIAS swig_helper_pybind11) +target_include_directories(cp_model_helper_pybind11 PRIVATE ${protobuf_SOURCE_DIR}) +add_library(${PROJECT_NAMESPACE}::cp_model_helper_pybind11 ALIAS cp_model_helper_pybind11) if(BUILD_TESTING) file(GLOB PYTHON_SRCS "*_test.py") diff --git a/tools/docker/python/build-manylinux.sh b/tools/docker/python/build-manylinux.sh index 329c1a07c6..f4bccf3ea6 100755 --- a/tools/docker/python/build-manylinux.sh +++ b/tools/docker/python/build-manylinux.sh @@ -126,7 +126,7 @@ function check_wheel() { "ortools/linear_solver/python/model_builder_helper.pyi" "ortools/linear_solver/pywraplp.pyi" "ortools/pdlp/python/pdlp.pyi" - "ortools/sat/python/swig_helper.pyi" + "ortools/sat/python/cp_model_helper.pyi" "ortools/scheduling/python/rcpsp.pyi" "ortools/util/python/sorted_interval_list.pyi" ) diff --git a/tools/release/build_delivery_macos.sh b/tools/release/build_delivery_macos.sh index f5bc67ada2..ebd257495f 100755 --- a/tools/release/build_delivery_macos.sh +++ b/tools/release/build_delivery_macos.sh @@ -252,7 +252,7 @@ function build_python() { "ortools/linear_solver/python/model_builder_helper.pyi" "ortools/linear_solver/pywraplp.pyi" "ortools/pdlp/python/pdlp.pyi" - "ortools/sat/python/swig_helper.pyi" + "ortools/sat/python/cp_model_helper.pyi" "ortools/scheduling/python/rcpsp.pyi" "ortools/util/python/sorted_interval_list.pyi" ) diff --git a/tools/release/build_delivery_win.cmd b/tools/release/build_delivery_win.cmd index 0a27167745..a5638aaf6c 100644 --- a/tools/release/build_delivery_win.cmd +++ b/tools/release/build_delivery_win.cmd @@ -308,7 +308,7 @@ FOR %%v IN (8 9 10 11 12 13) DO ( ortools\linear_solver\python\model_builder_helper.pyi ortools\linear_solver\pywraplp.pyi ortools\pdlp\python\pdlp.pyi - ortools\sat\python\swig_helper.pyi + ortools\sat\python\cp_model_helper.pyi ortools\scheduling\python\rcpsp.pyi ortools\util\python\sorted_interval_list.pyi ) DO (