Skip to content

Commit

Permalink
Merge pull request RobotLocomotion#7574 from jwnimmer-tri/6996-pybind
Browse files Browse the repository at this point in the history
Make new pybind folder structure insensitive to Drake package names
  • Loading branch information
jwnimmer-tri authored Dec 7, 2017
2 parents 89fe87c + 3713863 commit 7f23076
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
11 changes: 7 additions & 4 deletions drake/bindings/pydrake/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ load(
"drake_py_test",
)
load(
"//drake/bindings/pydrake:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
"get_drake_pybind_installs",
"get_pybind_library_dest",
)
load("//tools/skylark:6996.bzl", "adjust_labels_for_drake_hoist")

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

# N.B. Any common headers should be shared via a HEADER ONLY library.

Expand Down Expand Up @@ -106,14 +109,14 @@ drake_pybind_library(
py_srcs = ["symbolic.py"],
)

PYBIND_LIBRARIES = [
PYBIND_LIBRARIES = adjust_labels_for_drake_hoist([
":autodiffutils_py",
":common_py",
":parsers_py",
":rbtree_py",
":symbolic_py",
"//drake/bindings/pydrake/solvers",
]
])

install(
name = "install",
Expand Down
7 changes: 5 additions & 2 deletions drake/bindings/pydrake/solvers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/workspace/gurobi:gurobi.bzl", "gurobi_test_tags")
load("//tools/workspace/mosek:mosek.bzl", "mosek_test_tags")
load(
"//drake/bindings/pydrake:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
"get_drake_pybind_installs",
"get_pybind_library_dest",
Expand All @@ -15,8 +15,11 @@ load(
"drake_py_library",
"drake_py_test",
)
load("//tools/skylark:6996.bzl", "adjust_labels_for_drake_hoist")

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

drake_py_library(
name = "module_py",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ load(
"//tools/skylark:drake_py.bzl",
"drake_py_library",
)
load("//tools/skylark:6996.bzl", "adjust_label_for_drake_hoist")

_PY_VERSION = "2.7"

# This is the base package to determine which paths should be imported, and
# where the Python components should be installed.
_BASE_PACKAGE = "drake/bindings"
#
# TODO(jwnimmer-tri) Either make this path configurable, or else move this file
# (pybind.bzl) back into the bindings folder directly.
_BASE_PACKAGE = adjust_label_for_drake_hoist("//drake/bindings")[2:]

# TODO(eric.cousineau): Consider making a `PybindProvider`, to sort
# out dependencies, sources, etc, and simplify installation
Expand Down

0 comments on commit 7f23076

Please sign in to comment.