GeezerVison is showing github.com — refactor: introduce helper for defining distribution filegroups (#4152) · bookingcom/rules_python@14f436f
File treeExpand file treeCollapse file tree Open diff view settings tests/distribution_filegroup
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: command_line_option/BUILD.bazel +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | # treated as aliases for `//command_line_option:XXX` psuedo-targets. They | 5 | 5 | # are not actual flags or have any value. | 6 | 6 |
| | 7 | +load("//python/private:distribution_filegroup.bzl", "distribution_filegroup") # buildifier: disable=bzl-visibility | | 8 | + | 7 | 9 | package( | 8 | 10 | default_visibility = ["//visibility:public"], | 9 | 11 | ) | | 23 | 25 | actual = "//python:none", | 24 | 26 | ) | 25 | 27 |
| 26 | | -filegroup( | | 28 | +distribution_filegroup( | 27 | 29 | name = "distribution", | 28 | | - srcs = glob(["**"]), | 29 | | - visibility = ["//:__subpackages__"], | 30 | 30 | ) |
Collapse file Copy file name to clipboardExpand all lines: python/BUILD.bazel +2-18Lines changed: 2 additions & 18 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -29,31 +29,15 @@ that @rules_python//python is only concerned with the core rules. | 29 | 29 | # gazelle:resolve starlark //python:current_py_toolchain.bzl //python:current_py_toolchain_bzl | 30 | 30 |
| 31 | 31 | load("@bazel_skylib//:bzl_library.bzl", "bzl_library") | | 32 | +load("//python/private:distribution_filegroup.bzl", "distribution_filegroup") | 32 | 33 | load(":current_py_toolchain.bzl", "current_py_toolchain") | 33 | 34 |
| 34 | 35 | package(default_visibility = ["//visibility:public"]) | 35 | 36 |
| 36 | 37 | licenses(["notice"]) | 37 | 38 |
| 38 | | -filegroup( | | 39 | +distribution_filegroup( | 39 | 40 | name = "distribution", | 40 | | - srcs = glob(["**"]) + [ | 41 | | - "//python/api:distribution", | 42 | | - "//python/bin:distribution", | 43 | | - "//python/cc:distribution", | 44 | | - "//python/config_settings:distribution", | 45 | | - "//python/constraints:distribution", | 46 | | - "//python/entry_points:distribution", | 47 | | - "//python/extensions:distribution", | 48 | | - "//python/local_toolchains:distribution", | 49 | | - "//python/pip_install:distribution", | 50 | | - "//python/private:distribution", | 51 | | - "//python/runfiles:distribution", | 52 | | - "//python/runtime_env_toolchains:distribution", | 53 | | - "//python/uv:distribution", | 54 | | - "//python/zipapp:distribution", | 55 | | - ], | 56 | | - visibility = ["//:__pkg__"], | 57 | 41 | ) | 58 | 42 |
| 59 | 43 | # ========= bzl_library targets end ========= | |
Collapse file Copy file name to clipboardExpand all lines: python/api/BUILD.bazel +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 | # limitations under the License. | 14 | 14 |
| 15 | 15 | load("@bazel_skylib//:bzl_library.bzl", "bzl_library") | | 16 | +load("//python/private:distribution_filegroup.bzl", "distribution_filegroup") | 16 | 17 |
| 17 | 18 | package( | 18 | 19 | default_visibility = ["//:__subpackages__"], | 19 | 20 | ) | 20 | 21 |
| 21 | | -filegroup( | | 22 | +distribution_filegroup( | 22 | 23 | name = "distribution", | 23 | | - srcs = glob(["**"]), | 24 | 24 | ) | 25 | 25 |
| 26 | 26 | bzl_library( | |
Collapse file Copy file name to clipboardExpand all lines: python/bin/BUILD.bazel +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +load("//python/private:distribution_filegroup.bzl", "distribution_filegroup") | 1 | 2 | load("//python/private:interpreter.bzl", _interpreter_binary = "interpreter_binary") | 2 | 3 | load("//python/private:repl.bzl", "py_repl_binary") | 3 | 4 |
| 4 | | -filegroup( | | 5 | +package(default_visibility = ["//:__subpackages__"]) | | 6 | + | | 7 | +distribution_filegroup( | 5 | 8 | name = "distribution", | 6 | | - srcs = glob(["**"]), | 7 | | - visibility = ["//:__subpackages__"], | 8 | 9 | ) | 9 | 10 |
| 10 | 11 | _interpreter_binary( | |
Collapse file Copy file name to clipboardExpand all lines: python/cc/BUILD.bazel +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,6 +4,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") | 4 | 4 | load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") | 5 | 5 | load("//python/private:current_py_cc_headers.bzl", "current_py_cc_headers", "current_py_cc_headers_abi3") | 6 | 6 | load("//python/private:current_py_cc_libs.bzl", "current_py_cc_libs") | | 7 | +load("//python/private:distribution_filegroup.bzl", "distribution_filegroup") | 7 | 8 |
| 8 | 9 | package( | 9 | 10 | default_visibility = ["//:__subpackages__"], | @@ -47,9 +48,8 @@ toolchain_type( | 47 | 48 | visibility = ["//visibility:public"], | 48 | 49 | ) | 49 | 50 |
| 50 | | -filegroup( | | 51 | +distribution_filegroup( | 51 | 52 | name = "distribution", | 52 | | - srcs = glob(["**"]), | 53 | 53 | ) | 54 | 54 |
| 55 | 55 | bzl_library( | |
Collapse file Copy file name to clipboardExpand all lines: python/config_settings/BUILD.bazel +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag") | 2 | 2 | load("@pythons_hub//:versions.bzl", "DEFAULT_PYTHON_VERSION", "MINOR_MAPPING", "PYTHON_VERSIONS") | 3 | 3 | load("@rules_python_internal//:rules_python_config.bzl", "config") | | 4 | +load("//python/private:distribution_filegroup.bzl", "distribution_filegroup") | 4 | 5 | load( | 5 | 6 | "//python/private:flags.bzl", | 6 | 7 | "AddSrcsToRunfilesFlag", | @@ -19,15 +20,15 @@ load("//python/private:visibility.bzl", "NOT_ACTUALLY_PUBLIC") # buildifier: di | 19 | 20 | load("//python/private/pypi:flags.bzl", "define_pypi_internal_flags") | 20 | 21 | load(":config_settings.bzl", "construct_config_settings") | 21 | 22 |
| | 23 | +package(default_visibility = ["//:__subpackages__"]) | | 24 | + | 22 | 25 | # We don't generate bzl_library for these because they aren't public targets | 23 | 26 | # and should be moved | 24 | 27 | # gazelle:exclude config_settings.bzl | 25 | 28 | # gazelle:exclude transition.bzl | 26 | 29 |
| 27 | | -filegroup( | | 30 | +distribution_filegroup( | 28 | 31 | name = "distribution", | 29 | | - srcs = glob(["**"]), | 30 | | - visibility = ["//python:__pkg__"], | 31 | 32 | ) | 32 | 33 |
| 33 | 34 | construct_config_settings( | |
Collapse file Copy file name to clipboardExpand all lines: python/constraints/BUILD.bazel +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 | # See the License for the specific language governing permissions and | 13 | 13 | # limitations under the License. | 14 | 14 |
| | 15 | +load("//python/private:distribution_filegroup.bzl", "distribution_filegroup") | | 16 | + | 15 | 17 | package(default_visibility = ["//visibility:public"]) | 16 | 18 |
| 17 | 19 | licenses(["notice"]) | 18 | 20 |
| 19 | | -filegroup( | | 21 | +distribution_filegroup( | 20 | 22 | name = "distribution", | 21 | | - srcs = glob(["**"]), | 22 | | - visibility = ["//python:__pkg__"], | 23 | 23 | ) | 24 | 24 |
| 25 | 25 | # A constraint_setting to use for constraints related to the location of the | |
Collapse file Copy file name to clipboardExpand all lines: python/entry_points/BUILD.bazel +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 | # limitations under the License. | 14 | 14 |
| 15 | 15 | load("@bazel_skylib//:bzl_library.bzl", "bzl_library") | | 16 | +load("//python/private:distribution_filegroup.bzl", "distribution_filegroup") | | 17 | + | | 18 | +package(default_visibility = ["//:__subpackages__"]) | 16 | 19 |
| 17 | 20 | exports_files( | 18 | 21 | [ | @@ -21,10 +24,8 @@ exports_files( | 21 | 24 | visibility = ["//docs:__subpackages__"], | 22 | 25 | ) | 23 | 26 |
| 24 | | -filegroup( | | 27 | +distribution_filegroup( | 25 | 28 | name = "distribution", | 26 | | - srcs = glob(["**"]), | 27 | | - visibility = ["//python:__subpackages__"], | 28 | 29 | ) | 29 | 30 |
| 30 | 31 | bzl_library( | |
Collapse file Copy file name to clipboardExpand all lines: python/extensions/BUILD.bazel +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 | # limitations under the License. | 14 | 14 |
| 15 | 15 | load("@bazel_skylib//:bzl_library.bzl", "bzl_library") | | 16 | +load("//python/private:distribution_filegroup.bzl", "distribution_filegroup") | 16 | 17 |
| 17 | 18 | package(default_visibility = ["//visibility:public"]) | 18 | 19 |
| 19 | 20 | licenses(["notice"]) | 20 | 21 |
| 21 | | -filegroup( | | 22 | +distribution_filegroup( | 22 | 23 | name = "distribution", | 23 | | - srcs = glob(["**"]), | 24 | | - visibility = ["//python:__pkg__"], | 25 | 24 | ) | 26 | 25 |
| 27 | 26 | bzl_library( | |
Collapse file Copy file name to clipboardExpand all lines: python/local_toolchains/BUILD.bazel +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | load("@bazel_skylib//:bzl_library.bzl", "bzl_library") | | 2 | +load("//python/private:distribution_filegroup.bzl", "distribution_filegroup") | 2 | 3 |
| 3 | 4 | package(default_visibility = ["//:__subpackages__"]) | 4 | 5 |
| 5 | | -filegroup( | | 6 | +distribution_filegroup( | 6 | 7 | name = "distribution", | 7 | | - srcs = glob(["**"]), | 8 | 8 | ) | 9 | 9 |
| 10 | 10 | bzl_library( | |
|