Skip to content

Commit

Permalink
Deprecate the numpy repository (RobotLocomotion#14116)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiesnape authored Sep 24, 2020
1 parent 7f5eab6 commit 1fc03da
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tools/py_toolchain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ load(
)

# The value of interpreter_path must match the value of linux_interpreter_path
# used when declaring the @numpy and @python repositories.
# used when declaring the @python repository.
py_runtime(
name = "linux_py3_runtime",
interpreter_path = LINUX_INTERPRETER_PATH,
Expand Down Expand Up @@ -50,7 +50,7 @@ toolchain(
)

# The value of interpreter_path must match the value of macos_interpreter_path
# used when declaring the @numpy and @python repositories.
# used when declaring the @python repository.
py_runtime(
name = "macos_py3_runtime",
interpreter_path = MACOS_INTERPRETER_PATH,
Expand Down
18 changes: 15 additions & 3 deletions tools/workspace/numpy/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# -*- python -*-

# This file exists to make our directory into a Bazel package, so that our
# neighboring *.bzl file can be loaded elsewhere.

load(
"@drake//tools/skylark:drake_cc.bzl",
"drake_cc_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")

# This is only intended as regression test and will be removed on or after
# 2021-01-01.
drake_cc_library(
name = "stub",
srcs = ["stub.cc"],
deps = [
"@numpy//:numpy_for_stub_test",
"@python",
],
)

add_lint_tests()
9 changes: 9 additions & 0 deletions tools/workspace/numpy/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ cc_library(
hdrs = glob(["include/**"]),
includes = ["include"],
visibility = ["//visibility:public"],
deprecation = "DRAKE DEPRECATED: The @numpy repository is being removed from Drake on or after 2021-01-01. Downstream projects should add it to their own WORKSPACE if needed.", # noqa
)
# This is only intended for use by the regression test in
# @drake//tools/workspace/numpy, and will be removed on or after 2021-01-01.
cc_library(
name = "numpy_for_stub_test",
visibility = ["//visibility:public"],
deps = [":numpy"],
)
"""

Expand Down
6 changes: 6 additions & 0 deletions tools/workspace/numpy/stub.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <numpy/npy_math.h>

void stub() {
double x = npy_sin(0.0);
(void)x;
}
1 change: 0 additions & 1 deletion tools/workspace/pybind11/package.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ cc_library(
includes = ["include"],
deps = [
"@eigen",
"@numpy",
"@python",
],
)
Expand Down

0 comments on commit 1fc03da

Please sign in to comment.