| # Copyright 2024 The Bazel Authors. All rights reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| load("@bazel_skylib//:bzl_library.bzl", "bzl_library") | |
| load("@rules_python//python:defs.bzl", "py_library") | |
| load("//python:py_binary.bzl", "py_binary") | |
| load("//python/private:bzlmod_enabled.bzl", "BZLMOD_ENABLED") | |
| package(default_visibility = ["//:__subpackages__"]) | |
| licenses(["notice"]) | |
| filegroup( | |
| name = "distribution", | |
| srcs = glob( | |
| ["**"], | |
| exclude = ["requirements.txt"], | |
| ) + [ | |
| "//python/private/pypi/dependency_resolver:distribution", | |
| "//python/private/pypi/whl_installer:distribution", | |
| ], | |
| visibility = ["//python/private:__pkg__"], | |
| ) | |
| # Filegroup of bzl files that can be used by downstream rules for documentation generation | |
| filegroup( | |
| name = "bzl", | |
| srcs = glob(["**/*.bzl"]), | |
| visibility = [ | |
| "//python/private:__pkg__", | |
| "//tools/private:__pkg__", | |
| ], | |
| ) | |
| filegroup( | |
| name = "requirements_txt", | |
| srcs = ["requirements.txt"], | |
| visibility = ["//tools/private/update_deps:__pkg__"], | |
| ) | |
| # Keep sorted by library name and keep the files named by the main symbol they export | |
| bzl_library( | |
| name = "attrs_bzl", | |
| srcs = ["attrs.bzl"], | |
| ) | |
| bzl_library( | |
| name = "extension_bzl", | |
| srcs = ["extension.bzl"], | |
| deps = [ | |
| ":attrs_bzl", | |
| ":hub_repository_bzl", | |
| ":parse_requirements_bzl", | |
| ":parse_whl_name_bzl", | |
| ":pip_repository_attrs_bzl", | |
| ":simpleapi_download_bzl", | |
| ":whl_library_bzl", | |
| ":whl_repo_name_bzl", | |
| "//python/private:full_version_bzl", | |
| "//python/private:normalize_name_bzl", | |
| "//python/private:version_label_bzl", | |
| "@bazel_features//:features", | |
| ] + [ | |
| "@pythons_hub//:interpreters_bzl", | |
| ] if BZLMOD_ENABLED else [], | |
| ) | |
| bzl_library( | |
| name = "config_settings_bzl", | |
| srcs = ["config_settings.bzl"], | |
| deps = ["flags_bzl"], | |
| ) | |
| bzl_library( | |
| name = "deps_bzl", | |
| srcs = ["deps.bzl"], | |
| deps = [ | |
| "//python/private:bazel_tools_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "flags_bzl", | |
| srcs = ["flags.bzl"], | |
| deps = [ | |
| "//python/private:enum_bzl", | |
| "@bazel_skylib//rules:common_settings", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "generate_whl_library_build_bazel_bzl", | |
| srcs = ["generate_whl_library_build_bazel.bzl"], | |
| deps = [ | |
| ":labels_bzl", | |
| "//python/private:normalize_name_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "generate_group_library_build_bazel_bzl", | |
| srcs = ["generate_group_library_build_bazel.bzl"], | |
| deps = [ | |
| ":labels_bzl", | |
| "//python/private:normalize_name_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "group_library_bzl", | |
| srcs = ["group_library.bzl"], | |
| deps = [ | |
| ":generate_group_library_build_bazel_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "hub_repository_bzl", | |
| srcs = ["hub_repository.bzl"], | |
| visibility = ["//:__subpackages__"], | |
| deps = [ | |
| ":render_pkg_aliases_bzl", | |
| "//python/private:text_util_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "index_sources_bzl", | |
| srcs = ["index_sources.bzl"], | |
| ) | |
| bzl_library( | |
| name = "labels_bzl", | |
| srcs = ["labels.bzl"], | |
| ) | |
| bzl_library( | |
| name = "multi_pip_parse_bzl", | |
| srcs = ["multi_pip_parse.bzl"], | |
| deps = ["pip_repository_bzl"], | |
| ) | |
| bzl_library( | |
| name = "package_annotation_bzl", | |
| srcs = ["package_annotation.bzl"], | |
| ) | |
| bzl_library( | |
| name = "parse_requirements_bzl", | |
| srcs = ["parse_requirements.bzl"], | |
| deps = [ | |
| ":index_sources_bzl", | |
| ":parse_requirements_txt_bzl", | |
| ":whl_target_platforms_bzl", | |
| "//python/private:normalize_name_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "parse_requirements_txt_bzl", | |
| srcs = ["parse_requirements_txt.bzl"], | |
| ) | |
| bzl_library( | |
| name = "parse_simpleapi_html_bzl", | |
| srcs = ["parse_simpleapi_html.bzl"], | |
| ) | |
| bzl_library( | |
| name = "parse_whl_name_bzl", | |
| srcs = ["parse_whl_name.bzl"], | |
| ) | |
| bzl_library( | |
| name = "patch_whl_bzl", | |
| srcs = ["patch_whl.bzl"], | |
| deps = [ | |
| ":parse_whl_name_bzl", | |
| "//python/private:repo_utils_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "pip_bzl", | |
| srcs = ["pip.bzl"], | |
| deps = [ | |
| ":extension_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "pip_compile_bzl", | |
| srcs = ["pip_compile.bzl"], | |
| deps = [ | |
| ":deps_bzl", | |
| "//python:defs_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "pip_repository_bzl", | |
| srcs = ["pip_repository.bzl"], | |
| deps = [ | |
| ":attrs_bzl", | |
| ":parse_requirements_bzl", | |
| ":pip_repository_attrs_bzl", | |
| ":render_pkg_aliases_bzl", | |
| "//python/private:normalize_name_bzl", | |
| "//python/private:repo_utils_bzl", | |
| "//python/private:text_util_bzl", | |
| "@bazel_skylib//lib:sets", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "pip_repository_attrs_bzl", | |
| srcs = ["pip_repository_attrs.bzl"], | |
| ) | |
| bzl_library( | |
| name = "py_console_script_binary_bzl", | |
| srcs = [ | |
| ":py_console_script_binary.bzl", | |
| ":py_console_script_gen.bzl", | |
| ], | |
| deps = [ | |
| "//python:defs_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "render_pkg_aliases_bzl", | |
| srcs = ["render_pkg_aliases.bzl"], | |
| deps = [ | |
| ":generate_group_library_build_bazel_bzl", | |
| ":labels_bzl", | |
| ":parse_whl_name_bzl", | |
| ":whl_target_platforms_bzl", | |
| "//python/private:normalize_name_bzl", | |
| "//python/private:text_util_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "simpleapi_download_bzl", | |
| srcs = ["simpleapi_download.bzl"], | |
| deps = [ | |
| ":parse_simpleapi_html_bzl", | |
| "//python/private:auth_bzl", | |
| "//python/private:normalize_name_bzl", | |
| "//python/private:text_util_bzl", | |
| "@bazel_features//:features", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "whl_library_alias_bzl", | |
| srcs = ["whl_library_alias.bzl"], | |
| deps = [ | |
| ":render_pkg_aliases_bzl", | |
| "//python/private:full_version_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "whl_library_bzl", | |
| srcs = ["whl_library.bzl"], | |
| deps = [ | |
| ":attrs_bzl", | |
| ":deps_bzl", | |
| ":generate_whl_library_build_bazel_bzl", | |
| ":parse_whl_name_bzl", | |
| ":patch_whl_bzl", | |
| ":whl_target_platforms_bzl", | |
| "//python:repositories_bzl", | |
| "//python:versions_bzl", | |
| "//python/private:auth_bzl", | |
| "//python/private:envsubst_bzl", | |
| "//python/private:repo_utils_bzl", | |
| "//python/private:toolchains_repo_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "whl_repo_name_bzl", | |
| srcs = ["whl_repo_name.bzl"], | |
| deps = [ | |
| ":parse_whl_name_bzl", | |
| "//python/private:normalize_name_bzl", | |
| ], | |
| ) | |
| bzl_library( | |
| name = "whl_target_platforms_bzl", | |
| srcs = ["whl_target_platforms.bzl"], | |
| deps = [":parse_whl_name_bzl"], | |
| ) | |
| # Used for py_console_script_gen rule | |
| py_binary( | |
| name = "py_console_script_gen_py", | |
| srcs = ["py_console_script_gen.py"], | |
| main = "py_console_script_gen.py", | |
| visibility = [ | |
| "//visibility:public", | |
| ], | |
| ) | |
| py_library( | |
| name = "py_console_script_gen_lib", | |
| srcs = ["py_console_script_gen.py"], | |
| imports = ["../.."], | |
| visibility = [ | |
| "//tests/pypi/py_console_script:__pkg__", | |
| ], | |
| ) |