Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ load("@rules_python_gazelle_plugin//modules_mapping:def.bzl", "modules_mapping")
# gazelle:exclude internal_deps.bzl
# gazelle:exclude py/tests/
# gazelle:exclude examples/django
# gazelle:map_kind bzl_library bzl_library @bazel_lib//:bzl_library.bzl

gazelle_python_manifest(
name = "gazelle_python_manifest",
Expand Down
3 changes: 2 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ module(
# py_image_layer requires 2.x for the `tar` rule.
# py_image_layer needs compute_unused_inputs attribute
# py_image_layer needs repo_mapping fix.
bazel_dep(name = "aspect_bazel_lib", version = "2.16.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.16.0") # TODO(alexeagle): remove
bazel_dep(name = "aspect_tools_telemetry", version = "0.2.8")
bazel_dep(name = "bazel_lib", version = "3.0.0-rc.0")
bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(name = "rules_python", version = "0.29.0")
bazel_dep(name = "platforms", version = "0.0.7")
Expand Down
7 changes: 7 additions & 0 deletions internal_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ def rules_py_internal_deps():
],
)

http_archive(
name = "bazel_lib",
sha256 = "0758ace949a93f709230a8e08ef35c5f0aacae2ff5d219b27da1d21d8233a709",
strip_prefix = "bazel-lib-3.0.0-rc.0",
url = "https://github.com/bazel-contrib/bazel-lib/releases/download/v3.0.0-rc.0/bazel-lib-v3.0.0-rc.0.tar.gz",
)

# Override bazel_skylib distribution to fetch sources instead
# so that the gazelle extension is included
# see https://github.com/bazelbuild/bazel-skylib/issues/250
Expand Down
32 changes: 31 additions & 1 deletion py/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")

# For stardoc to reference the files
Expand All @@ -19,6 +19,7 @@ bzl_library(
visibility = ["//visibility:public"],
deps = [
"//py/private/toolchain:autodetecting",
"@bazel_tools//tools/build_defs/repo:cache.bzl",
"@bazel_tools//tools/build_defs/repo:http.bzl",
"@bazel_tools//tools/build_defs/repo:utils.bzl",
],
Expand All @@ -42,3 +43,32 @@ bzl_library(
"@aspect_bazel_lib//lib:utils",
],
)

# This needs to dep on @aspect_tools_telemetry_report but we don't have that in WORKSPACE
# gazelle:exclude extensions.bzl
# bzl_library(
# name = "extensions",
# srcs = [
# "extensions.bzl",
# "@aspect_tools_telemetry_report//:defs.bzl",
# ],
# visibility = ["//visibility:public"],
# deps = [
# ":toolchains",
# "//tools:version",
# ],
# )

bzl_library(
name = "toolchains",
srcs = ["toolchains.bzl"],
visibility = ["//visibility:public"],
deps = [
"//py/private/toolchain:autodetecting",
"//py/private/toolchain:repo",
"//py/private/toolchain:tools",
"//tools:version",
"@aspect_bazel_lib//lib:repositories",
"@bazel_tools//tools/build_defs/repo:http.bzl",
],
)
28 changes: 13 additions & 15 deletions py/private/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_lib//:bzl_library.bzl", "bzl_library")

package(default_visibility = [
"//docs:__pkg__",
Expand Down Expand Up @@ -87,18 +87,6 @@ bzl_library(
],
)

bzl_library(
name = "providers",
srcs = ["providers.bzl"],
visibility = ["//py:__subpackages__"],
)

bzl_library(
name = "py_executable",
srcs = ["py_executable.bzl"],
visibility = ["//py:__subpackages__"],
)

bzl_library(
name = "py_pex_binary",
srcs = ["py_pex_binary.bzl"],
Expand All @@ -110,11 +98,21 @@ bzl_library(
)

bzl_library(
name = "virtual",
srcs = ["virtual.bzl"],
name = "providers",
srcs = ["providers.bzl"],
)

bzl_library(
name = "py_executable",
srcs = ["py_executable.bzl"],
)

bzl_library(
name = "transitions",
srcs = ["transitions.bzl"],
)

bzl_library(
name = "virtual",
srcs = ["virtual.bzl"],
)
8 changes: 7 additions & 1 deletion py/private/py_venv/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load(":defs.bzl", "py_venv_test")

Expand Down Expand Up @@ -50,3 +50,9 @@ py_venv_test(
imports = ["."],
main = "test_link.py",
)

bzl_library(
name = "defs",
srcs = ["defs.bzl"],
deps = [":py_venv"],
)
18 changes: 17 additions & 1 deletion py/private/toolchain/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_lib//:bzl_library.bzl", "bzl_library")
load(":tools.bzl", "resolved_venv_toolchain")

exports_files(
Expand Down Expand Up @@ -33,11 +33,27 @@ bzl_library(
deps = ["//py/private:py_semantics"],
)

bzl_library(
name = "repo",
srcs = ["repo.bzl"],
visibility = ["//py:__subpackages__"],
deps = [
":tools",
"//tools:integrity",
"//tools:version",
],
)

bzl_library(
name = "tools",
srcs = ["tools.bzl"],
visibility = [
"//py:__subpackages__",
"//tools:__subpackages__",
],
deps = [
":types",
"@bazel_skylib//lib:structs",
],
)

Expand Down
4 changes: 2 additions & 2 deletions py/unstable/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_lib//:bzl_library.bzl", "bzl_library")

# For stardoc to reference the files
exports_files(["defs.bzl"])
Expand All @@ -8,6 +8,6 @@ bzl_library(
srcs = ["defs.bzl"],
visibility = ["//visibility:public"],
deps = [
"//py/private/py_venv:defs.bzl",
"//py/private/py_venv:defs",
],
)
14 changes: 14 additions & 0 deletions tools/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@bazel_lib//:bzl_library.bzl", "bzl_library")

bzl_library(
name = "version",
srcs = ["version.bzl"],
visibility = ["//visibility:public"],
)

bzl_library(
name = "integrity",
srcs = ["integrity.bzl"],
visibility = ["//visibility:public"],
deps = ["//py/private/toolchain:tools"],
)