load("//bindings/pydrake:pydrake.bzl", "add_lint_tests_pydrake")
load("//tools/install:install.bzl", "install")
load(
    "//tools/skylark:drake_py.bzl",
    "drake_py_library",
    "drake_py_unittest",
)
load(
    "//tools/skylark:pybind.bzl",
    "drake_pybind_library",
    "get_drake_py_installs",
    "get_pybind_package_info",
)

package(default_visibility = [
    "//bindings/pydrake:__subpackages__",
])

# This determines how `PYTHONPATH` is configured, and how to install the
# bindings.
PACKAGE_INFO = get_pybind_package_info("//bindings")

drake_pybind_library(
    name = "manipulation",
    cc_deps = [
        "//bindings/pydrake:documentation_pybind",
        "//bindings/pydrake/common:eigen_pybind",
        "//bindings/pydrake/common:serialize_pybind",
    ],
    cc_so_name = "__init__",
    cc_srcs = [
        "manipulation_py.h",
        "manipulation_py.cc",
        "manipulation_py_kuka_iiwa.cc",
        "manipulation_py_schunk_wsg.cc",
        "manipulation_py_util.cc",
    ],
    package_info = PACKAGE_INFO,
    py_deps = [
        "//bindings/pydrake/systems:framework_py",
    ],
    py_srcs = [
        "_manipulation_extra.py",
    ],
)

drake_py_unittest(
    name = "kuka_iiwa_test",
    data = [
        "//manipulation/util:test_directives",
        "@drake_models//:iiwa_description",
    ],
    deps = [
        ":manipulation",
        "//bindings/pydrake/multibody",
        "//bindings/pydrake/systems",
    ],
)

drake_py_unittest(
    name = "schunk_wsg_test",
    data = [
        "//manipulation/util:test_directives",
    ],
    deps = [
        ":manipulation",
        "//bindings/pydrake/multibody",
        "//bindings/pydrake/systems",
    ],
)

drake_py_unittest(
    name = "util_test",
    data = [
        "//manipulation/util:test_directives",
    ],
    deps = [
        ":manipulation",
        "//bindings/pydrake/multibody",
        "//bindings/pydrake/systems",
    ],
)

install(
    name = "install",
    targets = [":manipulation"],
    py_dest = PACKAGE_INFO.py_dest,
    deps = get_drake_py_installs([":manipulation"]),
)

add_lint_tests_pydrake()
