Skip to content

Commit

Permalink
Switch numpy headers to whl_filegroup
Browse files Browse the repository at this point in the history
  • Loading branch information
lalten committed Jun 29, 2024
1 parent b3247c9 commit 9805e47
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 23 deletions.
17 changes: 16 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_python//python:pip.bzl", "compile_pip_requirements", "whl_filegroup")

compile_pip_requirements(
name = "python_requirements",
Expand All @@ -12,3 +13,17 @@ exports_files([
"requirements.txt",
"requirements_lock.txt",
])

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: 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.

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//:rules_ros2_pip_deps_numpy_headers"),
],
providers = [CcInfo],
),
Expand Down

0 comments on commit 9805e47

Please sign in to comment.