Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ sphinx_stardocs(
"//python/api:rule_builders",
"//python/cc:py_cc_toolchain",
"//python/cc:py_cc_toolchain_info",
"//python/cc:py_extension",
"//python/entry_points:py_console_script_binary",
"//python/extensions:config",
"//python/extensions:python",
Expand Down
3 changes: 3 additions & 0 deletions python/cc/py_extension.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ for information on writing C extension modules.

:::{include} /_includes/experimental_api.md
:::

:::{versionadded} VERSION_NEXT_FEATURE
:::
"""

load(
Expand Down
3 changes: 2 additions & 1 deletion python/private/cc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ bzl_library(
srcs = ["py_extension_macro.bzl"],
deps = [
":py_extension_rule",
"//python/private:common_labels",
"//python/private:util",
"@rules_cc//cc:core_rules",
],
Expand All @@ -55,11 +56,11 @@ bzl_library(
"//python/private:attr_builders",
"//python/private:attributes",
"//python/private:builders",
"//python/private:common",
"//python/private:py_info",
"//python/private:reexports",
"//python/private:rule_builders",
"//python/private:toolchain_types",
"@bazel_skylib//lib:dicts",
"@rules_cc//cc/common",
],
)
3 changes: 3 additions & 0 deletions python/private/cc/py_extension_macro.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def py_extension(
- `module_name`: Pass `module_name = "custom_name"` to override the base
module filename.

:::{versionadded} VERSION_NEXT_FEATURE
:::

Args:
name: {type}`str` Target name.
srcs: {type}`list[Label | str] | None` C/C++ source files to compile
Expand Down
2 changes: 0 additions & 2 deletions python/private/cc/py_extension_rule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""

load("@bazel_skylib//lib:dicts.bzl", "dicts")
load("@rules_cc//cc/common:cc_shared_library_info.bzl", "CcSharedLibraryInfo")
load("//python/private:attr_builders.bzl", "attrb")
load("//python/private:attributes.bzl", "COMMON_ATTRS", "IMPORTS_ATTRS", "WINDOWS_CONSTRAINTS_ATTRS")
load("//python/private:builders.bzl", "builders")
Expand Down Expand Up @@ -78,7 +77,6 @@ PY_EXTENSION_WRAPPER_ATTRS = dicts.add(
),
"src": lambda: attrb.Label(
mandatory = True,
providers = [CcSharedLibraryInfo],
doc = "The cc_shared_library target to wrap.",
),
},
Expand Down
1 change: 1 addition & 0 deletions tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ build_test(
"//python:py_test_bzl",
"//python/cc:py_cc_toolchain_bzl",
"//python/cc:py_cc_toolchain_info_bzl",
"//python/cc:py_extension",
"//python/entry_points:py_console_script_binary_bzl",
],
)