Skip to content
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ END_UNRELEASED_TEMPLATE
* (pypi) Wheels with BUILD.bazel (or other special Bazel files) no longer
result in missing files at runtime
([#2782](https://github.com/bazel-contrib/rules_python/issues/2782)).
* (runfiles) The pypi runfiles package now includes `py.typed` to indicate it
supports type checking
([#2503](https://github.com/bazel-contrib/rules_python/issues/2503)).

{#v0-0-0-added}
### Added
Expand Down
13 changes: 11 additions & 2 deletions python/runfiles/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ filegroup(
visibility = ["//python:__pkg__"],
)

filegroup(
name = "py_typed",
# See PEP 561: py.typed is a special file that indicates the code supports type checking
srcs = ["py.typed"],
)

py_library(
name = "runfiles",
srcs = [
"__init__.py",
"runfiles.py",
],
data = ["py.typed"],
data = [":py_typed"],
imports = [
# Add the repo root so `import python.runfiles.runfiles` works. This makes it agnostic
# to the --experimental_python_import_all_repositories setting.
Expand Down Expand Up @@ -57,5 +63,8 @@ py_wheel(
# this can be replaced by building with --stamp --embed_label=1.2.3
version = "{BUILD_EMBED_LABEL}",
visibility = ["//visibility:public"],
deps = [":runfiles"],
deps = [
":py_typed",
":runfiles",
],
)