Skip to content

Commit

Permalink
Add missing load of py_library rule in drake_bazel_installed (RobotLo…
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiesnape authored Feb 13, 2020
1 parent 10c5f68 commit 2e793d9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/install/bazel/drake.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- mode: python -*-
# vi: set ft=python :

load("@rules_python//python:defs.bzl", "py_library")
load("//:.manifest.bzl", "MANIFEST")

package(default_visibility = ["//:__subpackages__"])
Expand Down
26 changes: 26 additions & 0 deletions tools/install/bazel/test/drake_bazel_installed_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,33 @@ def main():

# In scratch, mock up a drake_bazel_installed workspace.
scratch_dir = install_test_helper.create_temporary_dir("scratch")

# TODO(jamiesnape): Automatically keep this synchronized with the version
# used by @drake (or the nearest stable version).
rules_python_commit = "38f86fb55b698c51e8510c807489c9f4e047480e"
rules_python_url = f"https://github.com/bazelbuild/rules_python/archive/{rules_python_commit}.tar.gz" # noqa
rules_python_sha256 = "c911dc70f62f507f3a361cbc21d6e0d502b91254382255309bc60b7a0f48de28" # noqa

with open(join(scratch_dir, "WORKSPACE"), "w") as f:
f.write(f"""
workspace(name = "scratch")
load(
"@bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive",
)
http_archive(
name = "rules_python",
sha256 = "{rules_python_sha256}",
strip_prefix = "rules_python-{rules_python_commit}",
url = "{rules_python_url}",
)
load(
"@rules_python//python:repositories.bzl",
"py_repositories",
)
py_repositories()
new_local_repository(
name = "drake_binary",
path = "{install_dir}",
Expand All @@ -30,6 +54,8 @@ def main():

with open(join(scratch_dir, "BUILD.bazel"), "w") as f:
f.write(f"""
load("@rules_python//python:defs.bzl", "py_test")
py_test(
name = "find_resource_test",
srcs = ["find_resource_test.py"],
Expand Down

0 comments on commit 2e793d9

Please sign in to comment.