Skip to content

Commit

Permalink
Switch numpy headers to whl_filegroup (mvukov#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalten authored and parth-emancro committed Oct 2, 2024
1 parent 3eddfdc commit 0d601c5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 22 deletions.
2 changes: 0 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ python_register_toolchains(

load("@rules_python//python:pip.bzl", "pip_parse")
load("@rules_ros2_python//:defs.bzl", python_interpreter_target = "interpreter")
load("//repositories:pip_annotations.bzl", "PIP_ANNOTATIONS")

pip_parse(
name = "rules_ros2_pip_deps",
annotations = PIP_ANNOTATIONS,
python_interpreter_target = python_interpreter_target,
requirements_lock = "@com_github_mvukov_rules_ros2//:requirements_lock.txt",
)
Expand Down
2 changes: 0 additions & 2 deletions examples/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ python_register_toolchains(
python_version = "3.10",
)

load("@com_github_mvukov_rules_ros2//repositories:pip_annotations.bzl", "PIP_ANNOTATIONS")
load("@rules_python//python:pip.bzl", "pip_parse")
load("@rules_ros2_python//:defs.bzl", python_interpreter_target = "interpreter")

pip_parse(
name = "rules_ros2_pip_deps",
annotations = PIP_ANNOTATIONS,
python_interpreter_target = python_interpreter_target,
requirements_lock = "@com_github_mvukov_rules_ros2//:requirements_lock.txt",
)
Expand Down
3 changes: 0 additions & 3 deletions repositories/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
load("@rules_python//python:defs.bzl", "py_binary")

exports_files([
"deps.bzl",
"logging_macros.bzl",
"generate_rclcpp_interface.py",
"generate_rclcpp_logging_macros.py",
"generate_rcutils_logging_macros.py",
"pip_annotations.bzl",
"rclcpp_interfaces.bzl",
"repositories.bzl",
"ros2_repo_mappings.yaml",
Expand Down
14 changes: 0 additions & 14 deletions repositories/pip_annotations.bzl

This file was deleted.

16 changes: 16 additions & 0 deletions ros2/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
""" ROS 2 common definitions.
"""

load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
load("@rules_python//python:pip.bzl", "whl_filegroup")

exports_files([
"ament.bzl",
Expand Down Expand Up @@ -65,3 +67,17 @@ py_binary(
"@ros2cli//:ros2lifecycle",
],
)

whl_filegroup(
name = "numpy_includes",
pattern = "numpy/core/include/numpy",
whl = "@rules_ros2_pip_deps//numpy:whl",
)

cc_library(
name = "rules_ros2_pip_deps_numpy_headers",
hdrs = [":numpy_includes"],
includes = ["numpy_includes/numpy/core/include"],
visibility = ["//visibility:public"],
deps = ["@rules_python//python/cc:current_py_cc_headers"],
)
2 changes: 1 addition & 1 deletion ros2/interfaces.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ py_generator_aspect = aspect(
"_py_ext_c_deps": attr.label_list(
default = [
Label("@rules_python//python/cc:current_py_cc_headers"),
Label("@rules_ros2_pip_deps_numpy//:headers"),
Label("@com_github_mvukov_rules_ros2//ros2:rules_ros2_pip_deps_numpy_headers"),
],
providers = [CcInfo],
),
Expand Down

0 comments on commit 0d601c5

Please sign in to comment.