diff --git a/.gitattributes b/.gitattributes index 9c6c5032..cf31e1c2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,3 @@ -docs/*.md linguist-generated=true -docs/migrating.md linguist-generated=false -docs/virtual_deps.md linguist-generated=false - # Configuration for 'git archive' # see https://git-scm.com/docs/git-archive/2.40.0#ATTRIBUTES # Don't include examples in the distribution artifact, just to reduce size diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fec81211..cf98e38c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,12 +34,6 @@ repos: - repo: local hooks: - - id: check-docs - name: Update docs - entry: /usr/bin/env bazel run //docs:update - language: script - require_serial: true - - id: check-requirements-lock name: Update requirements lock # Note that we use a nested shell to discard $@, which is the file list diff --git a/.prettierignore b/.prettierignore index 2e117bf0..e69de29b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +0,0 @@ -docs/*.md diff --git a/README.md b/README.md index b144cc2f..80c0ec78 100644 --- a/README.md +++ b/README.md @@ -71,19 +71,7 @@ In any ancestor `BUILD` file of the Python code, add these lines to instruct [Ga # Public API -## Executables - -- [py_binary](docs/py_binary.md) an executable Python program, used with `bazel run` or as a tool. -- [py_test](docs/py_test.md) a Python program that executes a test runner such as `unittest` or `pytest`, to be used with `bazel test`. -- [py_venv](docs/venv.md) create a virtualenv for a `py_binary` or `py_test` target for use outside Bazel, such as in an editor/IDE. - -## Packaging - -- [py_pex_binary](docs/pex.md) Create a zip file containing a full Python application. - -## Packages - -- [py_library](docs/py_library.md) a unit of Python code, used as a dependency of other rules. +See https://registry.bazel.build/docs/aspect_rules_py # Telemetry & privacy policy diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel deleted file mode 100644 index 29ab7a77..00000000 --- a/docs/BUILD.bazel +++ /dev/null @@ -1,44 +0,0 @@ -# This load statement must be in the docs/ package rather than anything users depend on -# so that the dependency on stardoc doesn't leak to them. -load("@aspect_bazel_lib//lib:docs.bzl", "stardoc_with_diff_test", "update_docs") - -stardoc_with_diff_test( - name = "py_library", - bzl_library_target = "//py/private:py_library", -) - -stardoc_with_diff_test( - name = "py_binary", - bzl_library_target = "//py:defs", - symbol_names = [ - "py_binary", - "py_binary_rule", - ], -) - -stardoc_with_diff_test( - name = "py_test", - bzl_library_target = "//py:defs", - symbol_names = [ - "py_test", - "py_test_rule", - "py_pytest_main", - ], -) - -stardoc_with_diff_test( - name = "pex", - bzl_library_target = "//py/private:py_pex_binary", -) - -stardoc_with_diff_test( - name = "py_image_layer", - bzl_library_target = "//py/private:py_image_layer", -) - -stardoc_with_diff_test( - name = "venv", - bzl_library_target = "//py/private/py_venv:py_venv", -) - -update_docs(name = "update") diff --git a/docs/pex.md b/docs/pex.md deleted file mode 100644 index 590eaadd..00000000 --- a/docs/pex.md +++ /dev/null @@ -1,46 +0,0 @@ - - -Create a zip file containing a full Python application. - -Follows [PEP-441 (PEX)](https://peps.python.org/pep-0441/) - -## Ensuring a compatible interpreter is used - -The resulting zip file does *not* contain a Python interpreter. -Users are expected to execute the PEX with a compatible interpreter on the runtime system. - -Use the `python_interpreter_constraints` to provide an error if a wrong interpreter tries to execute the PEX, for example: - -```starlark -py_pex_binary( - python_interpreter_constraints = [ - "CPython=={major}.{minor}.{patch}", - ] -) -``` - - - - -## py_pex_binary - -
-py_pex_binary(name, binary, inherit_path, inject_env, python_interpreter_constraints, - python_shebang) -- -Build a pex executable from a py_binary - -**ATTRIBUTES** - - -| Name | Description | Type | Mandatory | Default | -| :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| binary | A py_binary target | Label | required | | -| inherit_path | Whether to inherit the
sys.path (aka PYTHONPATH) of the environment that the binary runs in.false to not inherit sys.path; use fallback to inherit sys.path after packaged dependencies; and use prefer to inherit sys.path before packaged dependencies. | String | optional | "" |
-| inject_env | Environment variables to set when running the pex binary. | Dictionary: String -> String | optional | {} |
-| python_interpreter_constraints | Python interpreter versions this PEX binary is compatible with. A list of semver strings. The placeholder strings {major}, {minor}, {patch} can be used for gathering version information from the hermetic python toolchain. | List of strings | optional | ["CPython=={major}.{minor}.*"] |
-| python_shebang | - | String | optional | "#!/usr/bin/env python3" |
-
-
diff --git a/docs/py_binary.md b/docs/py_binary.md
deleted file mode 100644
index 3ac22c02..00000000
--- a/docs/py_binary.md
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-Re-implementations of [py_binary](https://bazel.build/reference/be/python#py_binary)
-and [py_test](https://bazel.build/reference/be/python#py_test)
-
-## Choosing the Python version
-
-The `python_version` attribute must refer to a python toolchain version
-which has been registered in the WORKSPACE or MODULE.bazel file.
-
-When using WORKSPACE, this may look like this:
-
-```starlark
-load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
-
-python_register_toolchains(
- name = "python_toolchain_3_8",
- python_version = "3.8.12",
- # setting set_python_version_constraint makes it so that only matches py_* rule
- # which has this exact version set in the `python_version` attribute.
- set_python_version_constraint = True,
-)
-
-# It's important to register the default toolchain last it will match any py_* target.
-python_register_toolchains(
- name = "python_toolchain",
- python_version = "3.9",
-)
-```
-
-Configuring for MODULE.bazel may look like this:
-
-```starlark
-python = use_extension("@rules_python//python/extensions:python.bzl", "python")
-python.toolchain(python_version = "3.8.12", is_default = False)
-python.toolchain(python_version = "3.9", is_default = True)
-```
-
-
-
-
-## py_binary_rule
-
--py_binary_rule(name, data, deps, env, imports, interpreter_options, main, package_collisions, - python_version, resolutions, srcs) -- -Run a Python program under Bazel. Most users should use the [py_binary macro](#py_binary) instead of loading this directly. - -**ATTRIBUTES** - - -| Name | Description | Type | Mandatory | Default | -| :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| data | Runtime dependencies of the program.
data dependencies will be available in the .runfiles folder for this binary/test. The program may optionally use the Runfiles lookup library to locate the data files, see https://pypi.org/project/bazel-runfiles/. | List of labels | optional | [] |
-| deps | Targets that produce Python code, commonly py_library rules. | List of labels | optional | [] |
-| env | Environment variables to set when running the binary. | Dictionary: String -> String | optional | {} |
-| imports | List of import directories to be added to the PYTHONPATH. | List of strings | optional | [] |
-| interpreter_options | Additional options to pass to the Python interpreter in addition to -B and -I passed by rules_py | List of strings | optional | [] |
-| main | Script to execute with the Python interpreter. | Label | required | |
-| package_collisions | The action that should be taken when a symlink collision is encountered when creating the venv. A collision can occur when multiple packages providing the same file are installed into the venv. The possible values are:"error" |
-| python_version | Whether to build this target and its transitive deps for a specific python version. | String | optional | "" |
-| resolutions | Satisfy a virtual_dep with a mapping from external package name to the label of an installed package that provides it. See [virtual dependencies](/docs/virtual_deps.md). | Dictionary: Label -> String | optional | {} |
-| srcs | Python source files. | List of labels | optional | [] |
-
-
-
-
-## py_binary
-
--py_binary(name, srcs, main, kwargs) -- -Wrapper macro for [`py_binary_rule`](#py_binary_rule). - -Creates a [py_venv](./venv.md) target to constrain the interpreter and packages used at runtime. -Users can `bazel run [name].venv` to create this virtualenv, then use it in the editor or other tools. - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| name | Name of the rule. | none | -| srcs | Python source files. |
[] |
-| main | Entry point. Like rules_python, this is treated as a suffix of a file that should appear among the srcs. If absent, then [name].py is tried. As a final fallback, if the srcs has a single file, that is used as the main. | None |
-| kwargs | additional named parameters to py_binary_rule. | none |
-
-
diff --git a/docs/py_image_layer.md b/docs/py_image_layer.md
deleted file mode 100644
index 65b495fc..00000000
--- a/docs/py_image_layer.md
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-py_image_layer macro for creating multiple layers from a py_binary
-
-> [!WARNING]
-> This macro is EXPERIMENTAL and is not subject to our SemVer guarantees.
-
-A py_binary that uses `torch` and `numpy` can use the following layer groups:
-
-```
-load("@rules_oci//oci:defs.bzl", "oci_image")
-load("@aspect_rules_py//py:defs.bzl", "py_image_layer", "py_binary")
-
-py_binary(
- name = "my_app_bin",
- deps = [
- "@pip_deps//numpy",
- "@pip_deps//torch"
- ]
-)
-
-oci_image(
- tars = py_image_layer(
- name = "my_app",
- binary = ":my_app_bin",
- layer_groups = {
- "torch": "pip_deps_torch.*",
- "numpy": "pip_deps_numpy.*",
- }
- )
-)
-```
-
-
-
-
-## py_image_layer
-
--py_image_layer(name, binary, root, layer_groups, compress, tar_args, compute_unused_inputs, - platform, owner, group, kwargs) -- -Produce a separate tar output for each layer of a python app - -> Requires `awk` to be installed on the host machine/rbe runner. - -For better performance, it is recommended to split the output of a py_binary into multiple layers. -This can be done by grouping files into layers based on their path by using the `layer_groups` attribute. - -The matching order for layer groups is as follows: - 1. `layer_groups` are checked first. - 2. If no match is found for `layer_groups`, the `default layer groups` are checked. - 3. Any remaining files are placed into the default layer. - -The default layer groups are: -``` -{ - "packages": "\.runfiles/.*/site-packages",, # contains third-party deps - "interpreter": "\.runfiles/python.*-.*/", # contains the python interpreter -} -``` - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| name | base name for targets | none | -| binary | a py_binary target | none | -| root | Path to where the layers should be rooted. If not specified, the layers will be rooted at the workspace root. |
"/" |
-| layer_groups | Additional layer groups to create. They are used to group files into layers based on their path. In the form of: {"<name>": "regex_to_match_against_file_paths"} | {} |
-| compress | Compression algorithm to use. Default is gzip. See: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/tar.md#tar_rule-compress | "gzip" |
-| tar_args | Additional arguments to pass to the tar rule. Default is []. See: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/tar.md#tar_rule-args | [] |
-| compute_unused_inputs | Whether to compute unused inputs. Default is 1. See: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/tar.md#tar_rule-compute_unused_inputs | 1 |
-| platform | The platform to use for the transition. Default is None. See: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/transitions.md#platform_transition_binary-target_platform | None |
-| owner | An owner uid for the uncompressed files. See mtree_mutate: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/tar.md#mutating-the-tar-contents | None |
-| group | A group uid for the uncompressed files. See mtree_mutate: https://github.com/bazel-contrib/bazel-lib/blob/main/docs/tar.md#mutating-the-tar-contents | None |
-| kwargs | attribute that apply to all targets expanded by the macro | none |
-
-**RETURNS**
-
-A list of labels for each layer.
-
-
diff --git a/docs/py_library.md b/docs/py_library.md
deleted file mode 100644
index cd0e9786..00000000
--- a/docs/py_library.md
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-A re-implementation of [py_library](https://bazel.build/reference/be/python#py_library).
-
-Supports "virtual" dependencies with a `virtual_deps` attribute, which lists packages which are required
-without binding them to a particular version of that package.
-
-
-
-
-## py_library
-
--py_library(name, data, deps, imports, resolutions, srcs, virtual_deps) -- - - -**ATTRIBUTES** - - -| Name | Description | Type | Mandatory | Default | -| :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| data | Runtime dependencies of the program.
data dependencies will be available in the .runfiles folder for this binary/test. The program may optionally use the Runfiles lookup library to locate the data files, see https://pypi.org/project/bazel-runfiles/. | List of labels | optional | [] |
-| deps | Targets that produce Python code, commonly py_library rules. | List of labels | optional | [] |
-| imports | List of import directories to be added to the PYTHONPATH. | List of strings | optional | [] |
-| resolutions | Satisfy a virtual_dep with a mapping from external package name to the label of an installed package that provides it. See [virtual dependencies](/docs/virtual_deps.md). | Dictionary: Label -> String | optional | {} |
-| srcs | Python source files. | List of labels | optional | [] |
-| virtual_deps | - | List of strings | optional | [] |
-
-
-
-
-## py_library_utils.implementation
-
--py_library_utils.implementation(ctx) -- - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| ctx |
-
| none | - - - - -## py_library_utils.make_imports_depset - --py_library_utils.make_imports_depset(ctx, imports, extra_imports_depsets) -- - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| ctx |
-
| none | -| imports |-
|[] |
-| extra_imports_depsets | -
|[] |
-
-
-
-
-## py_library_utils.make_instrumented_files_info
-
--py_library_utils.make_instrumented_files_info(ctx, extra_source_attributes, - extra_dependency_attributes) -- - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| ctx |
-
| none | -| extra_source_attributes |-
|[] |
-| extra_dependency_attributes | -
|[] |
-
-
-
-
-## py_library_utils.make_merged_runfiles
-
--py_library_utils.make_merged_runfiles(ctx, extra_depsets, extra_runfiles, extra_runfiles_depsets) -- - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| ctx |
-
| none | -| extra_depsets |-
|[] |
-| extra_runfiles | -
|[] |
-| extra_runfiles_depsets | -
|[] |
-
-
-
-
-## py_library_utils.make_srcs_depset
-
--py_library_utils.make_srcs_depset(ctx) -- - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| ctx |
-
| none | - - - - -## py_library_utils.resolve_virtuals - --py_library_utils.resolve_virtuals(ctx, ignore_missing) -- - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| ctx |
-
| none | -| ignore_missing |-
|False |
-
-
diff --git a/docs/py_test.md b/docs/py_test.md
deleted file mode 100644
index ea1294df..00000000
--- a/docs/py_test.md
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-Re-implementations of [py_binary](https://bazel.build/reference/be/python#py_binary)
-and [py_test](https://bazel.build/reference/be/python#py_test)
-
-## Choosing the Python version
-
-The `python_version` attribute must refer to a python toolchain version
-which has been registered in the WORKSPACE or MODULE.bazel file.
-
-When using WORKSPACE, this may look like this:
-
-```starlark
-load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
-
-python_register_toolchains(
- name = "python_toolchain_3_8",
- python_version = "3.8.12",
- # setting set_python_version_constraint makes it so that only matches py_* rule
- # which has this exact version set in the `python_version` attribute.
- set_python_version_constraint = True,
-)
-
-# It's important to register the default toolchain last it will match any py_* target.
-python_register_toolchains(
- name = "python_toolchain",
- python_version = "3.9",
-)
-```
-
-Configuring for MODULE.bazel may look like this:
-
-```starlark
-python = use_extension("@rules_python//python/extensions:python.bzl", "python")
-python.toolchain(python_version = "3.8.12", is_default = False)
-python.toolchain(python_version = "3.9", is_default = True)
-```
-
-
-
-
-## py_test_rule
-
--py_test_rule(name, data, deps, env, env_inherit, imports, interpreter_options, main, - package_collisions, python_version, resolutions, srcs) -- -Run a Python program under Bazel. Most users should use the [py_test macro](#py_test) instead of loading this directly. - -**ATTRIBUTES** - - -| Name | Description | Type | Mandatory | Default | -| :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| data | Runtime dependencies of the program.
data dependencies will be available in the .runfiles folder for this binary/test. The program may optionally use the Runfiles lookup library to locate the data files, see https://pypi.org/project/bazel-runfiles/. | List of labels | optional | [] |
-| deps | Targets that produce Python code, commonly py_library rules. | List of labels | optional | [] |
-| env | Environment variables to set when running the binary. | Dictionary: String -> String | optional | {} |
-| env_inherit | Specifies additional environment variables to inherit from the external environment when the test is executed by bazel test. | List of strings | optional | [] |
-| imports | List of import directories to be added to the PYTHONPATH. | List of strings | optional | [] |
-| interpreter_options | Additional options to pass to the Python interpreter in addition to -B and -I passed by rules_py | List of strings | optional | [] |
-| main | Script to execute with the Python interpreter. | Label | required | |
-| package_collisions | The action that should be taken when a symlink collision is encountered when creating the venv. A collision can occur when multiple packages providing the same file are installed into the venv. The possible values are:"error" |
-| python_version | Whether to build this target and its transitive deps for a specific python version. | String | optional | "" |
-| resolutions | Satisfy a virtual_dep with a mapping from external package name to the label of an installed package that provides it. See [virtual dependencies](/docs/virtual_deps.md). | Dictionary: Label -> String | optional | {} |
-| srcs | Python source files. | List of labels | optional | [] |
-
-
-
-
-## py_pytest_main
-
--py_pytest_main(name, py_library, deps, data, testonly, kwargs) -- -py_pytest_main wraps the template rendering target and the final py_library. - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| name | The name of the runable target that updates the test entry file. | none | -| py_library | Use this attribute to override the default py_library rule. |
<unknown object com.google.devtools.build.skydoc.fakebuildapi.FakeStarlarkRuleFunctionsApi$RuleDefinitionIdentifier> |
-| deps | A list containing the pytest library target, e.g., @pypi_pytest//:pkg. | [] |
-| data | A list of data dependencies to pass to the py_library target. | [] |
-| testonly | A boolean indicating if the py_library target is testonly. | True |
-| kwargs | The extra arguments passed to the template rendering target. | none |
-
-
-
-
-## py_test
-
--py_test(name, srcs, main, pytest_main, kwargs) -- -Identical to [py_binary](./py_binary.md), but produces a target that can be used with `bazel test`. - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| name | Name of the rule. | none | -| srcs | Python source files. |
[] |
-| main | Entry point. Like rules_python, this is treated as a suffix of a file that should appear among the srcs. If absent, then [name].py is tried. As a final fallback, if the srcs has a single file, that is used as the main. | None |
-| pytest_main | If set, generate a [py_pytest_main](#py_pytest_main) script and use it as the main. The deps should include the pytest package (as well as the coverage package if desired). | False |
-| kwargs | additional named parameters to py_binary_rule. | none |
-
-
diff --git a/docs/venv.md b/docs/venv.md
deleted file mode 100644
index b9897c83..00000000
--- a/docs/venv.md
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-Implementation for the py_binary and py_test rules.
-
-
-
-## VirtualenvInfo
-
--VirtualenvInfo(home) -- - - Provider used to distinguish venvs from py rules. - - -**FIELDS** - - -| Name | Description | -| :------------- | :------------- | -| home | Path of the virtualenv | - - - - -## py_venv - -
-py_venv(kwargs) -- - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| kwargs |
-
| none | - - - - -## py_venv_binary - --py_venv_binary(kwargs) -- - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| kwargs |
-
| none | - - - - -## py_venv_link - --py_venv_link(venv_name, srcs, kwargs) -- -Build a Python virtual environment and produce a script to link it into the build directory. - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| venv_name |
-
|None |
-| srcs | -
|[] |
-| kwargs | -
| none | - - - - -## py_venv_test - --py_venv_test(kwargs) -- - - -**PARAMETERS** - - -| Name | Description | Default Value | -| :------------- | :------------- | :------------- | -| kwargs |
-
| none | - - diff --git a/docs/virtual_deps.md b/docs/virtual_deps.md index 01e2f459..ff9bc53c 100644 --- a/docs/virtual_deps.md +++ b/docs/virtual_deps.md @@ -1,10 +1,11 @@ # Resolution of "virtual" dependencies -rules_py allows external Python dependencies to be specified by name rather than as a label to an installed package, using a concept called "virtual" dependencies. +rules_py allows external Python dependencies to be specified by name rather than as a label to an installed package, using a concept called "virtual" dependencies. Virtual dependencies allow the terminal rule (for example, a `py_binary` or `py_test`) to control the version of the package which is used to satisfy the dependency, by providing a mapping from the package name to the label of an installed package that provides it. This feature allows: + - for individual projects within a monorepo to upgrade their dependencies independently of other projects within the same repository - overriding a single version of a dependency for a py_binary or py_test - to test against a range of different versions of dependencies for a single library @@ -93,4 +94,3 @@ py_binary( deps = [":proj"], ) ``` - diff --git a/internal_deps.bzl b/internal_deps.bzl index d31dd30b..d8619656 100644 --- a/internal_deps.bzl +++ b/internal_deps.bzl @@ -65,15 +65,6 @@ def rules_py_internal_deps(): ], ) - http_archive( - name = "io_bazel_stardoc", - sha256 = "3fd8fec4ddec3c670bd810904e2e33170bedfe12f90adf943508184be458c8bb", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz", - "https://github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz", - ], - ) - HERMETIC_CC_TOOLCHAIN_VERSION = "v2.2.1" http_archive( diff --git a/py/BUILD.bazel b/py/BUILD.bazel index 24eca3c2..05adbdcd 100644 --- a/py/BUILD.bazel +++ b/py/BUILD.bazel @@ -1,9 +1,6 @@ load("@bazel_lib//:bzl_library.bzl", "bzl_library") load("@bazel_skylib//rules:common_settings.bzl", "string_flag") -# For stardoc to reference the files -exports_files(["defs.bzl"]) - # For Bazel 6.x compatibility, since # PyRuntimeInfo shipped only with Bazel 7 # Users can set, e.g. --@aspect_rules_py//py:interpreter_version=3.9.18 diff --git a/py/private/BUILD.bazel b/py/private/BUILD.bazel index 2fa76e55..4807992c 100644 --- a/py/private/BUILD.bazel +++ b/py/private/BUILD.bazel @@ -1,9 +1,6 @@ load("@bazel_lib//:bzl_library.bzl", "bzl_library") -package(default_visibility = [ - "//docs:__pkg__", - "//py:__subpackages__", -]) +package(default_visibility = ["//py:__subpackages__"]) exports_files( [ @@ -13,14 +10,6 @@ exports_files( visibility = ["//visibility:public"], ) -exports_files( - [ - "py_binary.bzl", - "py_library.bzl", - ], - visibility = ["//docs:__pkg__"], -) - bzl_library( name = "py_image_layer", srcs = ["py_image_layer.bzl"], diff --git a/py/private/py_library.bzl b/py/private/py_library.bzl index 7caa2c68..a73c7572 100644 --- a/py/private/py_library.bzl +++ b/py/private/py_library.bzl @@ -222,7 +222,7 @@ _attrs = dict({ ), "resolutions": attr.label_keyed_string_dict( doc = """Satisfy a virtual_dep with a mapping from external package name to the label of an installed package that provides it. - See [virtual dependencies](/docs/virtual_deps.md). + See virtual_deps. """, ), }) diff --git a/py/private/py_venv/BUILD.bazel b/py/private/py_venv/BUILD.bazel index 469c4169..f6c151c7 100644 --- a/py/private/py_venv/BUILD.bazel +++ b/py/private/py_venv/BUILD.bazel @@ -2,10 +2,7 @@ load("@bazel_lib//:bzl_library.bzl", "bzl_library") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load(":defs.bzl", "py_venv_test") -package(default_visibility = [ - "//docs:__pkg__", - "//py:__subpackages__", -]) +package(default_visibility = ["//py:__subpackages__"]) exports_files([ "entrypoint.tmpl.sh", diff --git a/py/unstable/BUILD.bazel b/py/unstable/BUILD.bazel index a547a3fa..753761d0 100644 --- a/py/unstable/BUILD.bazel +++ b/py/unstable/BUILD.bazel @@ -1,8 +1,5 @@ load("@bazel_lib//:bzl_library.bzl", "bzl_library") -# For stardoc to reference the files -exports_files(["defs.bzl"]) - bzl_library( name = "defs", srcs = ["defs.bzl"],