blob: e794075af0a7488f8b37dfe7c1d8e96ab0be3110 [file] [log] [blame]
# Copyright 2023 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")
package(
default_visibility = ["//:__subpackages__"],
)
bzl_library(
name = "pip_repository_bzl",
srcs = ["pip_repository.bzl"],
deps = [
":repositories_bzl",
":requirements_parser_bzl",
"//python:repositories_bzl",
"//python:versions_bzl",
"//python/pip_install/private:generate_group_library_build_bazel_bzl",
"//python/pip_install/private:generate_whl_library_build_bazel_bzl",
"//python/pip_install/private:srcs_bzl",
"//python/private:bzlmod_enabled_bzl",
"//python/private:envsubst_bzl",
"//python/private:normalize_name_bzl",
"//python/private:parse_whl_name_bzl",
"//python/private:patch_whl_bzl",
"//python/private:render_pkg_aliases_bzl",
"//python/private:repo_utils_bzl",
"//python/private:toolchains_repo_bzl",
"//python/private:whl_target_platforms_bzl",
"@bazel_skylib//lib:sets",
],
)
bzl_library(
name = "requirements_bzl",
srcs = ["requirements.bzl"],
deps = [
":repositories_bzl",
"//python:defs_bzl",
],
)
bzl_library(
name = "requirements_parser_bzl",
srcs = ["requirements_parser.bzl"],
)
bzl_library(
name = "repositories_bzl",
srcs = ["repositories.bzl"],
deps = [
"//:version_bzl",
"//python/private:bazel_tools_bzl",
"@bazel_skylib//lib:versions",
],
)
filegroup(
name = "distribution",
srcs = glob(["*.bzl"]) + [
"BUILD.bazel",
"pip_repository_requirements.bzl.tmpl",
"//python/pip_install/private:distribution",
"//python/pip_install/tools/dependency_resolver:distribution",
"//python/pip_install/tools/wheel_installer:distribution",
],
visibility = ["//:__pkg__"],
)
filegroup(
name = "repositories",
srcs = ["repositories.bzl"],
visibility = ["//tools/private/update_deps:__pkg__"],
)
filegroup(
name = "requirements_txt",
srcs = ["tools/requirements.txt"],
visibility = ["//tools/private/update_deps:__pkg__"],
)
filegroup(
name = "bzl",
srcs = glob(["*.bzl"]) + [
"//python/pip_install/private:bzl_srcs",
],
visibility = ["//:__subpackages__"],
)
filegroup(
name = "py_srcs",
srcs = [
"//python/pip_install/tools/dependency_resolver:py_srcs",
"//python/pip_install/tools/wheel_installer:py_srcs",
"//python/private:repack_whl.py",
"//tools:wheelmaker.py",
],
visibility = ["//python/pip_install/private:__pkg__"],
)
exports_files(
glob(["*.bzl"]),
visibility = ["//docs:__pkg__"],
)