1# Copyright 2024 The Bazel Authors. All rights reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15load("@bazel_skylib//:bzl_library.bzl", "bzl_library") 16 17package(default_visibility = ["//:__subpackages__"]) 18 19licenses(["notice"]) 20 21filegroup( 22 name = "distribution", 23 srcs = glob( 24 ["**"], 25 exclude = ["requirements.txt"], 26 ) + [ 27 "//python/private/pypi/dependency_resolver:distribution", 28 "//python/private/pypi/whl_installer:distribution", 29 ], 30 visibility = ["//python/private:__pkg__"], 31) 32 33# Filegroup of bzl files that can be used by downstream rules for documentation generation 34filegroup( 35 name = "bzl", 36 srcs = glob(["**/*.bzl"]), 37 visibility = [ 38 "//python/private:__pkg__", 39 "//tools/private:__pkg__", 40 ], 41) 42 43filegroup( 44 name = "requirements_txt", 45 srcs = ["requirements.txt"], 46 visibility = ["//tools/private/update_deps:__pkg__"], 47) 48 49# Keep sorted by library name and keep the files named by the main symbol they export 50 51bzl_library( 52 name = "attrs_bzl", 53 srcs = ["attrs.bzl"], 54) 55 56bzl_library( 57 name = "extension_bzl", 58 srcs = ["extension.bzl"], 59 deps = [ 60 ":attrs_bzl", 61 ":evaluate_markers_bzl", 62 ":hub_repository_bzl", 63 ":parse_requirements_bzl", 64 ":parse_whl_name_bzl", 65 ":pip_repository_attrs_bzl", 66 ":simpleapi_download_bzl", 67 ":whl_config_setting_bzl", 68 ":whl_library_bzl", 69 ":whl_repo_name_bzl", 70 "//python/private:full_version_bzl", 71 "//python/private:normalize_name_bzl", 72 "//python/private:semver_bzl", 73 "//python/private:version_label_bzl", 74 "@bazel_features//:features", 75 "@pythons_hub//:interpreters_bzl", 76 ], 77) 78 79bzl_library( 80 name = "config_settings_bzl", 81 srcs = ["config_settings.bzl"], 82 deps = ["flags_bzl"], 83) 84 85bzl_library( 86 name = "deps_bzl", 87 srcs = ["deps.bzl"], 88 deps = [ 89 "//python/private:bazel_tools_bzl", 90 "//python/private:glob_excludes_bzl", 91 ], 92) 93 94bzl_library( 95 name = "evaluate_markers_bzl", 96 srcs = ["evaluate_markers.bzl"], 97 deps = [ 98 ":pypi_repo_utils_bzl", 99 ], 100) 101 102bzl_library( 103 name = "flags_bzl", 104 srcs = ["flags.bzl"], 105 deps = [ 106 "//python/private:enum_bzl", 107 "@bazel_skylib//rules:common_settings", 108 ], 109) 110 111bzl_library( 112 name = "generate_whl_library_build_bazel_bzl", 113 srcs = ["generate_whl_library_build_bazel.bzl"], 114 deps = [ 115 "//python/private:text_util_bzl", 116 ], 117) 118 119bzl_library( 120 name = "generate_group_library_build_bazel_bzl", 121 srcs = ["generate_group_library_build_bazel.bzl"], 122 deps = [ 123 ":labels_bzl", 124 "//python/private:normalize_name_bzl", 125 ], 126) 127 128bzl_library( 129 name = "group_library_bzl", 130 srcs = ["group_library.bzl"], 131 deps = [ 132 ":generate_group_library_build_bazel_bzl", 133 ], 134) 135 136bzl_library( 137 name = "hub_repository_bzl", 138 srcs = ["hub_repository.bzl"], 139 visibility = ["//:__subpackages__"], 140 deps = [ 141 ":render_pkg_aliases_bzl", 142 "//python/private:text_util_bzl", 143 ], 144) 145 146bzl_library( 147 name = "index_sources_bzl", 148 srcs = ["index_sources.bzl"], 149) 150 151bzl_library( 152 name = "labels_bzl", 153 srcs = ["labels.bzl"], 154) 155 156bzl_library( 157 name = "multi_pip_parse_bzl", 158 srcs = ["multi_pip_parse.bzl"], 159 deps = [ 160 ":pip_repository_bzl", 161 "//python/private:text_util_bzl", 162 ], 163) 164 165bzl_library( 166 name = "package_annotation_bzl", 167 srcs = ["package_annotation.bzl"], 168) 169 170bzl_library( 171 name = "parse_requirements_bzl", 172 srcs = ["parse_requirements.bzl"], 173 deps = [ 174 ":index_sources_bzl", 175 ":parse_requirements_txt_bzl", 176 ":pypi_repo_utils_bzl", 177 ":requirements_files_by_platform_bzl", 178 ":whl_target_platforms_bzl", 179 "//python/private:normalize_name_bzl", 180 "//python/private:repo_utils_bzl", 181 ], 182) 183 184bzl_library( 185 name = "parse_requirements_txt_bzl", 186 srcs = ["parse_requirements_txt.bzl"], 187) 188 189bzl_library( 190 name = "parse_simpleapi_html_bzl", 191 srcs = ["parse_simpleapi_html.bzl"], 192) 193 194bzl_library( 195 name = "parse_whl_name_bzl", 196 srcs = ["parse_whl_name.bzl"], 197) 198 199bzl_library( 200 name = "patch_whl_bzl", 201 srcs = ["patch_whl.bzl"], 202 deps = [ 203 ":parse_whl_name_bzl", 204 "//python/private:repo_utils_bzl", 205 ], 206) 207 208bzl_library( 209 name = "pip_bzl", 210 srcs = ["pip.bzl"], 211 deps = [ 212 ":extension_bzl", 213 ], 214) 215 216bzl_library( 217 name = "pip_compile_bzl", 218 srcs = ["pip_compile.bzl"], 219 deps = [ 220 ":deps_bzl", 221 "//python:defs_bzl", 222 ], 223) 224 225bzl_library( 226 name = "pip_repository_bzl", 227 srcs = ["pip_repository.bzl"], 228 deps = [ 229 ":attrs_bzl", 230 ":evaluate_markers_bzl", 231 ":parse_requirements_bzl", 232 ":pip_repository_attrs_bzl", 233 ":render_pkg_aliases_bzl", 234 ":whl_config_setting_bzl", 235 "//python/private:normalize_name_bzl", 236 "//python/private:repo_utils_bzl", 237 "//python/private:text_util_bzl", 238 "@bazel_skylib//lib:sets", 239 ], 240) 241 242bzl_library( 243 name = "pip_repository_attrs_bzl", 244 srcs = ["pip_repository_attrs.bzl"], 245) 246 247bzl_library( 248 name = "pypi_repo_utils_bzl", 249 srcs = ["pypi_repo_utils.bzl"], 250 deps = [ 251 "//python/private:repo_utils_bzl", 252 "@bazel_skylib//lib:types", 253 ], 254) 255 256bzl_library( 257 name = "render_pkg_aliases_bzl", 258 srcs = ["render_pkg_aliases.bzl"], 259 deps = [ 260 ":generate_group_library_build_bazel_bzl", 261 ":parse_whl_name_bzl", 262 ":whl_config_setting_bzl", 263 ":whl_target_platforms_bzl", 264 "//python/private:normalize_name_bzl", 265 "//python/private:text_util_bzl", 266 ], 267) 268 269bzl_library( 270 name = "requirements_files_by_platform_bzl", 271 srcs = ["requirements_files_by_platform.bzl"], 272 deps = [ 273 ":whl_target_platforms_bzl", 274 ], 275) 276 277bzl_library( 278 name = "simpleapi_download_bzl", 279 srcs = ["simpleapi_download.bzl"], 280 deps = [ 281 ":parse_simpleapi_html_bzl", 282 "//python/private:auth_bzl", 283 "//python/private:normalize_name_bzl", 284 "//python/private:text_util_bzl", 285 "@bazel_features//:features", 286 ], 287) 288 289bzl_library( 290 name = "whl_config_setting_bzl", 291 srcs = ["whl_config_setting.bzl"], 292) 293 294bzl_library( 295 name = "whl_library_alias_bzl", 296 srcs = ["whl_library_alias.bzl"], 297 deps = [ 298 ":render_pkg_aliases_bzl", 299 "//python/private:full_version_bzl", 300 ], 301) 302 303bzl_library( 304 name = "whl_library_bzl", 305 srcs = ["whl_library.bzl"], 306 deps = [ 307 ":attrs_bzl", 308 ":deps_bzl", 309 ":generate_whl_library_build_bazel_bzl", 310 ":parse_whl_name_bzl", 311 ":patch_whl_bzl", 312 ":pypi_repo_utils_bzl", 313 ":whl_target_platforms_bzl", 314 "//python/private:auth_bzl", 315 "//python/private:envsubst_bzl", 316 "//python/private:is_standalone_interpreter_bzl", 317 "//python/private:repo_utils_bzl", 318 ], 319) 320 321bzl_library( 322 name = "whl_repo_name_bzl", 323 srcs = ["whl_repo_name.bzl"], 324 deps = [ 325 ":parse_whl_name_bzl", 326 "//python/private:normalize_name_bzl", 327 ], 328) 329 330bzl_library( 331 name = "whl_target_platforms_bzl", 332 srcs = ["whl_target_platforms.bzl"], 333 deps = [":parse_whl_name_bzl"], 334) 335